diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-02 18:19:17 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-02 18:19:17 (GMT) |
commit | f2d3621470b116255adf0510828b06903a0fc1eb (patch) | |
tree | 543c3b8161aed7fa44c863f83e85551b77444e82 /src | |
parent | 2f4582eeba31dae4ec07133e348c4938e106a930 (diff) |
bugfix: extrude nodes were broken for OpenCSG rendering
Diffstat (limited to 'src')
-rw-r--r-- | src/PolySetCGALEvaluator.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc index f556bcb..bfcd8f8 100644 --- a/src/PolySetCGALEvaluator.cc +++ b/src/PolySetCGALEvaluator.cc @@ -244,14 +244,15 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const DxfLinearExtrudeNode &node, { // Before extruding, union all (2D) children nodes // to a single DxfData, then tesselate this into a PolySet - CGAL_Nef_polyhedron N; - N.dim = 2; + CGAL_Nef_polyhedron sum; foreach (AbstractNode * v, node.getChildren()) { if (v->modinst->tag_background) continue; - N += this->cgalevaluator.evaluateCGALMesh(*v); + CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v); + if (sum.empty()) sum = N.copy(); + else sum += N; } - dxf = N.convertToDxfData();; + dxf = sum.convertToDxfData();; } else { dxf = new DxfData(node.fn, node.fs, node.fa, node.filename, node.layername, node.origin_x, node.origin_y, node.scale); } @@ -340,14 +341,15 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const DxfRotateExtrudeNode &node, { // Before extruding, union all (2D) children nodes // to a single DxfData, then tesselate this into a PolySet - CGAL_Nef_polyhedron N; - N.dim = 2; + CGAL_Nef_polyhedron sum; foreach (AbstractNode * v, node.getChildren()) { if (v->modinst->tag_background) continue; - N += this->cgalevaluator.evaluateCGALMesh(*v); + CGAL_Nef_polyhedron N = this->cgalevaluator.evaluateCGALMesh(*v); + if (sum.empty()) sum = N.copy(); + else sum += N; } - dxf = N.convertToDxfData(); + dxf = sum.convertToDxfData(); } else { dxf = new DxfData(node.fn, node.fs, node.fa, node.filename, node.layername, node.origin_x, node.origin_y, node.scale); } |