[TD]fix crash on Cosmetic line > 10m

This commit is contained in:
wandererfan
2024-08-18 10:06:59 -04:00
committed by WandererFan
parent 21865c4e62
commit 2caf34c466
4 changed files with 9 additions and 4 deletions

View File

@@ -474,13 +474,16 @@ std::string BaseGeom::geomTypeName()
}
//! Convert 1 OCC edge into 1 BaseGeom (static factory method)
BaseGeomPtr BaseGeom::baseFactory(TopoDS_Edge edge)
// this should not return nullptr as things will break later on.
// regular geometry is stored scaled, but cosmetic geometry is stored in 1:1 scale, so the crazy edge
// check is not appropriate.
BaseGeomPtr BaseGeom::baseFactory(TopoDS_Edge edge, bool isCosmetic)
{
if (edge.IsNull()) {
Base::Console().Message("BG::baseFactory - input edge is NULL \n");
}
//weed out rubbish edges before making geometry
if (!validateEdge(edge)) {
if (!isCosmetic && !validateEdge(edge)) {
return nullptr;
}