Minor test tweaks, and small fixes to pass tests
This commit is contained in:
@@ -1450,9 +1450,13 @@ void Feature::onChanged(const App::Property* prop)
|
||||
if (!this->Shape.getValue().IsNull()) {
|
||||
try {
|
||||
p.fromMatrix(this->Shape.getShape().getTransform());
|
||||
#ifdef FC_USE_TNP_FIX
|
||||
this->Placement.setValueIfChanged(p);
|
||||
#else
|
||||
if (p != this->Placement.getValue()) {
|
||||
this->Placement.setValue(p);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
catch (const Base::ValueError&) {
|
||||
}
|
||||
|
||||
@@ -79,6 +79,9 @@ void PropertyPartShape::setValue(const TopoShape& sh)
|
||||
_Shape.Hasher = obj->getDocument()->getStringHasher();
|
||||
_Shape.hashChildMaps();
|
||||
}
|
||||
if ( ! _Shape.isNull() && ! _Shape.isValid() ) {
|
||||
_Shape.fix();
|
||||
}
|
||||
}
|
||||
hasSetValue();
|
||||
_Ver.clear();
|
||||
|
||||
@@ -645,6 +645,7 @@ Base::Matrix4D TopoShape::getTransform() const
|
||||
{
|
||||
Base::Matrix4D mtrx;
|
||||
gp_Trsf Trf = _Shape.Location().Transformation();
|
||||
Trf.SetScaleFactor(1.0);
|
||||
convertToMatrix(Trf, mtrx);
|
||||
return mtrx;
|
||||
}
|
||||
@@ -3034,9 +3035,10 @@ TopoDS_Shape TopoShape::transformGShape(const Base::Matrix4D& rclTrf, bool copy)
|
||||
mat.SetValue(1,4,rclTrf[0][3]);
|
||||
mat.SetValue(2,4,rclTrf[1][3]);
|
||||
mat.SetValue(3,4,rclTrf[2][3]);
|
||||
|
||||
// this copy step seems to eliminate Part.OCCError: gp_GTrsf::Trsf() - non-orthogonal GTrsf
|
||||
BRepBuilderAPI_Copy copier(this->_Shape);
|
||||
// geometric transformation
|
||||
BRepBuilderAPI_GTransform mkTrf(this->_Shape, mat, copy);
|
||||
BRepBuilderAPI_GTransform mkTrf(copier.Shape(), mat, copy);
|
||||
return mkTrf.Shape();
|
||||
}
|
||||
|
||||
|
||||
@@ -580,7 +580,7 @@ class TestTopologicalNamingProblem(unittest.TestCase):
|
||||
self.Doc.recompute()
|
||||
# Assert
|
||||
self.assertEqual(len(body.Shape.childShapes()), 1)
|
||||
self.assertEqual(body.Shape.childShapes()[0].ElementMapSize, 26)
|
||||
self.assertEqual(body.Shape.childShapes()[0].ElementMapSize, 30)
|
||||
|
||||
def testPartDesignElementMapPocket(self):
|
||||
pass # TODO
|
||||
|
||||
@@ -1815,7 +1815,7 @@ TEST_F(TopoShapeExpansionTest, makeElementThickSolid)
|
||||
|
||||
// Note: Cannot do an elementsMatch here because the oldest OCCT treats ThickSolid a little
|
||||
// differently. So, just mae sure the size is right, and something has a THK in it.
|
||||
for (auto element : elements) {
|
||||
for (auto& element : elements) {
|
||||
if (element.second.find("THK") > 0) {
|
||||
EXPECT_TRUE(1);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user