summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-02 19:37:43 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-02 19:37:43 (GMT)
commit818af2bcfc92f1b1d7cccb6937a481afb7517086 (patch)
tree3e3a5d27424643160c51e18683f7ff28c0be4992
parent5cc06832a173b0078cf12fffe530cdf303b033b2 (diff)
minor fix for projection node, but doesn't fix it all
-rw-r--r--src/PolySetCGALEvaluator.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc
index bfcd8f8..500c87d 100644
--- a/src/PolySetCGALEvaluator.cc
+++ b/src/PolySetCGALEvaluator.cc
@@ -107,7 +107,6 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node, Abstr
PolySet *ps3 = N.convertToPolyset();
CGAL_Nef_polyhedron np;
- np.dim = 2;
for (size_t i = 0; i < ps3->polygons.size(); i++)
{
int min_x_p = -1;
@@ -145,7 +144,14 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node, Abstr
else
plist.push_back(p);
}
- (*np.p2) += CGAL_Nef_polyhedron2(plist.begin(), plist.end(), CGAL_Nef_polyhedron2::INCLUDED);
+ // FIXME: Should the CGAL_Nef_polyhedron2 be cached?
+ if (np.empty()) {
+ np.dim = 2;
+ np.p2 = new CGAL_Nef_polyhedron2(plist.begin(), plist.end(), CGAL_Nef_polyhedron2::INCLUDED);
+ }
+ else {
+ (*np.p2) += CGAL_Nef_polyhedron2(plist.begin(), plist.end(), CGAL_Nef_polyhedron2::INCLUDED);
+ }
}
DxfData *dxf = np.convertToDxfData();
dxf_tesselate(ps, *dxf, 0, true, false, 0);
contact: Jan Huwald // Impressum