Squashed some bugs

This commit is contained in:
Ken Arroyo Ohori
2017-03-30 19:04:39 -06:00
parent 583c334802
commit ed9676ed38
5 changed files with 53 additions and 11 deletions
@@ -63,9 +63,9 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcShellBasedSurfaceModel* l,
bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcManifoldSolidBrep* l, ConversionResults& shape) {
cgal_shape_t s;
CGAL::Nef_polyhedron_3<Kernel> nef_s(s);
const SurfaceStyle* collective_style = get_style(l);
if (convert_shape(l->Outer(),s) ) {
CGAL::Nef_polyhedron_3<Kernel> nef_s = create_nef_polyhedron(s);
const SurfaceStyle* indiv_style = get_style(l->Outer());
IfcSchema::IfcClosedShell::list::ptr voids(new IfcSchema::IfcClosedShell::list);
@@ -80,16 +80,15 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcManifoldSolidBrep* l, Conv
for (IfcSchema::IfcClosedShell::list::it it = voids->begin(); it != voids->end(); ++it) {
cgal_shape_t s2;
CGAL::Nef_polyhedron_3<Kernel> nef_s2(s2);
// TODO: This looks weird. Aren't we removing the outer shell again and again?
// Maybe it should be
// if (convert_shape(*it, s2)) {
if (convert_shape(l->Outer(), s2)) {
nef_s -= nef_s2;
nef_s -= CGAL::Nef_polyhedron_3<Kernel>(s2);
}
}
nef_s.convert_to_polyhedron(s);
s = create_polyhedron(nef_s);
shape.push_back(ConversionResult(new CgalShape(s), indiv_style ? indiv_style : collective_style));
return true;
}