Skeleton for planes+halfspaces. Might be wrong.

This commit is contained in:
Ken Arroyo Ohori
2017-03-07 14:30:48 -06:00
parent 27d8e86024
commit 3f94d4af37
4 changed files with 33 additions and 0 deletions
@@ -925,3 +925,21 @@ bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcTriangulatedFaceSet* l, cg
shape = CGAL::Nef_polyhedron_3<Kernel>(polyhedron);
return true;
}
bool IfcGeom::CgalKernel::convert(const IfcSchema::IfcHalfSpaceSolid* l, cgal_shape_t& shape) {
IfcSchema::IfcSurface* surface = l->BaseSurface();
if ( ! surface->is(IfcSchema::Type::IfcPlane) ) {
Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", surface->entity);
return false;
}
cgal_plane_t pln;
IfcGeom::CgalKernel::convert((IfcSchema::IfcPlane*)surface,pln);
// TODO: This might be the other way around?
if (!l->AgreementFlag()) pln = pln.opposite();
// const gp_Pnt pnt = pln.Location().Translated( l->AgreementFlag() ? -pln.Axis().Direction() : pln.Axis().Direction());
// shape = BRepPrimAPI_MakeHalfSpace(BRepBuilderAPI_MakeFace(pln),pnt).Solid();
shape = CGAL::Nef_polyhedron_3<Kernel>(pln);
return true;
}