From 97b84fc9f6f0626c563e724dcbc7f27ca386c1f9 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 20 Feb 2024 10:10:57 -0500 Subject: [PATCH 1/6] Toposhape/Part: Transfer in _makETransform, makETransform, makEGTransform --- src/Mod/Part/App/TopoShape.h | 136 ++++++++++++++++++++++++ src/Mod/Part/App/TopoShapeExpansion.cpp | 84 +++++++++++++++ 2 files changed, 220 insertions(+) diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index a3c3f94f33..728c604d00 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -1225,6 +1225,39 @@ public: } + /** Make a new shape with transformation that may contain non-uniform scaling + * + * @param source: input shape + * @param mat: transformation matrix + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * @param copy: whether to perform deep copy of the shape. If false, the + * shape will still be copied if there is scaling. + * + * @return The original content of this TopoShape is discarded and replaced + * with the new transformed shape. The function returns the + * TopoShape itself as a self reference so that multiple operations + * can be carried out for the same shape in the same line of code. + */ + TopoShape &makeElementGTransform(const TopoShape &source, const Base::Matrix4D &mat, + const char *op=nullptr, bool copy=false); + + /** Make a new shape with transformation that may contain non-uniform scaling + * + * @param source: input shape + * @param mat: transformation matrix + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * @param copy: whether to perform deep copy of the shape. If false, the + * shape will still be copied if there is scaling. + * + * @return Return a new shape with transformation. The shape itself is not + * modified + */ + TopoShape makeElementGTransform(const Base::Matrix4D &mat, const char *op=nullptr, bool copy=false) const { + return TopoShape(Tag,Hasher).makeElementGTransform(*this,mat,op,copy); + } + /** Make a deep copy of the shape * * @param source: input shape @@ -1313,6 +1346,109 @@ public: { return TopoShape(0, Hasher).makeElementBoolean(maker, *this, op, tol); } + + /** Make a new shape with transformation + * + * @param source: input shape + * @param mat: transformation matrix + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * @param checkScale: whether to check if the transformation matrix + * contains scaling factor. + * @param copy: whether to perform deep copy of the shape. If false, and + * checkScale is true, then the shape will be copied if there + * is scaling. + * + * @return Returns true if scaling is performed. + * + * The original content of this TopoShape is discarded and replaced with + * the new transformed shape. + */ + bool _makeElementTransform(const TopoShape &source, const Base::Matrix4D &mat, + const char *op=nullptr, bool checkScale=false, bool copy=false); + + /** Make a new shape with transformation + * + * @param source: input shape + * @param mat: transformation matrix + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * @param checkScale: whether to check if the transformation matrix + * contains scaling factor. + * @param copy: whether to perform deep copy of the shape. If false, and + * checkScale is true, then the shape will be copied if there + * is scaling. + * + * @return The original content of this TopoShape is discarded and replaced + * with the new transformed shape. The function returns the + * TopoShape itself as a self reference so that multiple operations + * can be carried out for the same shape in the same line of code. + */ + TopoShape &makeElementTransform(const TopoShape &source, const Base::Matrix4D &mat, + const char *op=nullptr, bool checkScale=false, bool copy=false) { + _makeElementTransform(source,mat,op,checkScale,copy); + return *this; + } + + /** Make a new shape with transformation + * + * @param source: input shape + * @param mat: transformation matrix + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * @param checkScale: whether to check if the transformation matrix + * contains scaling factor. + * @param copy: whether to perform deep copy of the shape. If false, and + * checkScale is true, then the shape will be copied if there + * is scaling. + * + * @return Return a new shape with transformation. The shape itself is not + * modified + */ + TopoShape makeElementTransform(const Base::Matrix4D &mat, const char *op=nullptr, + bool checkScale=false, bool copy=false) const { + return TopoShape(Tag,Hasher).makeElementTransform(*this,mat,op,checkScale,copy); + } + + /** Make a new shape with transformation + * + * @param source: input shape + * @param trsf: OCCT transformation matrix + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * @param checkScale: whether to check if the transformation matrix + * contains scaling factor. + * @param copy: whether to perform deep copy of the shape. If false, and + * checkScale is true, then the shape will be copied if there + * is scaling. + * + * @return The original content of this TopoShape is discarded and replaced + * with the new transformed shape. The function returns the + * TopoShape itself as a self reference so that multiple operations + * can be carried out for the same shape in the same line of code. + */ + TopoShape &makeElementTransform(const TopoShape &shape, const gp_Trsf &trsf, + const char *op=nullptr, bool copy=false); + + /** Make a new shape with transformation + * + * @param source: input shape + * @param trsf: OCCT transformation matrix + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * @param checkScale: whether to check if the transformation matrix + * contains scaling factor. + * @param copy: whether to perform deep copy of the shape. If false, and + * checkScale is true, then the shape will be copied if there + * is scaling. + * + * @return Return a new shape with transformation. The shape itself is not + * modified + */ + TopoShape makeElementTransform(const gp_Trsf &trsf, const char *op=nullptr, bool copy=false) const { + return TopoShape(Tag,Hasher).makeElementTransform(*this,trsf,op,copy); + } + /* Make draft shape * * @param source: the source shape diff --git a/src/Mod/Part/App/TopoShapeExpansion.cpp b/src/Mod/Part/App/TopoShapeExpansion.cpp index a68ff8a85d..5caa9e64f3 100644 --- a/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -82,6 +82,8 @@ #include #include +#include +#include #include "Geometry.h" FC_LOG_LEVEL_INIT("TopoShape", true, true) // NOLINT @@ -2450,6 +2452,88 @@ TopoShape& TopoShape::makeElementOrderedWires(const std::vector& shap return makeElementCompound(wires, nullptr, SingleShapeCompoundCreationPolicy::returnShape); } +bool TopoShape::_makeElementTransform(const TopoShape &shape, + const Base::Matrix4D &rclTrf, const char *op, bool checkScale, bool copy) +{ + if(checkScale) { + auto scaleType = rclTrf.hasScale(); + if (scaleType != Base::ScaleType::NoScaling && scaleType != Base::ScaleType::Uniform) { + makeElementGTransform(shape,rclTrf,op,copy); + return true; + } + } + makeElementTransform(shape,convert(rclTrf),op,copy); + return false; +} + +TopoShape &TopoShape::makeElementTransform(const TopoShape &shape, const gp_Trsf &trsf, const char *op, bool copy) { + if(!copy) { + // OCCT checks the ScaleFactor against gp::Resolution() which is DBL_MIN!!! + copy = trsf.ScaleFactor()*trsf.HVectorialPart().Determinant() < 0. || + Abs(Abs(trsf.ScaleFactor()) - 1) > Precision::Confusion(); + } + TopoShape tmp(shape); + if(copy) { + if(shape.isNull()) + FC_THROWM(NullShapeException, "Null input shape"); + + BRepBuilderAPI_Transform mkTrf(shape.getShape(), trsf, Standard_True); + // TODO: calling Moved() is to make sure the shape has some Location, + // which is necessary for STEP export to work. However, if we reach + // here, it porabably means BRepBuilderAPI_Transform has modified + // underlying shapes (because of scaling), it will break compound child + // parent relationship anyway. In short, STEP import/export will most + // likely break badly if there is any scaling involved + tmp.setShape(mkTrf.Shape().Moved(gp_Trsf()), false); + } else + tmp.move(trsf); + + if(op || (shape.Tag && shape.Tag!=Tag)) { + setShape(tmp._Shape); + initCache(); + if (!Hasher) + Hasher = tmp.Hasher; + copyElementMap(tmp, op); + } else + *this = tmp; + return *this; +} + +TopoShape &TopoShape::makeElementGTransform(const TopoShape &shape, + const Base::Matrix4D &rclTrf, const char *op, bool copy) +{ + if(shape.isNull()) + FC_THROWM(NullShapeException, "Null input shape"); + + // if(!op) op = Part::OpCodes::Gtransform; + gp_GTrsf mat; + mat.SetValue(1,1,rclTrf[0][0]); + mat.SetValue(2,1,rclTrf[1][0]); + mat.SetValue(3,1,rclTrf[2][0]); + mat.SetValue(1,2,rclTrf[0][1]); + mat.SetValue(2,2,rclTrf[1][1]); + mat.SetValue(3,2,rclTrf[2][1]); + mat.SetValue(1,3,rclTrf[0][2]); + mat.SetValue(2,3,rclTrf[1][2]); + mat.SetValue(3,3,rclTrf[2][2]); + mat.SetValue(1,4,rclTrf[0][3]); + mat.SetValue(2,4,rclTrf[1][3]); + mat.SetValue(3,4,rclTrf[2][3]); + + // geometric transformation + TopoShape tmp(shape); + BRepBuilderAPI_GTransform mkTrf(shape.getShape(), mat, copy); + tmp.setShape(mkTrf.Shape(), false); + if(op || (shape.Tag && shape.Tag!=Tag)) { + setShape(tmp._Shape); + initCache(); + if (!Hasher) + Hasher = tmp.Hasher; + copyElementMap(tmp, op); + } else + *this = tmp; + return *this; +} TopoShape& TopoShape::makeElementCopy(const TopoShape& shape, const char* op, bool copyGeom, bool copyMesh) From 907f59dc40a0382aa6458cb8199442534b23d1c1 Mon Sep 17 00:00:00 2001 From: bgbsww Date: Tue, 20 Feb 2024 11:40:24 -0500 Subject: [PATCH 2/6] Toponaming/Part: Clean and add tests for elementTransform methods --- src/Mod/Part/App/TopoShape.h | 95 +++++++++++------- src/Mod/Part/App/TopoShapeExpansion.cpp | 95 ++++++++++-------- tests/src/Mod/Part/App/TopoShapeExpansion.cpp | 97 ++++++++++++++++++- .../Part/App/TopoShapeMakeElementRefine.cpp | 2 +- 4 files changed, 211 insertions(+), 78 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index 728c604d00..60e295f000 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -202,6 +202,18 @@ enum class JoinType Intersection, }; +enum class CheckScale +{ + noScaleCheck, + checkScale +}; + +enum class Copy +{ + noCopy, + copy +}; + /** The representation for a CAD Shape */ // NOLINTNEXTLINE cppcoreguidelines-special-member-functions @@ -790,7 +802,7 @@ public: /** Make a hollowed solid by removing some faces from a given solid * - * @param source: input shape + * @param shape: input shape * @param faces: list of faces to remove, must be sub shape of the input shape * @param offset: thickness of the walls * @param tol: tolerance criterion for coincidence in generated shapes @@ -806,13 +818,12 @@ public: * a self reference so that multiple operations can be carried out * for the same shape in the same line of code. */ - TopoShape &makeElementThickSolid(const TopoShape &source, const std::vector &faces, + TopoShape &makeElementThickSolid(const TopoShape &shape, const std::vector &faces, double offset, double tol, bool intersection = false, bool selfInter = false, short offsetMode = 0, JoinType join = JoinType::Arc, const char *op=nullptr); /** Make a hollowed solid by removing some faces from a given solid * - * @param source: input shape * @param faces: list of faces to remove, must be sub shape of the input shape * @param offset: thickness of the walls * @param tol: tolerance criterion for coincidence in generated shapes @@ -1224,7 +1235,6 @@ public: return TopoShape(0, Hasher).makeElementWires(*this, op, tol, policy, output); } - /** Make a new shape with transformation that may contain non-uniform scaling * * @param source: input shape @@ -1239,8 +1249,10 @@ public: * TopoShape itself as a self reference so that multiple operations * can be carried out for the same shape in the same line of code. */ - TopoShape &makeElementGTransform(const TopoShape &source, const Base::Matrix4D &mat, - const char *op=nullptr, bool copy=false); + TopoShape& makeElementGTransform(const TopoShape& source, + const Base::Matrix4D& mat, + const char* op = nullptr, + Copy copy = Copy::noCopy); /** Make a new shape with transformation that may contain non-uniform scaling * @@ -1254,8 +1266,11 @@ public: * @return Return a new shape with transformation. The shape itself is not * modified */ - TopoShape makeElementGTransform(const Base::Matrix4D &mat, const char *op=nullptr, bool copy=false) const { - return TopoShape(Tag,Hasher).makeElementGTransform(*this,mat,op,copy); + TopoShape makeElementGTransform(const Base::Matrix4D& mat, + const char* op = nullptr, + Copy copy = Copy::noCopy) const + { + return TopoShape(Tag, Hasher).makeElementGTransform(*this, mat, op, copy); } /** Make a deep copy of the shape @@ -1355,8 +1370,8 @@ public: * the operation * @param checkScale: whether to check if the transformation matrix * contains scaling factor. - * @param copy: whether to perform deep copy of the shape. If false, and - * checkScale is true, then the shape will be copied if there + * @param copy: whether to perform deep copy of the shape. If noCopy, and + * checkScale, then the shape will be copied if there * is scaling. * * @return Returns true if scaling is performed. @@ -1364,8 +1379,11 @@ public: * The original content of this TopoShape is discarded and replaced with * the new transformed shape. */ - bool _makeElementTransform(const TopoShape &source, const Base::Matrix4D &mat, - const char *op=nullptr, bool checkScale=false, bool copy=false); + bool _makeElementTransform(const TopoShape& source, + const Base::Matrix4D& mat, + const char* op = nullptr, + CheckScale checkScale = CheckScale::noScaleCheck, + Copy copy = Copy::noCopy); /** Make a new shape with transformation * @@ -1375,8 +1393,8 @@ public: * the operation * @param checkScale: whether to check if the transformation matrix * contains scaling factor. - * @param copy: whether to perform deep copy of the shape. If false, and - * checkScale is true, then the shape will be copied if there + * @param copy: whether to perform deep copy of the shape. If noCopy, and + * checkScale, then the shape will be copied if there * is scaling. * * @return The original content of this TopoShape is discarded and replaced @@ -1384,9 +1402,13 @@ public: * TopoShape itself as a self reference so that multiple operations * can be carried out for the same shape in the same line of code. */ - TopoShape &makeElementTransform(const TopoShape &source, const Base::Matrix4D &mat, - const char *op=nullptr, bool checkScale=false, bool copy=false) { - _makeElementTransform(source,mat,op,checkScale,copy); + TopoShape& makeElementTransform(const TopoShape& source, + const Base::Matrix4D& mat, + const char* op = nullptr, + CheckScale checkScale = CheckScale::noScaleCheck, + Copy copy = Copy::noCopy) + { + _makeElementTransform(source, mat, op, checkScale, copy); return *this; } @@ -1398,16 +1420,19 @@ public: * the operation * @param checkScale: whether to check if the transformation matrix * contains scaling factor. - * @param copy: whether to perform deep copy of the shape. If false, and - * checkScale is true, then the shape will be copied if there + * @param copy: whether to perform deep copy of the shape. If noCopy, and + * checkScale, then the shape will be copied if there * is scaling. * * @return Return a new shape with transformation. The shape itself is not * modified */ - TopoShape makeElementTransform(const Base::Matrix4D &mat, const char *op=nullptr, - bool checkScale=false, bool copy=false) const { - return TopoShape(Tag,Hasher).makeElementTransform(*this,mat,op,checkScale,copy); + TopoShape makeElementTransform(const Base::Matrix4D& mat, + const char* op = nullptr, + CheckScale checkScale = CheckScale::noScaleCheck, + Copy copy = Copy::noCopy) + { + return TopoShape(Tag, Hasher).makeElementTransform(*this, mat, op, checkScale, copy); } /** Make a new shape with transformation @@ -1416,19 +1441,17 @@ public: * @param trsf: OCCT transformation matrix * @param op: optional string to be encoded into topo naming for indicating * the operation - * @param checkScale: whether to check if the transformation matrix - * contains scaling factor. - * @param copy: whether to perform deep copy of the shape. If false, and - * checkScale is true, then the shape will be copied if there - * is scaling. + * @param copy: whether to perform deep copy of the shape. * * @return The original content of this TopoShape is discarded and replaced * with the new transformed shape. The function returns the * TopoShape itself as a self reference so that multiple operations * can be carried out for the same shape in the same line of code. */ - TopoShape &makeElementTransform(const TopoShape &shape, const gp_Trsf &trsf, - const char *op=nullptr, bool copy=false); + TopoShape& makeElementTransform(const TopoShape& shape, + const gp_Trsf& trsf, + const char* op = nullptr, + Copy copy = Copy::noCopy); /** Make a new shape with transformation * @@ -1436,17 +1459,15 @@ public: * @param trsf: OCCT transformation matrix * @param op: optional string to be encoded into topo naming for indicating * the operation - * @param checkScale: whether to check if the transformation matrix - * contains scaling factor. - * @param copy: whether to perform deep copy of the shape. If false, and - * checkScale is true, then the shape will be copied if there - * is scaling. + * @param copy: whether to perform deep copy of the shape. * * @return Return a new shape with transformation. The shape itself is not * modified */ - TopoShape makeElementTransform(const gp_Trsf &trsf, const char *op=nullptr, bool copy=false) const { - return TopoShape(Tag,Hasher).makeElementTransform(*this,trsf,op,copy); + TopoShape + makeElementTransform(const gp_Trsf& trsf, const char* op = nullptr, Copy copy = Copy::noCopy) + { + return TopoShape(Tag, Hasher).makeElementTransform(*this, trsf, op, copy); } /* Make draft shape @@ -1687,7 +1708,7 @@ public: * makeShapeWithElementMap directly. For example: * makeElementShape(sewer, sources) * makeShapeWithElementMap(sewer.SewedShape(), MapperSewing(sewer), sources, OpCodes::Sewing); - * Note that if op exists in the method, it should be checked for null and overriden with + * Note that if op exists in the method, it should be checked for null and overridden with * the appropriate operation if so. */ diff --git a/src/Mod/Part/App/TopoShapeExpansion.cpp b/src/Mod/Part/App/TopoShapeExpansion.cpp index 5caa9e64f3..6fd47e438e 100644 --- a/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -48,7 +48,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -81,10 +83,6 @@ #include "Geometry.h" #include -#include -#include -#include -#include "Geometry.h" FC_LOG_LEVEL_INIT("TopoShape", true, true) // NOLINT @@ -2452,86 +2450,105 @@ TopoShape& TopoShape::makeElementOrderedWires(const std::vector& shap return makeElementCompound(wires, nullptr, SingleShapeCompoundCreationPolicy::returnShape); } -bool TopoShape::_makeElementTransform(const TopoShape &shape, - const Base::Matrix4D &rclTrf, const char *op, bool checkScale, bool copy) +bool TopoShape::_makeElementTransform(const TopoShape& shape, + const Base::Matrix4D& rclTrf, + const char* op, + CheckScale checkScale, + Copy copy) { - if(checkScale) { + if (checkScale == CheckScale::checkScale) { auto scaleType = rclTrf.hasScale(); if (scaleType != Base::ScaleType::NoScaling && scaleType != Base::ScaleType::Uniform) { - makeElementGTransform(shape,rclTrf,op,copy); + makeElementGTransform(shape, rclTrf, op, copy); return true; } } - makeElementTransform(shape,convert(rclTrf),op,copy); + makeElementTransform(shape, convert(rclTrf), op, copy); return false; } -TopoShape &TopoShape::makeElementTransform(const TopoShape &shape, const gp_Trsf &trsf, const char *op, bool copy) { - if(!copy) { +TopoShape& TopoShape::makeElementTransform(const TopoShape& shape, + const gp_Trsf& trsf, + const char* op, + Copy copy) +{ + if (copy == Copy::noCopy) { // OCCT checks the ScaleFactor against gp::Resolution() which is DBL_MIN!!! - copy = trsf.ScaleFactor()*trsf.HVectorialPart().Determinant() < 0. || - Abs(Abs(trsf.ScaleFactor()) - 1) > Precision::Confusion(); + copy = trsf.ScaleFactor() * trsf.HVectorialPart().Determinant() < 0. + || Abs(Abs(trsf.ScaleFactor()) - 1) > Precision::Confusion() ? Copy::copy : Copy::noCopy; } TopoShape tmp(shape); - if(copy) { - if(shape.isNull()) + if (copy == Copy::copy) { + if (shape.isNull()) { FC_THROWM(NullShapeException, "Null input shape"); + } BRepBuilderAPI_Transform mkTrf(shape.getShape(), trsf, Standard_True); // TODO: calling Moved() is to make sure the shape has some Location, // which is necessary for STEP export to work. However, if we reach - // here, it porabably means BRepBuilderAPI_Transform has modified + // here, it probably means BRepBuilderAPI_Transform has modified // underlying shapes (because of scaling), it will break compound child // parent relationship anyway. In short, STEP import/export will most // likely break badly if there is any scaling involved tmp.setShape(mkTrf.Shape().Moved(gp_Trsf()), false); - } else + } + else { tmp.move(trsf); + } - if(op || (shape.Tag && shape.Tag!=Tag)) { + if (op || (shape.Tag && shape.Tag != Tag)) { setShape(tmp._Shape); initCache(); - if (!Hasher) + if (!Hasher) { Hasher = tmp.Hasher; + } copyElementMap(tmp, op); - } else + } + else { *this = tmp; + } return *this; } -TopoShape &TopoShape::makeElementGTransform(const TopoShape &shape, - const Base::Matrix4D &rclTrf, const char *op, bool copy) +TopoShape& TopoShape::makeElementGTransform(const TopoShape& shape, + const Base::Matrix4D& rclTrf, + const char* op, + Copy copy) { - if(shape.isNull()) + if (shape.isNull()) { FC_THROWM(NullShapeException, "Null input shape"); + } // if(!op) op = Part::OpCodes::Gtransform; gp_GTrsf mat; - mat.SetValue(1,1,rclTrf[0][0]); - mat.SetValue(2,1,rclTrf[1][0]); - mat.SetValue(3,1,rclTrf[2][0]); - mat.SetValue(1,2,rclTrf[0][1]); - mat.SetValue(2,2,rclTrf[1][1]); - mat.SetValue(3,2,rclTrf[2][1]); - mat.SetValue(1,3,rclTrf[0][2]); - mat.SetValue(2,3,rclTrf[1][2]); - mat.SetValue(3,3,rclTrf[2][2]); - mat.SetValue(1,4,rclTrf[0][3]); - mat.SetValue(2,4,rclTrf[1][3]); - mat.SetValue(3,4,rclTrf[2][3]); + mat.SetValue(1, 1, rclTrf[0][0]); + mat.SetValue(2, 1, rclTrf[1][0]); + mat.SetValue(3, 1, rclTrf[2][0]); + mat.SetValue(1, 2, rclTrf[0][1]); + mat.SetValue(2, 2, rclTrf[1][1]); + mat.SetValue(3, 2, rclTrf[2][1]); + mat.SetValue(1, 3, rclTrf[0][2]); + mat.SetValue(2, 3, rclTrf[1][2]); + mat.SetValue(3, 3, rclTrf[2][2]); + mat.SetValue(1, 4, rclTrf[0][3]); + mat.SetValue(2, 4, rclTrf[1][3]); + mat.SetValue(3, 4, rclTrf[2][3]); // geometric transformation TopoShape tmp(shape); - BRepBuilderAPI_GTransform mkTrf(shape.getShape(), mat, copy); + BRepBuilderAPI_GTransform mkTrf(shape.getShape(), mat, copy == Copy::copy); tmp.setShape(mkTrf.Shape(), false); - if(op || (shape.Tag && shape.Tag!=Tag)) { + if (op || (shape.Tag && shape.Tag != Tag)) { setShape(tmp._Shape); initCache(); - if (!Hasher) + if (!Hasher) { Hasher = tmp.Hasher; + } copyElementMap(tmp, op); - } else + } + else { *this = tmp; + } return *this; } diff --git a/tests/src/Mod/Part/App/TopoShapeExpansion.cpp b/tests/src/Mod/Part/App/TopoShapeExpansion.cpp index 4be1750e9c..b9fe3b3207 100644 --- a/tests/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/tests/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -1491,7 +1491,6 @@ TEST_F(TopoShapeExpansionTest, makeElementThickSolid) EXPECT_EQ(elements[IndexedName("Edge", 1)], MappedName("Edge11;THK;:H1:4,E")); } - TEST_F(TopoShapeExpansionTest, makeElementGeneralFuse) { // Arrange @@ -1543,6 +1542,7 @@ TEST_F(TopoShapeExpansionTest, makeElementFuse) "FUS;:H1:7,F;:U2;FUS;:H1:8,E;:U;FUS;:H1:7,V;:L(Face6;:M;FUS;:H1:7,F;:U2;FUS;:H1:8,E;:U;" "FUS;:H1:7,V);FUS;:H1:3c,E|Face6;:M;FUS;:H1:7,F;:U2;FUS;:H1:8,E);FUS;:H1:cb,F")); } + TEST_F(TopoShapeExpansionTest, makeElementCut) { // Arrange @@ -1569,4 +1569,99 @@ TEST_F(TopoShapeExpansionTest, makeElementCut) "CUT;:H1:7,V);CUT;:H1:3c,E|Face6;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E);CUT;:H1:cb,F")); } +TEST_F(TopoShapeExpansionTest, makeElementTransformWithoutMap) +{ + // Arrange + auto [cube1, cube2] = CreateTwoCubes(); + auto tr {gp_Trsf()}; + tr.SetTranslation(gp_Vec(gp_XYZ(-0.5, -0.5, 0))); + TopoShape topoShape1 {cube1, 1L}; + // Act + TopoShape& result = topoShape1.makeElementTransform(topoShape1, tr); + auto elements = elementMap(result); + Base::BoundBox3d bb = result.getBoundBox(); + // Assert shape is correct + EXPECT_TRUE(PartTestHelpers::boxesMatch(bb, Base::BoundBox3d(-0.5, -0.5, 0.0, 0.5, 0.5, 1.0))); + EXPECT_FLOAT_EQ(getVolume(result.getShape()), 1); + // Assert elementMap is correct + EXPECT_EQ(elements.size(), 0); +} + +TEST_F(TopoShapeExpansionTest, makeElementTransformWithMap) +{ + // Arrange + auto [cube1, cube2] = CreateTwoCubes(); + auto tr {gp_Trsf()}; + tr.SetTranslation(gp_Vec(gp_XYZ(-0.5, -0.5, 0))); + cube2.Move(TopLoc_Location(tr)); + TopoShape topoShape1 {cube1, 1L}; + TopoShape topoShape2 {cube2, 2L}; + // Act + TopoShape& result = topoShape1.makeElementFuse({topoShape1, topoShape2}); // op, tolerance + topoShape1.makeElementTransform(result, tr); + auto elements = elementMap(result); + Base::BoundBox3d bb = result.getBoundBox(); + // Assert shape is correct + EXPECT_TRUE(PartTestHelpers::boxesMatch(bb, Base::BoundBox3d(-0.5, -1.0, 0.0, 1.0, 0.5, 1.0))); + EXPECT_FLOAT_EQ(getVolume(result.getShape()), 1.75); + // Assert elementMap is correct + EXPECT_EQ(elements.size(), 66); + EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1); + EXPECT_EQ( + elements[IndexedName("Face", 1)], + MappedName( + "Face3;:M;FUS;:H1:7,F;:U;FUS;:H1:7,E;:L(Face5;:M;FUS;:H1:7,F;:U2;FUS;:H1:8,E|Face5;:M;" + "FUS;:H1:7,F;:U2;FUS;:H1:8,E;:U;FUS;:H1:7,V;:L(Face6;:M;FUS;:H1:7,F;:U2;FUS;:H1:8,E;:U;" + "FUS;:H1:7,V);FUS;:H1:3c,E|Face6;:M;FUS;:H1:7,F;:U2;FUS;:H1:8,E);FUS;:H1:cb,F")); +} + +TEST_F(TopoShapeExpansionTest, makeElementGTransformWithoutMap) +{ + // Arrange + auto [cube1, cube2] = CreateTwoCubes(); + auto tr {gp_Trsf()}; + tr.SetTranslation(gp_Vec(gp_XYZ(-0.5, -0.5, 0))); + TopoShape topoShape1 {cube1, 1L}; + // Act + TopoShape& result = topoShape1.makeElementGTransform(topoShape1, TopoShape::convert(tr)); + auto elements = elementMap(result); + Base::BoundBox3d bb = result.getBoundBox(); + // Assert shape is correct + EXPECT_TRUE(PartTestHelpers::boxesMatch(bb, Base::BoundBox3d(-0.5, -0.5, 0.0, 0.5, 0.5, 1.0))); + EXPECT_FLOAT_EQ(getVolume(result.getShape()), 1); + // Assert elementMap is correct + EXPECT_EQ(elements.size(), 0); +} + +TEST_F(TopoShapeExpansionTest, makeElementGTransformWithMap) +{ + // Arrange + auto [cube1, cube2] = CreateTwoCubes(); + auto tr {gp_Trsf()}; + tr.SetTranslation(gp_Vec(gp_XYZ(-0.5, -0.5, 0))); + cube2.Move(TopLoc_Location(tr)); + TopoShape topoShape1 {cube1, 1L}; + TopoShape topoShape2 {cube2, 2L}; + // Act + TopoShape& result = topoShape1.makeElementFuse({topoShape1, topoShape2}); // op, tolerance + topoShape1.makeElementGTransform(result, TopoShape::convert(tr)); + auto elements = elementMap(result); + Base::BoundBox3d bb = result.getBoundBox(); + // Assert shape is correct + EXPECT_TRUE(PartTestHelpers::boxesMatch(bb, Base::BoundBox3d(-0.5, -1.0, 0.0, 1.0, 0.5, 1.0))); + EXPECT_FLOAT_EQ(getVolume(result.getShape()), 1.75); + // Assert elementMap is correct + EXPECT_EQ(elements.size(), 66); + EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1); + EXPECT_EQ( + elements[IndexedName("Face", 1)], + MappedName( + "Face3;:M;FUS;:H1:7,F;:U;FUS;:H1:7,E;:L(Face5;:M;FUS;:H1:7,F;:U2;FUS;:H1:8,E|Face5;:M;" + "FUS;:H1:7,F;:U2;FUS;:H1:8,E;:U;FUS;:H1:7,V;:L(Face6;:M;FUS;:H1:7,F;:U2;FUS;:H1:8,E;:U;" + "FUS;:H1:7,V);FUS;:H1:3c,E|Face6;:M;FUS;:H1:7,F;:U2;FUS;:H1:8,E);FUS;:H1:cb,F")); +} + +// Not testing _makeElementTransform as it is a thin wrapper that calls the same places as the four +// preceding tests. + // NOLINTEND(readability-magic-numbers,cppcoreguidelines-avoid-magic-numbers) diff --git a/tests/src/Mod/Part/App/TopoShapeMakeElementRefine.cpp b/tests/src/Mod/Part/App/TopoShapeMakeElementRefine.cpp index e823ace748..84afef491b 100644 --- a/tests/src/Mod/Part/App/TopoShapeMakeElementRefine.cpp +++ b/tests/src/Mod/Part/App/TopoShapeMakeElementRefine.cpp @@ -48,6 +48,6 @@ TEST_F(FeaturePartMakeElementRefineTest, makeElementRefineBoxes) EXPECT_EQ(refined.countSubElements("Face"), 6); // After refining it is one box EXPECT_EQ(refined.countSubElements("Edge"), 12); // 12 edges in a box // TODO: Make sure we have an elementMap for the refine. - // Refine doesn't work on compounds, so we're going to need a binary operation or the + // TODO: Refine doesn't work on compounds, so we're going to need a binary operation or the // like, and those don't exist yet. Once they do, this test can be expanded } From 5684928b57014e742137a49892c4878ed9bac063 Mon Sep 17 00:00:00 2001 From: bgbsww Date: Mon, 19 Feb 2024 22:05:42 -0500 Subject: [PATCH 3/6] Toposhape/Part: Clean GeneralFuse, Fuse, Cut; add tests; tweak other tests --- tests/src/Mod/Part/App/TopoShapeExpansion.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/src/Mod/Part/App/TopoShapeExpansion.cpp b/tests/src/Mod/Part/App/TopoShapeExpansion.cpp index b9fe3b3207..96db4617d7 100644 --- a/tests/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/tests/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -1569,6 +1569,7 @@ TEST_F(TopoShapeExpansionTest, makeElementCut) "CUT;:H1:7,V);CUT;:H1:3c,E|Face6;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E);CUT;:H1:cb,F")); } +<<<<<<< HEAD TEST_F(TopoShapeExpansionTest, makeElementTransformWithoutMap) { // Arrange @@ -1664,4 +1665,6 @@ TEST_F(TopoShapeExpansionTest, makeElementGTransformWithMap) // Not testing _makeElementTransform as it is a thin wrapper that calls the same places as the four // preceding tests. +======= +>>>>>>> f6b3402577 (Toposhape/Part: Clean GeneralFuse, Fuse, Cut; add tests; tweak other tests) // NOLINTEND(readability-magic-numbers,cppcoreguidelines-avoid-magic-numbers) From c6d443dfa51e1c4ae31bb0e13a10dd77a26c5801 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 20 Feb 2024 13:25:28 -0500 Subject: [PATCH 4/6] Toposhape/Part: Transfer in makESolid --- src/Mod/Part/App/TopoShape.h | 39 ++++++++++ src/Mod/Part/App/TopoShapeExpansion.cpp | 97 +++++++++++++++++++++++++ 2 files changed, 136 insertions(+) diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index 60e295f000..f5b27c0eb3 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -1653,6 +1653,45 @@ public: CN, }; + /** Make a solid using shells or CompSolid + * + * @param shapes: input shapes of either shells or CompSolid. + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * + * @return The function produces a solid. The original content of this + * TopoShape is discarded and replaced with the new shape. The + * function returns the TopoShape itself as a self reference so + * that multiple operations can be carried out for the same shape + * in the same line of code. + */ + TopoShape &makESolid(const std::vector &shapes, const char *op=nullptr); + /** Make a solid using shells or CompSolid + * + * @param shape: input shape of either a shell, a compound of shells, or a + * CompSolid. + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * + * @return The function produces a solid. The original content of this + * TopoShape is discarded and replaced with the new shape. The + * function returns the TopoShape itself as a self reference so + * that multiple operations can be carried out for the same shape + * in the same line of code. + */ + TopoShape &makESolid(const TopoShape &shape, const char *op=nullptr); + /** Make a solid using this shape + * + * @param op: optional string to be encoded into topo naming for indicating + * the operation + * + * @return The function returns a new solid using the shell or CompSolid + * inside this shape. The shape itself is not modified. + */ + TopoShape makESolid(const char *op=nullptr) const { + return TopoShape(0,Hasher).makESolid(*this,op); + } + /** Generic shape making with mapped element name from shape history * diff --git a/src/Mod/Part/App/TopoShapeExpansion.cpp b/src/Mod/Part/App/TopoShapeExpansion.cpp index 6fd47e438e..45f0c3fd8e 100644 --- a/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -2641,6 +2641,103 @@ struct MapperThruSections: MapperMaker } }; +TopoShape &TopoShape::makESolid(const std::vector &shapes, const char *op) { + return makESolid(TopoShape().makECompound(shapes),op); +} + +bool TopoShape::fixSolidOrientation() +{ + if (isNull()) + return false; + + if (shapeType() == TopAbs_SOLID) { + TopoDS_Solid solid = TopoDS::Solid(_Shape); + BRepLib::OrientClosedSolid(solid); + if (solid.IsEqual(_Shape)) + return false; + setShape(solid, false); + return true; + } + + if (shapeType() == TopAbs_COMPOUND + || shapeType() == TopAbs_COMPSOLID) + { + auto shapes = getSubTopoShapes(); + bool touched = false; + for (auto &s : shapes) { + if (s.fixSolidOrientation()) + touched = true; + } + if (!touched) + return false; + + BRep_Builder builder; + if (shapeType() == TopAbs_COMPOUND) { + TopoDS_Compound comp; + builder.MakeCompound(comp); + for(auto &s : shapes) { + if (!s.isNull()) + builder.Add(comp, s.getShape()); + } + setShape(comp, false); + } else { + TopoDS_CompSolid comp; + builder.MakeCompSolid(comp); + for(auto &s : shapes) { + if (!s.isNull()) + builder.Add(comp, s.getShape()); + } + setShape(comp, false); + } + return true; + } + + return false; +} + +TopoShape &TopoShape::makESolid(const TopoShape &shape, const char *op) { + if(!op) op = Part::OpCodes::Solid; + + if(shape.isNull()) + HANDLE_NULL_SHAPE; + + //first, if we were given a compsolid, try making a solid out of it + TopoDS_CompSolid compsolid; + int count=0; + for(const auto &s : shape.getSubShapes(TopAbs_COMPSOLID)) { + ++count; + compsolid = TopoDS::CompSolid(s); + if (count > 1) + break; + } + if (count == 0) { + //no compsolids. Get shells... + BRepBuilderAPI_MakeSolid mkSolid; + count=0; + for (const auto &s : shape.getSubShapes(TopAbs_SHELL)) { + ++count; + mkSolid.Add(TopoDS::Shell(s)); + } + + if (count == 0)//no shells? + FC_THROWM(Base::CADKernelError,"No shells or compsolids found in shape"); + + makEShape(mkSolid,shape,op); + + TopoDS_Solid solid = TopoDS::Solid(_Shape); + BRepLib::OrientClosedSolid(solid); + setShape(solid, false); + + } else if (count == 1) { + BRepBuilderAPI_MakeSolid mkSolid(compsolid); + makEShape(mkSolid,shape,op); + } else { // if (count > 1) + FC_THROWM(Base::CADKernelError,"Only one compsolid can be accepted. " + "Provided shape has more than one compsolid."); + } + return *this; +} + TopoShape& TopoShape::makeElementGeneralFuse(const std::vector& _shapes, std::vector>& modifies, double tol, From e7d44e75941756e1d91912c1ace079c2719b1c4b Mon Sep 17 00:00:00 2001 From: bgbsww Date: Tue, 20 Feb 2024 14:23:01 -0500 Subject: [PATCH 5/6] Clean and add tests for makeElementSolid --- src/Mod/Part/App/TopoShape.h | 9 +- src/Mod/Part/App/TopoShapeExpansion.cpp | 103 ++++++------------ tests/src/Mod/Part/App/TopoShapeExpansion.cpp | 30 ++++- 3 files changed, 65 insertions(+), 77 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index f5b27c0eb3..80cdf1ca5d 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -1665,7 +1665,8 @@ public: * that multiple operations can be carried out for the same shape * in the same line of code. */ - TopoShape &makESolid(const std::vector &shapes, const char *op=nullptr); + // TODO: This does not appear to be called, and the implementation seems impossible +// TopoShape &makeElementSolid(const std::vector &shapes, const char *op=nullptr); /** Make a solid using shells or CompSolid * * @param shape: input shape of either a shell, a compound of shells, or a @@ -1679,7 +1680,7 @@ public: * that multiple operations can be carried out for the same shape * in the same line of code. */ - TopoShape &makESolid(const TopoShape &shape, const char *op=nullptr); + TopoShape &makeElementSolid(const TopoShape &shape, const char *op=nullptr); /** Make a solid using this shape * * @param op: optional string to be encoded into topo naming for indicating @@ -1688,8 +1689,8 @@ public: * @return The function returns a new solid using the shell or CompSolid * inside this shape. The shape itself is not modified. */ - TopoShape makESolid(const char *op=nullptr) const { - return TopoShape(0,Hasher).makESolid(*this,op); + TopoShape makeElementSolid(const char *op=nullptr) const { + return TopoShape(0,Hasher).makeElementSolid(*this,op); } diff --git a/src/Mod/Part/App/TopoShapeExpansion.cpp b/src/Mod/Part/App/TopoShapeExpansion.cpp index 45f0c3fd8e..bffe1c96cd 100644 --- a/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -2641,99 +2642,61 @@ struct MapperThruSections: MapperMaker } }; -TopoShape &TopoShape::makESolid(const std::vector &shapes, const char *op) { - return makESolid(TopoShape().makECompound(shapes),op); -} +// TODO: This method does not appear to ever be called in the codebase, and it is probably +// broken, because using TopoShape() with no parameters means the result will not have an +// element Map. +//TopoShape& TopoShape::makeElementSolid(const std::vector& shapes, const char* op) +//{ +// return makeElementSolid(TopoShape().makeElementCompound(shapes), op); +//} -bool TopoShape::fixSolidOrientation() +TopoShape& TopoShape::makeElementSolid(const TopoShape& shape, const char* op) { - if (isNull()) - return false; - - if (shapeType() == TopAbs_SOLID) { - TopoDS_Solid solid = TopoDS::Solid(_Shape); - BRepLib::OrientClosedSolid(solid); - if (solid.IsEqual(_Shape)) - return false; - setShape(solid, false); - return true; + if (!op) { + op = Part::OpCodes::Solid; } - if (shapeType() == TopAbs_COMPOUND - || shapeType() == TopAbs_COMPSOLID) - { - auto shapes = getSubTopoShapes(); - bool touched = false; - for (auto &s : shapes) { - if (s.fixSolidOrientation()) - touched = true; - } - if (!touched) - return false; - - BRep_Builder builder; - if (shapeType() == TopAbs_COMPOUND) { - TopoDS_Compound comp; - builder.MakeCompound(comp); - for(auto &s : shapes) { - if (!s.isNull()) - builder.Add(comp, s.getShape()); - } - setShape(comp, false); - } else { - TopoDS_CompSolid comp; - builder.MakeCompSolid(comp); - for(auto &s : shapes) { - if (!s.isNull()) - builder.Add(comp, s.getShape()); - } - setShape(comp, false); - } - return true; + if (shape.isNull()) { + FC_THROWM(NullShapeException, "Null shape"); } - return false; -} - -TopoShape &TopoShape::makESolid(const TopoShape &shape, const char *op) { - if(!op) op = Part::OpCodes::Solid; - - if(shape.isNull()) - HANDLE_NULL_SHAPE; - - //first, if we were given a compsolid, try making a solid out of it + // first, if we were given a compsolid, try making a solid out of it TopoDS_CompSolid compsolid; - int count=0; - for(const auto &s : shape.getSubShapes(TopAbs_COMPSOLID)) { + int count = 0; + for (const auto& s : shape.getSubShapes(TopAbs_COMPSOLID)) { ++count; compsolid = TopoDS::CompSolid(s); - if (count > 1) + if (count > 1) { break; + } } if (count == 0) { - //no compsolids. Get shells... + // no compsolids. Get shells... BRepBuilderAPI_MakeSolid mkSolid; - count=0; - for (const auto &s : shape.getSubShapes(TopAbs_SHELL)) { + count = 0; + for (const auto& s : shape.getSubShapes(TopAbs_SHELL)) { ++count; mkSolid.Add(TopoDS::Shell(s)); } - if (count == 0)//no shells? - FC_THROWM(Base::CADKernelError,"No shells or compsolids found in shape"); + if (count == 0) { // no shells? + FC_THROWM(Base::CADKernelError, "No shells or compsolids found in shape"); + } - makEShape(mkSolid,shape,op); + makeElementShape(mkSolid, shape, op); TopoDS_Solid solid = TopoDS::Solid(_Shape); BRepLib::OrientClosedSolid(solid); setShape(solid, false); - - } else if (count == 1) { + } + else if (count == 1) { BRepBuilderAPI_MakeSolid mkSolid(compsolid); - makEShape(mkSolid,shape,op); - } else { // if (count > 1) - FC_THROWM(Base::CADKernelError,"Only one compsolid can be accepted. " - "Provided shape has more than one compsolid."); + makeElementShape(mkSolid, shape, op); + } + else { // if (count > 1) + FC_THROWM(Base::CADKernelError, + "Only one compsolid can be accepted. " + "Provided shape has more than one compsolid."); } return *this; } diff --git a/tests/src/Mod/Part/App/TopoShapeExpansion.cpp b/tests/src/Mod/Part/App/TopoShapeExpansion.cpp index 96db4617d7..346f6379a2 100644 --- a/tests/src/Mod/Part/App/TopoShapeExpansion.cpp +++ b/tests/src/Mod/Part/App/TopoShapeExpansion.cpp @@ -1569,7 +1569,6 @@ TEST_F(TopoShapeExpansionTest, makeElementCut) "CUT;:H1:7,V);CUT;:H1:3c,E|Face6;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E);CUT;:H1:cb,F")); } -<<<<<<< HEAD TEST_F(TopoShapeExpansionTest, makeElementTransformWithoutMap) { // Arrange @@ -1665,6 +1664,31 @@ TEST_F(TopoShapeExpansionTest, makeElementGTransformWithMap) // Not testing _makeElementTransform as it is a thin wrapper that calls the same places as the four // preceding tests. -======= ->>>>>>> f6b3402577 (Toposhape/Part: Clean GeneralFuse, Fuse, Cut; add tests; tweak other tests) +TEST_F(TopoShapeExpansionTest, makeElementSolid) +{ + // Arrange + auto [cube1, cube2] = CreateTwoCubes(); + auto tr {gp_Trsf()}; + tr.SetTranslation(gp_Vec(gp_XYZ(-0.5, -0.5, 0))); + cube2.Move(TopLoc_Location(tr)); + TopoShape topoShape1 {cube1, 1L}; + TopoShape topoShape2 {cube2, 2L}; + // Act + TopExp_Explorer exp(topoShape1.getShape(), TopAbs_SHELL); + auto shell1 = exp.Current(); + exp.Init(topoShape2.getShape(), TopAbs_SHELL); + auto shell2 = exp.Current(); + TopoShape& topoShape3 = topoShape1.makeElementCompound({shell1, shell2}); + TopoShape& result = topoShape1.makeElementSolid(topoShape3); // Need the single parm form + auto elements = elementMap(result); + Base::BoundBox3d bb = result.getBoundBox(); + // Assert shape is correct + EXPECT_TRUE(PartTestHelpers::boxesMatch(bb, Base::BoundBox3d(0.0, -0.5, 0.0, 1.5, 1.0, 1.0))); + EXPECT_FLOAT_EQ(getVolume(result.getShape()), 2); + // Assert elementMap is correct + EXPECT_EQ(elements.size(), 52); + EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1); + EXPECT_EQ(elements[IndexedName("Face", 1)], MappedName("Face1;SLD;:H1:4,F")); +} + // NOLINTEND(readability-magic-numbers,cppcoreguidelines-avoid-magic-numbers) From 551bcbc17d89565d64bd6b1b3386471a2dc0c70f Mon Sep 17 00:00:00 2001 From: bgbsww Date: Thu, 22 Feb 2024 20:09:35 -0500 Subject: [PATCH 6/6] Remove redundant from merge --- src/Mod/Part/App/TopoShape.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/Mod/Part/App/TopoShape.h b/src/Mod/Part/App/TopoShape.h index 44bce76049..d0a552127e 100644 --- a/src/Mod/Part/App/TopoShape.h +++ b/src/Mod/Part/App/TopoShape.h @@ -226,18 +226,6 @@ enum class Copy copy }; -enum class CheckScale -{ - noScaleCheck, - checkScale -}; - -enum class Copy -{ - noCopy, - copy -}; - /** The representation for a CAD Shape */ // NOLINTNEXTLINE cppcoreguidelines-special-member-functions