SubShapeBinder: Add support for point.

This commit is contained in:
PaddleStroke
2024-12-06 18:29:50 +01:00
parent 9504b7e569
commit c5fbbb3830
2 changed files with 13 additions and 0 deletions

View File

@@ -1076,6 +1076,7 @@ static TopoShape _getTopoShape(const App::DocumentObject* obj,
shape = TopoShape(tag, hasher, _shape);
}
}
if (!shape.isNull()) {
shape.transformShape(mat * linkMat, false, true);
return shape;

View File

@@ -28,6 +28,7 @@
# include <BRep_Builder.hxx>
# include <BRepBuilderAPI_MakeEdge.hxx>
# include <BRepBuilderAPI_MakeFace.hxx>
# include <BRepBuilderAPI_MakeVertex.hxx>
#endif
#include <unordered_map>
@@ -194,6 +195,10 @@ void ShapeBinder::getFilteredReferences(const App::PropertyLinkSubList* prop,
obj = plane;
break;
}
if (auto point = dynamic_cast<App::Point*>(it)) {
obj = point;
break;
}
}
}
}
@@ -244,6 +249,13 @@ Part::TopoShape ShapeBinder::buildShapeFromReferences(App::GeoFeature* obj, std:
shape.setPlacement(obj->Placement.getValue());
return shape;
}
else if (obj->isDerivedFrom<App::Point>()) {
gp_Pnt point;
BRepBuilderAPI_MakeVertex mkPoint(point);
Part::TopoShape shape(mkPoint.Shape());
shape.setPlacement(obj->Placement.getValue());
return shape;
}
return TopoDS_Shape();
}