mirror of https://github.com/vitalif/openscad
maintain order of polygons in evaluateCGALMesh to fix issue 177. add option to dump more info to csgchain
parent
d87dd48215
commit
42043dd97d
|
@ -34,8 +34,8 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <map>
|
||||
|
||||
CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const AbstractNode &node)
|
||||
{
|
||||
|
@ -445,9 +445,9 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const PolySet &ps)
|
|||
struct PolyReducer
|
||||
{
|
||||
Grid2d<int> grid;
|
||||
boost::unordered_map<std::pair<int,int>, std::pair<int,int> > edge_to_poly;
|
||||
boost::unordered_map<int, CGAL_Nef_polyhedron2::Point> points;
|
||||
typedef boost::unordered_map<int, std::vector<int> > PolygonMap;
|
||||
std::map<std::pair<int,int>, std::pair<int,int> > edge_to_poly;
|
||||
std::map<int, CGAL_Nef_polyhedron2::Point> points;
|
||||
typedef std::map<int, std::vector<int> > PolygonMap;
|
||||
PolygonMap polygons;
|
||||
int poly_n;
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ void CSGChain::import(shared_ptr<CSGTerm> term, CSGTerm::type_e type)
|
|||
}
|
||||
}
|
||||
|
||||
std::string CSGChain::dump()
|
||||
std::string CSGChain::dump(bool full=false)
|
||||
{
|
||||
std::stringstream dump;
|
||||
|
||||
|
@ -193,6 +193,11 @@ std::string CSGChain::dump()
|
|||
else if (types[i] == CSGTerm::TYPE_INTERSECTION)
|
||||
dump << " *";
|
||||
dump << labels[i];
|
||||
if (full) {
|
||||
dump << " polyset: \n" << polysets[i]->dump() << "\n";
|
||||
dump << " matrix: \n" << matrices[i].matrix() << "\n";
|
||||
dump << " color: \n" << colors[i] << "\n";
|
||||
}
|
||||
}
|
||||
dump << "\n";
|
||||
return dump.str();
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
|
||||
void add(const shared_ptr<PolySet> &polyset, const Transform3d &m, const Color4f &color, CSGTerm::type_e type, std::string label);
|
||||
void import(shared_ptr<CSGTerm> term, CSGTerm::type_e type = CSGTerm::TYPE_UNION);
|
||||
std::string dump();
|
||||
std::string dump(bool full);
|
||||
|
||||
BoundingBox getBoundingBox() const;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue