mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 06:18:09 +00:00
Skip IfcSweptDiskSolid.InnerRadii under IfcGeometricRepresentationContext.Precision. Thanks Stefan.
This commit is contained in:
@@ -724,7 +724,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcSurfaceCurveSweptAreaSolid* l,
|
|||||||
bool IfcGeom::Kernel::convert(const IfcSchema::IfcSweptDiskSolid* l, TopoDS_Shape& shape) {
|
bool IfcGeom::Kernel::convert(const IfcSchema::IfcSweptDiskSolid* l, TopoDS_Shape& shape) {
|
||||||
TopoDS_Wire wire, section1, section2;
|
TopoDS_Wire wire, section1, section2;
|
||||||
|
|
||||||
const bool hasInnerRadius = l->hasInnerRadius();
|
bool hasInnerRadius = l->hasInnerRadius();
|
||||||
|
|
||||||
if (!convert_wire(l->Directrix(), wire)) {
|
if (!convert_wire(l->Directrix(), wire)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -748,8 +748,13 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcSweptDiskSolid* l, TopoDS_Shap
|
|||||||
|
|
||||||
if (hasInnerRadius) {
|
if (hasInnerRadius) {
|
||||||
const double r2 = l->InnerRadius() * getValue(GV_LENGTH_UNIT);
|
const double r2 = l->InnerRadius() * getValue(GV_LENGTH_UNIT);
|
||||||
Handle(Geom_Circle) circle = new Geom_Circle(directrix, r2);
|
if (r2 < getValue(GV_PRECISION)) {
|
||||||
section2 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circle));
|
// Subtraction of pipes with small radii is unstable.
|
||||||
|
hasInnerRadius = false;
|
||||||
|
} else {
|
||||||
|
Handle(Geom_Circle) circle = new Geom_Circle(directrix, r2);
|
||||||
|
section2 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circle));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NB: Note that StartParam and EndParam param are ignored and the assumption is
|
// NB: Note that StartParam and EndParam param are ignored and the assumption is
|
||||||
|
|||||||
Reference in New Issue
Block a user