mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 20:36:27 +00:00
Merge branch 'master' into v0.6.0
This commit is contained in:
@@ -842,25 +842,33 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcCsgSolid* l, TopoDS_Shape& sha
|
|||||||
|
|
||||||
bool IfcGeom::Kernel::convert(const IfcSchema::IfcCurveBoundedPlane* l, TopoDS_Shape& face) {
|
bool IfcGeom::Kernel::convert(const IfcSchema::IfcCurveBoundedPlane* l, TopoDS_Shape& face) {
|
||||||
gp_Pln pln;
|
gp_Pln pln;
|
||||||
IfcGeom::Kernel::convert(l->BasisSurface(), pln);
|
if (!IfcGeom::Kernel::convert(l->BasisSurface(), pln)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
gp_Trsf trsf;
|
gp_Trsf trsf;
|
||||||
trsf.SetTransformation(pln.Position(), gp::XOY());
|
trsf.SetTransformation(pln.Position(), gp::XOY());
|
||||||
|
|
||||||
TopoDS_Wire outer;
|
TopoDS_Wire outer;
|
||||||
convert_wire(l->OuterBoundary(), outer);
|
if (!convert_wire(l->OuterBoundary(), outer)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
BRepBuilderAPI_MakeFace mf (outer);
|
BRepBuilderAPI_MakeFace mf(outer);
|
||||||
mf.Add(outer);
|
|
||||||
|
if (!mf.IsDone() || mf.Shape().IsNull()) {
|
||||||
|
Logger::Error("Invalid outer boundary:", l->OuterBoundary());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
IfcSchema::IfcCurve::list::ptr boundaries = l->InnerBoundaries();
|
IfcSchema::IfcCurve::list::ptr boundaries = l->InnerBoundaries();
|
||||||
|
|
||||||
for (IfcSchema::IfcCurve::list::it it = boundaries->begin(); it != boundaries->end(); ++it) {
|
for (IfcSchema::IfcCurve::list::it it = boundaries->begin(); it != boundaries->end(); ++it) {
|
||||||
TopoDS_Wire inner;
|
TopoDS_Wire inner;
|
||||||
convert_wire(*it, inner);
|
if (convert_wire(*it, inner)) {
|
||||||
|
|
||||||
mf.Add(inner);
|
mf.Add(inner);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ShapeFix_Shape sfs(mf.Face());
|
ShapeFix_Shape sfs(mf.Face());
|
||||||
sfs.Perform();
|
sfs.Perform();
|
||||||
|
|||||||
@@ -177,6 +177,15 @@ std::map<std::string, IfcUtil::IfcBaseEntity*> IfcGeom::Kernel::get_layers(IfcUt
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IfcGeom::Kernel::is_manifold(const TopoDS_Shape& a) {
|
bool IfcGeom::Kernel::is_manifold(const TopoDS_Shape& a) {
|
||||||
|
if (a.ShapeType() == TopAbs_COMPOUND) {
|
||||||
|
TopoDS_Iterator it(a);
|
||||||
|
for (; it.More(); it.Next()) {
|
||||||
|
if (!is_manifold(it.Value())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
TopTools_IndexedDataMapOfShapeListOfShape map;
|
TopTools_IndexedDataMapOfShapeListOfShape map;
|
||||||
TopExp::MapShapesAndAncestors(a, TopAbs_EDGE, TopAbs_FACE, map);
|
TopExp::MapShapesAndAncestors(a, TopAbs_EDGE, TopAbs_FACE, map);
|
||||||
|
|
||||||
@@ -187,4 +196,5 @@ bool IfcGeom::Kernel::is_manifold(const TopoDS_Shape& a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user