mirror of https://github.com/vitalif/openscad
commit
aab3c36f90
|
@ -150,9 +150,14 @@ CGAL_Nef_polyhedron CGALEvaluator::applyHull(const CgaladvNode &node)
|
||||||
}
|
}
|
||||||
else if (dim == 3) {
|
else if (dim == 3) {
|
||||||
CGAL_Polyhedron P;
|
CGAL_Polyhedron P;
|
||||||
chN.p3->convert_to_Polyhedron(P);
|
if (!chN.p3->is_simple()) {
|
||||||
std::transform(P.vertices_begin(), P.vertices_end(), std::back_inserter(points3d),
|
PRINT("Hull() currently requires a valid 2-manifold. Please modify your design. See http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/STL_Import_and_Export");
|
||||||
boost::bind(static_cast<const CGAL_Polyhedron::Vertex::Point_3&(CGAL_Polyhedron::Vertex::*)() const>(&CGAL_Polyhedron::Vertex::point), _1));
|
}
|
||||||
|
else {
|
||||||
|
chN.p3->convert_to_Polyhedron(P);
|
||||||
|
std::transform(P.vertices_begin(), P.vertices_end(), std::back_inserter(points3d),
|
||||||
|
boost::bind(static_cast<const CGAL_Polyhedron::Vertex::Point_3&(CGAL_Polyhedron::Vertex::*)() const>(&CGAL_Polyhedron::Vertex::point), _1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
chnode->progress_report();
|
chnode->progress_report();
|
||||||
}
|
}
|
||||||
|
@ -165,7 +170,8 @@ CGAL_Nef_polyhedron CGALEvaluator::applyHull(const CgaladvNode &node)
|
||||||
}
|
}
|
||||||
else if (dim == 3) {
|
else if (dim == 3) {
|
||||||
CGAL_Polyhedron P;
|
CGAL_Polyhedron P;
|
||||||
CGAL::convex_hull_3(points3d.begin(), points3d.end(), P);
|
if (points3d.size()>3)
|
||||||
|
CGAL::convex_hull_3(points3d.begin(), points3d.end(), P);
|
||||||
N = CGAL_Nef_polyhedron(new CGAL_Nef_polyhedron3(P));
|
N = CGAL_Nef_polyhedron(new CGAL_Nef_polyhedron3(P));
|
||||||
}
|
}
|
||||||
return N;
|
return N;
|
||||||
|
|
|
@ -15,3 +15,14 @@ translate([25,0,0]) hull() {
|
||||||
cylinder(r=5, h=5, center=true);
|
cylinder(r=5, h=5, center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't Crash (issue 188)
|
||||||
|
|
||||||
|
translate([-5,-5,-5]) {
|
||||||
|
hull() {
|
||||||
|
intersection(){
|
||||||
|
cube([1,1,1]);
|
||||||
|
translate([-1,-1,-1]) cube([1,1,1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue