summaryrefslogtreecommitdiff
path: root/src/CGALEvaluator.cc
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-03-11 15:59:52 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-03-11 15:59:52 (GMT)
commit4e2965ac17e4e8c64df327b3988bb0a4006f4357 (patch)
treed12bb37d0833963bbf6e13989a7cb224383fb768 /src/CGALEvaluator.cc
parent5559ae9a6af459021c5b7ab4a823f491dce822a0 (diff)
fix crashbug 2d resize. add 2d tests. print offscreen warning better.
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r--src/CGALEvaluator.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc
index a5a9d65..34f5bb6 100644
--- a/src/CGALEvaluator.cc
+++ b/src/CGALEvaluator.cc
@@ -185,8 +185,18 @@ CGAL_Nef_polyhedron CGALEvaluator::applyResize(const CgaladvNode &node)
// Based on resize() in Giles Bathgate's RapCAD
CGAL_Nef_polyhedron N;
N = applyToChildren(node, CGE_UNION);
+ CGAL_Iso_cuboid_3 bb;
+
+ if ( N.dim == 2 ) {
+ CGAL_Iso_rectangle_2e bbox = bounding_box( *N.p2 );
+ CGAL_Point_2e min2(bbox.min()), max2(bbox.max());
+ CGAL_Point_3 min3(min2.x(),min2.y(),0), max3(max2.x(),max2.y(),0);
+ bb = CGAL_Iso_cuboid_3( min3, max3 );
+ }
+ else {
+ bb = bounding_box( *N.p3 );
+ }
- CGAL_Iso_cuboid_3 bb = bounding_box( *N.p3 );
Eigen::Matrix<NT,3,1> scale, bbox_size;
scale << 1,1,1;
bbox_size << bb.xmax()-bb.xmin(), bb.ymax()-bb.ymin(), bb.zmax()-bb.zmin();
@@ -197,7 +207,10 @@ CGAL_Nef_polyhedron CGALEvaluator::applyResize(const CgaladvNode &node)
if (node.autosize)
for (int i=0;i<3;i++)
scale[i] = autoscale;
-
+ std::cout << autoscale << " ascale \n";
+ std::cout << scale[0] << ",";
+ std::cout << scale[1] << ",";
+ std::cout << scale[2] << " scalev \n";
Eigen::Matrix4d t;
t << CGAL::to_double(scale[0]), 0, 0, 0,
0, CGAL::to_double(scale[1]), 0, 0,
contact: Jan Huwald // Impressum