Exemplo n.º 1
0
bool IfcGeom::Kernel::convert(const IfcSchema::IfcHalfSpaceSolid* l, TopoDS_Shape& shape) {
    IfcSchema::IfcSurface* surface = l->BaseSurface();
    if ( ! surface->is(IfcSchema::Type::IfcPlane) ) {
        Logger::Message(Logger::LOG_ERROR, "Unsupported BaseSurface:", surface->entity);
        return false;
    }
    gp_Pln pln;
    IfcGeom::Kernel::convert((IfcSchema::IfcPlane*)surface,pln);
    const gp_Pnt pnt = pln.Location().Translated( l->AgreementFlag() ? -pln.Axis().Direction() : pln.Axis().Direction());
    shape = BRepPrimAPI_MakeHalfSpace(BRepBuilderAPI_MakeFace(pln),pnt).Solid();
    return true;
}
Exemplo n.º 2
0
TopoDS_Shape IfcGeom::halfspace_from_plane(const gp_Pln& pln,const gp_Pnt& cent) {
	TopoDS_Face face = BRepBuilderAPI_MakeFace(pln).Face();
	return BRepPrimAPI_MakeHalfSpace(face,cent).Solid();
}