Toposhape/Part: clean, add tests for makeElementFillet and makeElementChamfer
This commit is contained in:
@@ -197,9 +197,21 @@ enum class MapElement
|
||||
/// Defines how to fill the holes that may appear after offset two adjacent faces
|
||||
enum class JoinType
|
||||
{
|
||||
Arc,
|
||||
Tangent,
|
||||
Intersection,
|
||||
arc,
|
||||
tangent,
|
||||
intersection,
|
||||
};
|
||||
|
||||
enum class Flip
|
||||
{
|
||||
none,
|
||||
flip
|
||||
};
|
||||
|
||||
enum class AsAngle
|
||||
{
|
||||
no,
|
||||
yes
|
||||
};
|
||||
|
||||
/** The representation for a CAD Shape
|
||||
@@ -808,7 +820,7 @@ public:
|
||||
*/
|
||||
TopoShape &makeElementThickSolid(const TopoShape &source, const std::vector<TopoShape> &faces,
|
||||
double offset, double tol, bool intersection = false, bool selfInter = false,
|
||||
short offsetMode = 0, JoinType join = JoinType::Arc, const char *op=nullptr);
|
||||
short offsetMode = 0, JoinType join = JoinType::arc, const char *op=nullptr);
|
||||
|
||||
/** Make a hollowed solid by removing some faces from a given solid
|
||||
*
|
||||
@@ -830,7 +842,7 @@ public:
|
||||
*/
|
||||
TopoShape makeElementThickSolid(const std::vector<TopoShape> &faces,
|
||||
double offset, double tol, bool intersection = false, bool selfInter = false,
|
||||
short offsetMode = 0, JoinType join = JoinType::Arc, const char *op=nullptr) const {
|
||||
short offsetMode = 0, JoinType join = JoinType::arc, const char *op=nullptr) const {
|
||||
return TopoShape(0,Hasher).makeElementThickSolid(*this,faces,offset,tol,intersection,selfInter,
|
||||
offsetMode,join,op);
|
||||
}
|
||||
@@ -1332,8 +1344,11 @@ public:
|
||||
* a self reference so that multiple operations can be carried out
|
||||
* for the same shape in the same line of code.
|
||||
*/
|
||||
TopoShape &makEFillet(const TopoShape &source, const std::vector<TopoShape> &edges,
|
||||
double radius1, double radius2, const char *op=nullptr);
|
||||
TopoShape& makeElementFillet(const TopoShape& source,
|
||||
const std::vector<TopoShape>& edges,
|
||||
double radius1,
|
||||
double radius2,
|
||||
const char* op = nullptr);
|
||||
/* Make fillet shape
|
||||
*
|
||||
* @param source: the source shape
|
||||
@@ -1345,9 +1360,12 @@ public:
|
||||
*
|
||||
* @return Return the new shape. The TopoShape itself is not modified.
|
||||
*/
|
||||
TopoShape makEFillet(const std::vector<TopoShape> &edges,
|
||||
double radius1, double radius2, const char *op=nullptr) const {
|
||||
return TopoShape(0,Hasher).makEFillet(*this,edges,radius1,radius2,op);
|
||||
TopoShape makeElementFillet(const std::vector<TopoShape>& edges,
|
||||
double radius1,
|
||||
double radius2,
|
||||
const char* op = nullptr) const
|
||||
{
|
||||
return TopoShape(0, Hasher).makeElementFillet(*this, edges, radius1, radius2, op);
|
||||
}
|
||||
|
||||
/* Make chamfer shape
|
||||
@@ -1364,8 +1382,13 @@ public:
|
||||
* a self reference so that multiple operations can be carried out
|
||||
* for the same shape in the same line of code.
|
||||
*/
|
||||
TopoShape &makEChamfer(const TopoShape &source, const std::vector<TopoShape> &edges,
|
||||
double radius1, double radius2, const char *op=nullptr, bool flipDirection=false, bool asAngle=false);
|
||||
TopoShape& makeElementChamfer(const TopoShape& source,
|
||||
const std::vector<TopoShape>& edges,
|
||||
double radius1,
|
||||
double radius2,
|
||||
const char* op = nullptr,
|
||||
Flip flipDirection = Flip::none,
|
||||
AsAngle asAngle = AsAngle::no);
|
||||
/* Make chamfer shape
|
||||
*
|
||||
* @param source: the source shape
|
||||
@@ -1377,9 +1400,15 @@ public:
|
||||
*
|
||||
* @return Return the new shape. The TopoShape itself is not modified.
|
||||
*/
|
||||
TopoShape makEChamfer(const std::vector<TopoShape> &edges,
|
||||
double radius1, double radius2, const char *op=nullptr, bool flipDirection=false, bool asAngle=false) const {
|
||||
return TopoShape(0,Hasher).makEChamfer(*this,edges,radius1,radius2,op,flipDirection,asAngle);
|
||||
TopoShape makeElementChamfer(const std::vector<TopoShape>& edges,
|
||||
double radius1,
|
||||
double radius2,
|
||||
const char* op = nullptr,
|
||||
Flip flipDirection = Flip::none,
|
||||
AsAngle asAngle = AsAngle::no) const
|
||||
{
|
||||
return TopoShape(0, Hasher)
|
||||
.makeElementChamfer(*this, edges, radius1, radius2, op, flipDirection, asAngle);
|
||||
}
|
||||
|
||||
/* Make draft shape
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
#include <BRepAlgoAPI_Section.hxx>
|
||||
#include <BRepBuilderAPI_Copy.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepFilletAPI_MakeChamfer.hxx>
|
||||
#include <BRepFilletAPI_MakeFillet.hxx>
|
||||
#include <BRepLib.hxx>
|
||||
#include <BRepOffsetAPI_DraftAngle.hxx>
|
||||
#include <BRepOffsetAPI_MakePipe.hxx>
|
||||
@@ -2143,11 +2145,11 @@ TopoShape& TopoShape::makeElementThickSolid(const TopoShape& shape,
|
||||
|
||||
// we do not offer tangent join type
|
||||
switch (join) {
|
||||
case JoinType::Arc:
|
||||
case JoinType::Intersection:
|
||||
case JoinType::arc:
|
||||
case JoinType::intersection:
|
||||
break;
|
||||
default:
|
||||
join = JoinType::Intersection;
|
||||
join = JoinType::intersection;
|
||||
}
|
||||
|
||||
if (shape.isNull()) {
|
||||
@@ -2594,57 +2596,78 @@ struct MapperThruSections: MapperMaker
|
||||
}
|
||||
};
|
||||
|
||||
TopoShape &TopoShape::makEFillet(const TopoShape &shape, const std::vector<TopoShape> &edges,
|
||||
double radius1, double radius2, const char *op)
|
||||
TopoShape& TopoShape::makeElementFillet(const TopoShape& shape,
|
||||
const std::vector<TopoShape>& edges,
|
||||
double radius1,
|
||||
double radius2,
|
||||
const char* op)
|
||||
{
|
||||
if(!op) op = Part::OpCodes::Fillet;
|
||||
if(shape.isNull())
|
||||
HANDLE_NULL_SHAPE;
|
||||
|
||||
if(edges.empty())
|
||||
HANDLE_NULL_INPUT;
|
||||
if (!op) {
|
||||
op = Part::OpCodes::Fillet;
|
||||
}
|
||||
if (shape.isNull()) {
|
||||
FC_THROWM(NullShapeException, "Null shape");
|
||||
}
|
||||
|
||||
if (edges.empty()) {
|
||||
FC_THROWM(NullShapeException, "Null input shape");
|
||||
}
|
||||
BRepFilletAPI_MakeFillet mkFillet(shape.getShape());
|
||||
for(auto &e : edges) {
|
||||
if(e.isNull())
|
||||
HANDLE_NULL_INPUT;
|
||||
const auto &edge = e.getShape();
|
||||
if(!shape.findShape(edge))
|
||||
FC_THROWM(Base::CADKernelError,"edge does not belong to the shape");
|
||||
for (auto& e : edges) {
|
||||
if (e.isNull()) {
|
||||
FC_THROWM(NullShapeException, "Null input shape");
|
||||
}
|
||||
const auto& edge = e.getShape();
|
||||
if (!shape.findShape(edge)) {
|
||||
FC_THROWM(Base::CADKernelError, "edge does not belong to the shape");
|
||||
}
|
||||
mkFillet.Add(radius1, radius2, TopoDS::Edge(edge));
|
||||
}
|
||||
return makEShape(mkFillet,shape,op);
|
||||
return makeElementShape(mkFillet, shape, op);
|
||||
}
|
||||
|
||||
TopoShape &TopoShape::makEChamfer(const TopoShape &shape, const std::vector<TopoShape> &edges,
|
||||
double radius1, double radius2, const char *op, bool flipDirection, bool asAngle)
|
||||
TopoShape& TopoShape::makeElementChamfer(const TopoShape& shape,
|
||||
const std::vector<TopoShape>& edges,
|
||||
double radius1,
|
||||
double radius2,
|
||||
const char* op,
|
||||
Flip flipDirection,
|
||||
AsAngle asAngle)
|
||||
{
|
||||
if(!op) op = Part::OpCodes::Chamfer;
|
||||
if(shape.isNull())
|
||||
HANDLE_NULL_SHAPE;
|
||||
|
||||
if(edges.empty())
|
||||
HANDLE_NULL_INPUT;
|
||||
|
||||
BRepFilletAPI_MakeChamfer mkChamfer(shape.getShape());
|
||||
for(auto &e : edges) {
|
||||
const auto &edge = e.getShape();
|
||||
if(e.isNull())
|
||||
HANDLE_NULL_INPUT;
|
||||
if(!shape.findShape(edge))
|
||||
FC_THROWM(Base::CADKernelError,"edge does not belong to the shape");
|
||||
//Add edge to fillet algorithm
|
||||
TopoDS_Shape face;
|
||||
if(flipDirection)
|
||||
face = shape.findAncestorsShapes(edge,TopAbs_FACE).back();
|
||||
else
|
||||
face = shape.findAncestorShape(edge,TopAbs_FACE);
|
||||
if(asAngle)
|
||||
mkChamfer.AddDA(radius1, radius2, TopoDS::Edge(edge), TopoDS::Face(face));
|
||||
else
|
||||
mkChamfer.Add(radius1, radius2, TopoDS::Edge(edge), TopoDS::Face(face));
|
||||
if (!op) {
|
||||
op = Part::OpCodes::Chamfer;
|
||||
}
|
||||
return makEShape(mkChamfer,shape,op);
|
||||
if (shape.isNull()) {
|
||||
FC_THROWM(NullShapeException, "Null shape");
|
||||
}
|
||||
if (edges.empty()) {
|
||||
FC_THROWM(NullShapeException, "Null input shape");
|
||||
}
|
||||
BRepFilletAPI_MakeChamfer mkChamfer(shape.getShape());
|
||||
for (auto& e : edges) {
|
||||
const auto& edge = e.getShape();
|
||||
if (e.isNull()) {
|
||||
FC_THROWM(NullShapeException, "Null input shape");
|
||||
}
|
||||
if (!shape.findShape(edge)) {
|
||||
FC_THROWM(Base::CADKernelError, "edge does not belong to the shape");
|
||||
}
|
||||
// Add edge to fillet algorithm
|
||||
TopoDS_Shape face;
|
||||
if (flipDirection == Flip::flip) {
|
||||
face = shape.findAncestorsShapes(edge, TopAbs_FACE).back();
|
||||
}
|
||||
else {
|
||||
face = shape.findAncestorShape(edge, TopAbs_FACE);
|
||||
}
|
||||
if (asAngle == AsAngle::yes) {
|
||||
mkChamfer.AddDA(radius1, radius2, TopoDS::Edge(edge), TopoDS::Face(face));
|
||||
}
|
||||
else {
|
||||
mkChamfer.Add(radius1, radius2, TopoDS::Edge(edge), TopoDS::Face(face));
|
||||
}
|
||||
}
|
||||
return makeElementShape(mkChamfer, shape, op);
|
||||
}
|
||||
|
||||
TopoShape& TopoShape::makeElementGeneralFuse(const std::vector<TopoShape>& _shapes,
|
||||
|
||||
@@ -1575,6 +1575,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
|
||||
@@ -1601,4 +1602,247 @@ 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, makeElementChamfer)
|
||||
{
|
||||
// Arrange
|
||||
// Fillets / Chamfers do not work on compounds of faces, so use complete boxes ( Solids ) here.
|
||||
auto [cube1, cube2] = CreateTwoCubes();
|
||||
TopoShape cube1TS {cube1, 1L};
|
||||
auto edges = cube1TS.getSubTopoShapes(TopAbs_EDGE);
|
||||
// Act
|
||||
cube1TS.makeElementChamfer({cube1TS}, edges, .05, .05);
|
||||
auto elements = elementMap(cube1TS);
|
||||
// Assert
|
||||
EXPECT_EQ(cube1TS.countSubElements("Wire"), 26);
|
||||
EXPECT_FLOAT_EQ(getArea(cube1TS.getShape()), 5.640996);
|
||||
// Assert that we're creating a correct element map
|
||||
EXPECT_TRUE(cube1TS.getMappedChildElements().empty());
|
||||
EXPECT_TRUE(allElementsMatch(cube1TS,
|
||||
{
|
||||
"Edge10;:G;CHF;:H1:7,F",
|
||||
"Edge10;:G;CHF;:H1:7,F;:U2;CHF;:H1:8,E",
|
||||
"Edge10;:G;CHF;:H1:7,F;:U3;CHF;:H1:8,E",
|
||||
"Edge10;:G;CHF;:H1:7,F;:U4;CHF;:H1:8,E",
|
||||
"Edge10;:G;CHF;:H1:7,F;:U;CHF;:H1:7,E",
|
||||
"Edge11;:G;CHF;:H1:7,F",
|
||||
"Edge11;:G;CHF;:H1:7,F;:U2;CHF;:H1:8,E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
||||
"Edge8;:G;CHF;:H1:7,F;:U2;CHF;:H1:8,E;:U2;CHF;:H1:8,V",
|
||||
"Edge8;:G;CHF;:H1:7,F;:U2;CHF;:H1:8,E;:U;CHF;:H1:7,V",
|
||||
"Edge8;:G;CHF;:H1:7,F;:U3;CHF;:H1:8,E",
|
||||
"Edge8;:G;CHF;:H1:7,F;:U4;CHF;:H1:8,E",
|
||||
"Edge8;:G;CHF;:H1:7,F;:U;CHF;:H1:7,E",
|
||||
"Edge9;:G;CHF;:H1:7,F",
|
||||
"Edge9;:G;CHF;:H1:7,F;:U2;CHF;:H1:8,E",
|
||||
"Edge9;:G;CHF;:H1:7,F;:U3;CHF;:H1:8,E",
|
||||
"Edge9;:G;CHF;:H1:7,F;:U4;CHF;:H1:8,E",
|
||||
"Edge9;:G;CHF;:H1:7,F;:U;CHF;:H1:7,E",
|
||||
"Face1;:M;CHF;:H1:7,F",
|
||||
"Face2;:M;CHF;:H1:7,F",
|
||||
"Face3;:M;CHF;:H1:7,F",
|
||||
"Face4;:M;CHF;:H1:7,F",
|
||||
"Face5;:M;CHF;:H1:7,F",
|
||||
"Face6;:M;CHF;:H1:7,F",
|
||||
"Vertex1;:G;CHF;:H1:7,F",
|
||||
"Vertex2;:G;CHF;:H1:7,F",
|
||||
"Vertex3;:G;CHF;:H1:7,F",
|
||||
"Vertex4;:G;CHF;:H1:7,F",
|
||||
"Vertex5;:G;CHF;:H1:7,F",
|
||||
"Vertex6;:G;CHF;:H1:7,F",
|
||||
"Vertex7;:G;CHF;:H1:7,F",
|
||||
"Vertex8;:G;CHF;:H1:7,F",
|
||||
}));
|
||||
}
|
||||
|
||||
TEST_F(TopoShapeExpansionTest, makeElementFillet)
|
||||
{
|
||||
// Arrange
|
||||
auto [cube1, cube2] = CreateTwoCubes();
|
||||
TopoShape cube1TS {cube1, 1L};
|
||||
auto edges = cube1TS.getSubTopoShapes(TopAbs_EDGE);
|
||||
// Act
|
||||
cube1TS.makeElementFillet({cube1TS}, edges, .05, .05);
|
||||
auto elements = elementMap(cube1TS);
|
||||
// Assert
|
||||
EXPECT_EQ(cube1TS.countSubElements("Wire"), 26);
|
||||
EXPECT_FLOAT_EQ(getArea(cube1TS.getShape()), 5.739646);
|
||||
// Assert that we're creating a correct element map
|
||||
EXPECT_TRUE(cube1TS.getMappedChildElements().empty());
|
||||
EXPECT_TRUE(elementsMatch(cube1TS,
|
||||
{
|
||||
"Edge10;:G;FLT;:H1:7,F",
|
||||
"Edge10;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Edge10;:G;FLT;:H1:7,F;:U3;FLT;:H1:8,E",
|
||||
"Edge10;:G;FLT;:H1:7,F;:U4;FLT;:H1:8,E",
|
||||
"Edge10;:G;FLT;:H1:7,F;:U;FLT;:H1:7,E",
|
||||
"Edge11;:G;FLT;:H1:7,F",
|
||||
"Edge11;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Edge11;:G;FLT;:H1:7,F;:U3;FLT;:H1:8,E",
|
||||
"Edge11;:G;FLT;:H1:7,F;:U4;FLT;:H1:8,E",
|
||||
"Edge11;:G;FLT;:H1:7,F;:U;FLT;:H1:7,E",
|
||||
"Edge12;:G;FLT;:H1:7,F",
|
||||
"Edge12;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Edge12;:G;FLT;:H1:7,F;:U3;FLT;:H1:8,E",
|
||||
"Edge12;:G;FLT;:H1:7,F;:U4;FLT;:H1:8,E",
|
||||
"Edge12;:G;FLT;:H1:7,F;:U;FLT;:H1:7,E",
|
||||
"Edge1;:G;FLT;:H1:7,F",
|
||||
"Edge1;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Edge1;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E;:U2;FLT;:H1:8,V",
|
||||
"Edge1;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E;:U;FLT;:H1:7,V",
|
||||
"Edge1;:G;FLT;:H1:7,F;:U3;FLT;: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G;FLT;:H1:7,F;:U;FLT;:H1:7,E",
|
||||
"Edge7;:G;FLT;:H1:7,F",
|
||||
"Edge7;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Edge7;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E;:U2;FLT;:H1:8,V",
|
||||
"Edge7;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E;:U;FLT;:H1:7,V",
|
||||
"Edge7;:G;FLT;:H1:7,F;:U3;FLT;:H1:8,E",
|
||||
"Edge7;:G;FLT;:H1:7,F;:U3;FLT;:H1:8,E;:U;FLT;:H1:7,V",
|
||||
"Edge7;:G;FLT;:H1:7,F;:U4;FLT;:H1:8,E",
|
||||
"Edge7;:G;FLT;:H1:7,F;:U;FLT;:H1:7,E",
|
||||
"Edge8;:G;FLT;:H1:7,F",
|
||||
"Edge8;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Edge8;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E;:U2;FLT;:H1:8,V",
|
||||
"Edge8;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E;:U;FLT;:H1:7,V",
|
||||
"Edge8;:G;FLT;:H1:7,F;:U3;FLT;:H1:8,E",
|
||||
"Edge8;:G;FLT;:H1:7,F;:U4;FLT;:H1:8,E",
|
||||
"Edge8;:G;FLT;:H1:7,F;:U;FLT;:H1:7,E",
|
||||
"Edge9;:G;FLT;:H1:7,F",
|
||||
"Edge9;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Edge9;:G;FLT;:H1:7,F;:U3;FLT;:H1:8,E",
|
||||
"Edge9;:G;FLT;:H1:7,F;:U4;FLT;:H1:8,E",
|
||||
"Edge9;:G;FLT;:H1:7,F;:U;FLT;:H1:7,E",
|
||||
"Face1;:M;FLT;:H1:7,F",
|
||||
"Face2;:M;FLT;:H1:7,F",
|
||||
"Face3;:M;FLT;:H1:7,F",
|
||||
"Face4;:M;FLT;:H1:7,F",
|
||||
"Face5;:M;FLT;:H1:7,F",
|
||||
"Face6;:M;FLT;:H1:7,F",
|
||||
"Vertex1;:G;FLT;:H1:7,F",
|
||||
"Vertex1;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Vertex2;:G;FLT;:H1:7,F",
|
||||
"Vertex2;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Vertex3;:G;FLT;:H1:7,F",
|
||||
"Vertex3;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Vertex4;:G;FLT;:H1:7,F",
|
||||
"Vertex4;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Vertex5;:G;FLT;:H1:7,F",
|
||||
"Vertex5;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Vertex6;:G;FLT;:H1:7,F",
|
||||
"Vertex6;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Vertex7;:G;FLT;:H1:7,F",
|
||||
"Vertex7;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
"Vertex8;:G;FLT;:H1:7,F",
|
||||
"Vertex8;:G;FLT;:H1:7,F;:U2;FLT;:H1:8,E",
|
||||
}));
|
||||
}
|
||||
|
||||
// NOLINTEND(readability-magic-numbers,cppcoreguidelines-avoid-magic-numbers)
|
||||
|
||||
Reference in New Issue
Block a user