diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-14 08:14:52 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-14 08:14:52 (GMT) |
commit | d349412aefa34723ddfb4cc532f6ca6621d6e3cc (patch) | |
tree | edc2f9d642e4335802703c4d0ba22c0c3a3647c4 /nef2dxf.cc | |
parent | e1d58382d94de47354080bb2c86099809d82e74a (diff) |
Clifford Wolf:
Improved handling of imported STL with small or thin triangles
git-svn-id: http://svn.clifford.at/openscad/trunk@283 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'nef2dxf.cc')
-rw-r--r-- | nef2dxf.cc | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -24,7 +24,7 @@ DxfData::DxfData(const struct CGAL_Nef_polyhedron &N) { - Grid2d<int> grid; + Grid2d<int> grid(GRID_COARSE); typedef CGAL_Nef_polyhedron2::Explorer Explorer; typedef Explorer::Face_const_iterator fci_t; @@ -34,7 +34,7 @@ DxfData::DxfData(const struct CGAL_Nef_polyhedron &N) for (fci_t fit = E.faces_begin(), fend = E.faces_end(); fit != fend; ++fit) { heafcc_t fcirc(E.halfedge(fit)), fend(fcirc); - int first_point = -1; + int first_point = -1, last_point = -1; CGAL_For_all(fcirc, fend) { if (E.is_standard(E.target(fcirc))) { Explorer::Point ep = E.point(E.target(fcirc)); @@ -50,7 +50,10 @@ DxfData::DxfData(const struct CGAL_Nef_polyhedron &N) paths.append(Path()); first_point = this_point; } - paths.last().points.append(&points[this_point]); + if (this_point != last_point) { + paths.last().points.append(&points[this_point]); + last_point = this_point; + } } } if (first_point >= 0) { |