summaryrefslogtreecommitdiff
path: root/dxftess.cc
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-06 09:21:40 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-06 09:21:40 (GMT)
commit6575732286d3f8909972d3705b748c6cfc02f8a8 (patch)
tree04ce107fa4c9e81aefc704ea47e90a040540582a /dxftess.cc
parent73e84ec660737616a22f5e8edbe95a69d2652c99 (diff)
Clifford Wolf:
Fixed inner-borders-bug in 2d visualization (symptom: rendering artefacts even with higher convexity setting as it should be needed) git-svn-id: http://svn.clifford.at/openscad/trunk@214 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'dxftess.cc')
-rw-r--r--dxftess.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/dxftess.cc b/dxftess.cc
index 3a567fa..bf89557 100644
--- a/dxftess.cc
+++ b/dxftess.cc
@@ -341,3 +341,23 @@ void dxf_tesselate(PolySet *ps, DxfData *dxf, double rot, bool up, double h)
tess_tri.clear();
}
+
+void dxf_border_to_ps(PolySet *ps, DxfData *dxf)
+{
+ for (int i = 0; i < dxf->paths.count(); i++) {
+ DxfData::Path *pt = &dxf->paths[i];
+ if (!pt->is_closed)
+ continue;
+ ps->borders.append(PolySet::Polygon());
+ for (int j = 1; j < pt->points.count(); j++) {
+ double x = pt->points[j]->x, y = pt->points[j]->y, z = 0.0;
+ ps->grid.align(x, y, z);
+ if (pt->is_inner) {
+ ps->borders.last().append(PolySet::Point(x, y, z));
+ } else {
+ ps->borders.last().insert(0, PolySet::Point(x, y, z));
+ }
+ }
+ }
+}
+
contact: Jan Huwald // Impressum