summaryrefslogtreecommitdiff
path: root/polyset.cc
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-16 23:11:08 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-16 23:11:08 (GMT)
commitd05ea4453b875870375884d6671ca4f0cea624d8 (patch)
tree53ca5894e2f8d11afa33cbeaffb67bd9f15da1d2 /polyset.cc
parentcc3291a4f1def85273e0e1cc6e43bb0079965946 (diff)
Clifford Wolf:
Added first steps towards dxf extrusion support git-svn-id: http://svn.clifford.at/openscad/trunk@57 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'polyset.cc')
-rw-r--r--polyset.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/polyset.cc b/polyset.cc
index 9ff03ce..0acc78b 100644
--- a/polyset.cc
+++ b/polyset.cc
@@ -180,6 +180,8 @@ void PolySet::render_edges(colormode_e colormode) const
#ifdef ENABLE_CGAL
+#undef GEN_SURFACE_DEBUG
+
class CGAL_Build_PolySet : public CGAL::Modifier_base<CGAL_HDS>
{
public:
@@ -211,23 +213,41 @@ public:
}
B.begin_surface(vertices.size(), ps->polygons.size());
+#ifdef GEN_SURFACE_DEBUG
+ printf("=== CGAL Surface ===\n");
+#endif
for (int i = 0; i < vertices.size(); i++) {
const PolySet::Point *p = &vertices[i];
B.add_vertex(Point(p->x, p->y, p->z));
+#ifdef GEN_SURFACE_DEBUG
+ printf("%d: %f %f %f\n", i, p->x, p->y, p->z);
+#endif
}
for (int i = 0; i < ps->polygons.size(); i++) {
const PolySet::Polygon *poly = &ps->polygons[i];
B.begin_facet();
+#ifdef GEN_SURFACE_DEBUG
+ printf("F:");
+#endif
for (int j = 0; j < poly->size(); j++) {
const PolySet::Point *p = &poly->at(j);
PointKey_t pk = PointKey(p->x, p->y, p->z);
+#ifdef GEN_SURFACE_DEBUG
+ printf(" %d", vertices_idx[pk]);
+#endif
B.add_vertex_to_facet(vertices_idx[pk]);
}
+#ifdef GEN_SURFACE_DEBUG
+ printf("\n");
+#endif
B.end_facet();
}
+#ifdef GEN_SURFACE_DEBUG
+ printf("====================\n");
+#endif
B.end_surface();
#undef PointKey
contact: Jan Huwald // Impressum