* Loft Intelligence - Select the whole sketch if the selected shape is a component of a sketch that is not a vertex (Fix#16630)
In fa8f29aed4 FeatureLoft.cpp was refactured, dropping some functionality, mainly the ability to create lofts to entire sketches or other 2d shapes if a single component that was not a single vertex was selected as either the base shape or a section
the old code was:
1 auto getSectionShape =
2 [](App::DocumentObject* feature, const std::vector<std::string> &subs) -> TopoDS_Shape {
3 if (!feature ||
4 !feature->isDerivedFrom(Part::Feature::getClassTypeId()))
5 throw Base::TypeError("Loft: Invalid profile/section");
6
7 auto subName = subs.empty() ? "" : subs.front();
8
9 // only take the entire shape when we have a sketch selected, but
10 // not a point of the sketch
11 if (feature->isDerivedFrom(Part::Part2DObject::getClassTypeId()) &&
12 subName.compare(0, 6, "Vertex") != 0)
13 return static_cast<Part::Part2DObject*>(feature)->Shape.getValue();
14 else {
15 if(subName.empty())
16 throw Base::ValueError("No valid subelement linked in Part::Feature");
17 return static_cast<Part::Feature*>(feature)->Shape.getShape().getSubShape(subName.c_str());
18 }
19 };
this commit forward-ports the missing functionality provided by line 7-12 in above snippet
* Code cleanup as suggested by (#16791)
This refactors a single solid rule checking code from using the solid
count directly to using well abstracted `isSingleSolidRuleSatisfied`
method. This makes code easier to read and is the basis for next step
which is allowing users to disable this checks.
* Toponaming: bring in missing code fragments in Sketcher
* Toponaming: Fix infinite recursion, remove debug cruft, rough in fillet test
* Bring in missing code; fix chamfers
* Toponaming: Add code for fillets and test
Used when finding subelements of a feature. Many of the comparisons used to also
check for string lengths, but as far as I can tell they are not strictly
necessary (see https://www.cplusplus.com/reference/string/string/substr/) and
just `substr` can be used without them. However, `compare` explicitly is for
comparing, and does not make a new object that `substr` does.
This is a combination of 4 commits. Original commit messages follow.
[PD] Initial support for point sections in loft
This commit allows the last section in a loft to be a single vertex of a solid.
Currently single vertices of sketches or datum points are NOT supported.
[PD] Allow loft "profiles" to be points
Most reliably done in dialog-based workflow.
[PD] Allow loft last section to be sketch point
[PD] Refactor `Loft::execute`
Makes it easier to support adding a single-vertex sketch in profile or sections
field when selecting the sketch in tree (i.e. without selecting subelements).
[PD] Refactoring after PR #5176 is merged
With these changes, one face per solid can be added as either the first
"profile" or subsequent sections in loft and pipe.
This commit depends on `App::PropertyXLinkSubList` preserving the order in which
sections are added.
A minor change this also adds is that when a solid's face is selected that face
is mentioned in the fields instead of the solid (eg `Box:Face1` instead of
`Box`).
Previously Subtractive loft would create a shape if there is no base
object. This is because the code is shared with Additive Loft, where
that is the right thing to do. Now we check for this, and return error
if there is nothing to subtract from.
Several typos and uniformity fixes.
Note:
*SCL/SimpleDataTypes.py is a upstream stepcode file whose fiz has been submitted upstream and accepted.
*the header of Tools/generateBase/generateMetaModel_Module.xsd had redundant data. It has been removed. Please double check it.
-Rename Sketchbased to ProfileBased to show new behavior
-Adopt ProfileBased to make the relevant helper functions work with faces too
-Adopt features for unified use of helper functions
-Adopt commands to allow face selection