summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/export.cc18
-rw-r--r--src/export.h9
2 files changed, 24 insertions, 3 deletions
diff --git a/src/export.cc b/src/export.cc
index 6dce699..40ce6cb 100644
--- a/src/export.cc
+++ b/src/export.cc
@@ -53,7 +53,6 @@ void export_stl(CGAL_Nef_polyhedron *root_N, std::ostream &output)
output << "solid OpenSCAD_Model\n";
- int facet_count = 0;
for (FCI fi = P.facets_begin(); fi != P.facets_end(); ++fi) {
HFCC hc = fi->facet_begin();
HFCC hc_end = hc;
@@ -198,3 +197,20 @@ void export_dxf(CGAL_Nef_polyhedron *root_N, std::ostream &output)
#endif
+#ifdef DEBUG
+#include <boost/foreach.hpp>
+void export_stl(const PolySet &ps, std::ostream &output)
+{
+ output << "solid OpenSCAD_PolySet\n";
+ BOOST_FOREACH(const PolySet::Polygon &p, ps.polygons) {
+ output << "facet\n";
+ output << "outer loop\n";
+ BOOST_FOREACH(const Vector3d &v, p) {
+ output << "vertex " << v[0] << " " << v[1] << " " << v[2] << "\n";
+ }
+ output << "endloop\n";
+ output << "endfacet\n";
+ }
+ output << "endsolid OpenSCAD_PolySet\n";
+}
+#endif
diff --git a/src/export.h b/src/export.h
index 9750c30..3897be0 100644
--- a/src/export.h
+++ b/src/export.h
@@ -1,13 +1,18 @@
#ifndef EXPORT_H_
#define EXPORT_H_
-#ifdef ENABLE_CGAL
-
#include <iostream>
+#ifdef ENABLE_CGAL
+
void export_stl(class CGAL_Nef_polyhedron *root_N, std::ostream &output);
void export_off(CGAL_Nef_polyhedron *root_N, std::ostream &output);
void export_dxf(CGAL_Nef_polyhedron *root_N, std::ostream &output);
+
+#endif
+
+#ifdef DEBUG
+void export_stl(const class PolySet &ps, std::ostream &output);
#endif
#endif
contact: Jan Huwald // Impressum