From 22d92ed7d5cef5a06d5917d625fc359535cc67f6 Mon Sep 17 00:00:00 2001 From: kintel Date: Thu, 14 Jan 2010 11:08:47 +0000 Subject: [PATCH] constness, include future cgal code git-svn-id: http://svn.clifford.at/openscad/trunk@294 b57f626f-c46c-0410-a088-ec61d464b74c --- dxftess.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dxftess.cc b/dxftess.cc index 44336799..c0d4c0c7 100644 --- a/dxftess.cc +++ b/dxftess.cc @@ -23,19 +23,28 @@ #include "openscad.h" #include "printutils.h" +#ifdef CGAL_TESSELATE +#include "dxftess-cgal.cc" +#else #include "dxftess-glu.cc" +#endif // CGAL_TESSELATE +/*! + Converts all paths in the given DxfData to PolySet::borders polygons + without tesselating. Vertex ordering of the resulting polygons + will follow the paths' is_inner flag. +*/ 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) + const 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; + 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) { + if (pt.is_inner) { ps->borders.last().append(PolySet::Point(x, y, z)); } else { ps->borders.last().insert(0, PolySet::Point(x, y, z)); @@ -43,4 +52,3 @@ void dxf_border_to_ps(PolySet *ps, DxfData *dxf) } } } -