Merge branch 'main' into bgbsww-toponamingFeatureDressup10399

This commit is contained in:
bgbsww
2024-04-14 18:16:03 -04:00
committed by GitHub
4 changed files with 67 additions and 6 deletions

View File

@@ -18,8 +18,7 @@
<widget class="Gui::PrefCheckBox" name="guiprefcheckboxcheckupdates">
<property name="toolTip">
<string>If this option is selected, when launching the Addon Manager,
installed addons will be checked for available updates
(this requires the GitPython package installed on your system)</string>
installed addons will be checked for available updates</string>
</property>
<property name="text">
<string>Automatically check for updates at start (requires git)</string>

View File

@@ -291,7 +291,6 @@ class PythonPackageManager:
# Package Version
# ---------- -------
# gitdb 4.0.9
# GitPython 3.1.27
# setuptools 41.2.0
# Outdated Packages output looks like this:

View File

@@ -692,7 +692,11 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
else {
for (size_t i = 0; i < shapes.size(); ++i) {
auto& shape = shapes[i];
#ifdef FC_USE_TNP_FIX
shape = shape.makeElementTransform(*shapeMats[i]);
#else
shape = shape.makeTransform(*shapeMats[i]);
#endif
// if(shape.Hasher
// && shape.getElementMapSize()
// && shape.Hasher != getDocument()->getStringHasher())
@@ -707,9 +711,11 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
// Shape.resetElementMapVersion();
return;
}
#ifdef FC_USE_TNP_FIX
result.makeElementCompound(shapes);
#else
result.makeCompound(shapes);
#endif
bool fused = false;
if (Fuse.getValue()) {
// If the compound has solid, fuse them together, and ignore other type of
@@ -728,7 +734,11 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
}
else if (!solid.isNull()) {
// wrap the single solid in compound to keep its placement
#ifdef FC_USE_TNP_FIX
result.makeElementCompound({ solid });
#else
result.makeCompound({ solid });
#endif
fused = true;
}
}
@@ -737,6 +747,15 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
&& !result.hasSubShape(TopAbs_FACE)
&& result.hasSubShape(TopAbs_EDGE))
{
#ifdef FC_USE_TNP_FIX
result = result.makeElementWires();
if (MakeFace.getValue()) {
try {
result = result.makeElementFace(nullptr);
}
catch (...) {}
}
#else
result = result.makeWires();
if (MakeFace.getValue()) {
try {
@@ -744,16 +763,25 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
}
catch (...) {}
}
#endif
}
if (!fused && result.hasSubShape(TopAbs_WIRE)
&& Offset.getValue() != 0.0) {
try {
#ifdef FC_USE_TNP_FIX
result = result.makeElementOffset2D(Offset.getValue(),
(Part::JoinType) OffsetJoinType.getValue() ,
OffsetFill.getValue() ? Part::FillType::fill : Part::FillType::noFill,
OffsetOpenResult.getValue() ? Part::OpenResult::allowOpenResult : Part::OpenResult::noOpenResult,
OffsetIntersection.getValue());
#else
result = result.makeOffset2D(Offset.getValue(),
OffsetJoinType.getValue(),
OffsetFill.getValue(),
OffsetOpenResult.getValue(),
OffsetIntersection.getValue());
#endif
}
catch (...) {
std::ostringstream msg;
@@ -763,8 +791,11 @@ void SubShapeBinder::update(SubShapeBinder::UpdateOption options) {
}
if (Refine.getValue())
#ifdef FC_USE_TNP_FIX
result = result.makeElementRefine();
#else
result = result.makeRefine();
#endif
result.setPlacement(Placement.getValue());
Shape.setValue(result);
}

View File

@@ -664,6 +664,7 @@ class TestTopologicalNamingProblem(unittest.TestCase):
self.assertEqual(len(faces),26) # 6 Faces become 26 ( +8 + 2*6 )
self.assertEqual(len(edges),48) # 12 Edges become 48
self.assertEqual(len(vertexes),24) # 8 Vertices become 24
def testPartDesignElementMapFillet(self):
""" Test Fillet ( and FeatureDressup )"""
# Arrange
@@ -722,6 +723,37 @@ class TestTopologicalNamingProblem(unittest.TestCase):
self.assertEqual(len(body.Shape.childShapes()), 1)
self.assertEqual(body.Shape.childShapes()[0].ElementMapSize, 26)
def testPartDesignElementMapShapeBinder(self):
# Arrange
body = self.Doc.addObject('PartDesign::Body', 'Body')
box = self.Doc.addObject('PartDesign::AdditiveBox', 'Box')
shapebinder = self.Doc.addObject('PartDesign::ShapeBinder', 'ShapeBinder')
if body.Shape.ElementMapVersion == "": # Skip without element maps.
return
# Act / Assert
body.addObject(box)
body.addObject(shapebinder)
shapebinder.Support = [box]
self.Doc.recompute()
self.assertEqual(len(shapebinder.Shape.childShapes()), 1)
self.assertEqual(shapebinder.Shape.childShapes()[0].ElementMapSize, 26)
def testPartDesignElementMapSubShapeBinder(self):
# Arrange
body = self.Doc.addObject('PartDesign::Body', 'Body')
box = self.Doc.addObject('PartDesign::AdditiveBox', 'Box')
subshapebinder = self.Doc.addObject('PartDesign::SubShapeBinder', 'SubShapeBinder')
if body.Shape.ElementMapVersion == "": # Skip without element maps.
return
# Act / Assert
body.addObject(box)
body.addObject(subshapebinder)
subshapebinder.Support = [ (box, ["Face1"]) ]
self.assertEqual(len(body.Shape.childShapes()), 0)
self.Doc.recompute()
self.assertEqual(len(body.Shape.childShapes()), 1)
self.assertEqual(subshapebinder.Shape.childShapes()[0].ElementMapSize, 9)
def testSketchElementMap(self):
body = self.Doc.addObject('PartDesign::Body', 'Body')
sketch = self.Doc.addObject('Sketcher::SketchObject', 'Sketch')