Fix bug that produced 'cannot update representation' error message on adding a fillet

This commit is contained in:
jrheinlaender 2013-05-18 08:47:20 +04:30 committed by Stefan Tröger
parent b18958b3d9
commit ed2657380c
2 changed files with 7 additions and 0 deletions

View File

@ -333,6 +333,11 @@ Base::BoundBox3d Body::getBoundBox()
Base::BoundBox3d result;
Part::Feature* tipSolid = static_cast<Part::Feature*>(getPrevSolidFeature());
TopoDS_Shape sh = tipSolid->Shape.getValue();
if (sh.IsNull())
// This can happen when a new feature is added without having its Shape property set yet
tipSolid = static_cast<Part::Feature*>(getPrevSolidFeature(NULL, false));
if (tipSolid != NULL) {
result = tipSolid->Shape.getShape().getBoundBox();
} else {

View File

@ -90,6 +90,8 @@ void ViewProviderDatumPlane::updateData(const App::Property* prop)
Base::BoundBox3d bbox = body->getBoundBox();
bbox = bbox.Transformed(plm.toMatrix());
double dlength = bbox.CalcDiagonalLength();
if (dlength < Precision::Confusion())
return;
bbox.Enlarge(0.1 * dlength);
// Calculate intersection of plane with bounding box edges