From e71c3ce4c9ac506a1138c87df829bb0b187fe056 Mon Sep 17 00:00:00 2001 From: clifford Date: Wed, 6 Jan 2010 01:40:28 +0000 Subject: Clifford Wolf: Added 2d render() support git-svn-id: http://svn.clifford.at/openscad/trunk@207 b57f626f-c46c-0410-a088-ec61d464b74c diff --git a/render.cc b/render.cc index e48c6f8..a554f6a 100644 --- a/render.cc +++ b/render.cc @@ -156,10 +156,14 @@ CSGTerm *RenderNode::render_csg_term(double m[16], QVector *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 *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 *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)); -- cgit v0.10.1