summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-04 10:55:47 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-04 10:55:47 (GMT)
commit11e6d83eaf3813442a72fb7ea5637de374ca53b9 (patch)
treef8ff68dd6cba8330caf4a5e38f9c989e6e4c7744
parentac71e88d0418b96dab5643451be12168dc6f8168 (diff)
Clifford Wolf:
Transforms of 2d objects are now working git-svn-id: http://svn.clifford.at/openscad/trunk@199 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r--transform.cc11
1 files changed, 9 insertions, 2 deletions
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()));
contact: Jan Huwald // Impressum