From 11e6d83eaf3813442a72fb7ea5637de374ca53b9 Mon Sep 17 00:00:00 2001 From: clifford Date: Mon, 4 Jan 2010 10:55:47 +0000 Subject: Clifford Wolf: Transforms of 2d objects are now working git-svn-id: http://svn.clifford.at/openscad/trunk@199 b57f626f-c46c-0410-a088-ec61d464b74c diff --git a/transform.cc b/transform.cc index 19cc008..ff27e80 100644 --- a/transform.cc +++ b/transform.cc @@ -208,6 +208,10 @@ CGAL_Nef_polyhedron TransformNode::render_cgal_nef_polyhedron() const if (N.dim == 2) { + // WARNING: There must be an easier way to perform a CGAL_Aff_transformation2 + // on a CGAL_Nef_polyhedron2 than this. But I haven't found the right way to do + // it yet and this solution seams to work well. + CGAL_Aff_transformation2 t( m[0], m[4], m[12], m[1], m[5], m[13], m[15]); @@ -229,8 +233,11 @@ CGAL_Nef_polyhedron TransformNode::render_cgal_nef_polyhedron() const CGAL_For_all(fcirc, fend) { if (E.is_standard(E.target(fcirc))) { Explorer::Point ep = E.point(E.target(fcirc)); - // FIXME: Actually do the transformation - pdata_point_lists.back().push_back(ep); + CGAL_Kernel2::Point_2 tp = t.transform(CGAL_Kernel2::Point_2(ep.x(), ep.y())); + // FIXME: This to_double() calls should not be neccessary! It would be much better to reuse + // the gmpq value directly. But I haven't managed to kick CGAL hard enough to do the trick.. + CGAL_Nef_polyhedron2::Point p = CGAL_Nef_polyhedron2::Point(to_double(tp.x()), to_double(tp.y())); + pdata_point_lists.back().push_back(p); } } pdata.push_back(std::make_pair(pdata_point_lists.back().begin(), pdata_point_lists.back().end())); -- cgit v0.10.1