[TD]prevent fail during document restore
This commit is contained in:
@@ -795,9 +795,14 @@ TopoDS_Wire DrawComplexSection::makeSectionLineWire()
|
||||
App::DocumentObject* toolObj = CuttingToolWireObject.getValue();
|
||||
DrawViewPart* baseDvp = dynamic_cast<DrawViewPart*>(BaseView.getValue());
|
||||
if (baseDvp) {
|
||||
TopoDS_Shape toolShape = Part::Feature::getShape(toolObj);
|
||||
if (toolShape.IsNull()) {
|
||||
// CuttingToolWireObject is likely still restoring and has no shape yet
|
||||
return {};
|
||||
}
|
||||
Base::Vector3d centroid = baseDvp->getCurrentCentroid();
|
||||
TopoDS_Shape sTrans =
|
||||
ShapeUtils::ShapeUtils::moveShape(Part::Feature::getShape(toolObj), centroid * -1.0);
|
||||
ShapeUtils::ShapeUtils::moveShape(toolShape, centroid * -1.0);
|
||||
TopoDS_Shape sScaled = ShapeUtils::scaleShape(sTrans, baseDvp->getScale());
|
||||
//we don't mirror the scaled shape here as it will be mirrored by the projection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user