diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-06 01:40:28 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-06 01:40:28 (GMT) |
commit | e71c3ce4c9ac506a1138c87df829bb0b187fe056 (patch) | |
tree | 15e0217b7133d5690b8a1c96b5ccc31daf8f9542 | |
parent | 6f2f0016d1145a856b5ae2a647c7f8be51a3169e (diff) |
Clifford Wolf:
Added 2d render() support
git-svn-id: http://svn.clifford.at/openscad/trunk@207 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r-- | render.cc | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -156,10 +156,14 @@ CSGTerm *RenderNode::render_csg_term(double m[16], QVector<CSGTerm*> *highlights delete pd; } + PolySet *ps = NULL; + if (N.dim == 2) { - // FIXME - return NULL; + DxfData dd(N); + ps = new PolySet(); + ps->is2d = true; + dxf_tesselate(ps, &dd, 0, true, 0); } if (N.dim == 3) @@ -169,8 +173,7 @@ CSGTerm *RenderNode::render_csg_term(double m[16], QVector<CSGTerm*> *highlights return NULL; } - PolySet *ps = new PolySet(); - ps->convexity = convexity; + ps = new PolySet(); CGAL_Polyhedron P; N.p3.convert_to_Polyhedron(P); @@ -192,7 +195,11 @@ CSGTerm *RenderNode::render_csg_term(double m[16], QVector<CSGTerm*> *highlights ps->append_vertex(x, y, z); } while (hc != hc_end); } + } + if (ps) + { + ps->convexity = convexity; PolySet::ps_cache.insert(key, new PolySetPtr(ps->link())); CSGTerm *term = new CSGTerm(ps, m, QString("n%1").arg(idx)); |