diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-06 09:21:40 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-06 09:21:40 (GMT) |
commit | 6575732286d3f8909972d3705b748c6cfc02f8a8 (patch) | |
tree | 04ce107fa4c9e81aefc704ea47e90a040540582a /dxftess.cc | |
parent | 73e84ec660737616a22f5e8edbe95a69d2652c99 (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.cc | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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)); + } + } + } +} + |