PartDesign: Fix no longer possible to make a hole from one selected circle in a sketch (#21030)
* Search for profile shape subelements without simplifying compounds for hole center detection * Simpler solution
This commit is contained in:
@@ -1827,8 +1827,8 @@ static gp_Pnt toPnt(gp_Vec dir)
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn* Hole::execute()
|
||||
{
|
||||
TopoShape profileshape = getProfileShape(/*needSubElement*/ false);
|
||||
{
|
||||
TopoShape profileshape = getProfileShape();
|
||||
|
||||
// Find the base shape
|
||||
TopoShape base;
|
||||
|
||||
@@ -337,7 +337,7 @@ TopoDS_Shape ProfileBased::getVerifiedFace(bool silent) const {
|
||||
}
|
||||
else if (AllowMultiFace.getValue()) {
|
||||
try {
|
||||
auto shape = getProfileShape(/*needSubElement*/ false);
|
||||
auto shape = getProfileShape();
|
||||
if (shape.isNull())
|
||||
err = "Linked shape object is empty";
|
||||
else {
|
||||
@@ -404,7 +404,7 @@ TopoDS_Shape ProfileBased::getVerifiedFace(bool silent) const {
|
||||
return TopoDS_Face();
|
||||
}
|
||||
|
||||
TopoShape ProfileBased::getProfileShape(bool needSubElement) const
|
||||
TopoShape ProfileBased::getProfileShape() const
|
||||
{
|
||||
TopoShape shape;
|
||||
const auto& subs = Profile.getSubValues();
|
||||
@@ -416,7 +416,7 @@ TopoShape ProfileBased::getProfileShape(bool needSubElement) const
|
||||
std::vector<TopoShape> shapes;
|
||||
for (auto& sub : subs) {
|
||||
shapes.push_back(
|
||||
Part::Feature::getTopoShape(profile, sub.c_str(), needSubElement));
|
||||
Part::Feature::getTopoShape(profile, sub.c_str(), /* needSubElement */ true));
|
||||
}
|
||||
shape = TopoShape(shape.Tag).makeElementCompound(shapes);
|
||||
}
|
||||
@@ -472,7 +472,7 @@ std::vector<TopoShape> ProfileBased::getTopoShapeProfileWires() const
|
||||
// tessellations for some faces. Making an explicit copy of the linked
|
||||
// shape seems to fix it. The error mostly happens when re-computing the
|
||||
// shape but sometimes also for the first time
|
||||
auto shape = getProfileShape(/*needSubElement*/ false).makeElementCopy();
|
||||
auto shape = getProfileShape().makeElementCopy();
|
||||
|
||||
if (shape.hasSubShape(TopAbs_WIRE)) {
|
||||
return shape.getSubTopoShapes(TopAbs_WIRE);
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
|
||||
virtual Base::Vector3d getProfileNormal() const;
|
||||
|
||||
TopoShape getProfileShape(bool needSubElement = false) const;
|
||||
TopoShape getProfileShape() const;
|
||||
|
||||
/// retrieves the number of axes in the linked sketch (defined as construction lines)
|
||||
int getSketchAxisCount() const;
|
||||
|
||||
Reference in New Issue
Block a user