Skip IfcSweptDiskSolid.InnerRadii under IfcGeometricRepresentationContext.Precision. Thanks Stefan.

This commit is contained in:
Thomas Krijnen
2015-03-03 19:18:51 +00:00
parent 9bbbc6e7d9
commit aad6c77d00
+8 -3
View File
@@ -724,7 +724,7 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcSurfaceCurveSweptAreaSolid* l,
bool IfcGeom::Kernel::convert(const IfcSchema::IfcSweptDiskSolid* l, TopoDS_Shape& shape) {
TopoDS_Wire wire, section1, section2;
const bool hasInnerRadius = l->hasInnerRadius();
bool hasInnerRadius = l->hasInnerRadius();
if (!convert_wire(l->Directrix(), wire)) {
return false;
@@ -748,8 +748,13 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcSweptDiskSolid* l, TopoDS_Shap
if (hasInnerRadius) {
const double r2 = l->InnerRadius() * getValue(GV_LENGTH_UNIT);
Handle(Geom_Circle) circle = new Geom_Circle(directrix, r2);
section2 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circle));
if (r2 < getValue(GV_PRECISION)) {
// 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