Toposhape/Part: Cleanup FeatureFillet, FeatureChamfer and dependencies

This commit is contained in:
bgbsww
2024-02-26 16:51:15 -05:00
parent 5da174f46e
commit 7c812105ee
10 changed files with 254 additions and 130 deletions

View File

@@ -71,7 +71,6 @@ TEST_F(FeatureChamferTest, testOther)
// Assert
EXPECT_EQ(sec, 24);
// Act
// _chamfer->Edges.setValues(PartTestHelpers::_getFilletEdges({1, 2}, chamfer, chamfer));
_chamfer->Edges.setValues(PartTestHelpers::_getFilletEdges({1, 2}, chamfer, chamfer));
double fusedVolume = PartTestHelpers::getVolume(_fused->Shape.getValue());
double chamferVolume = PartTestHelpers::getVolume(_chamfer->Shape.getValue());

View File

@@ -1422,12 +1422,16 @@ TEST_F(TopoShapeExpansionTest, makeElementBooleanCut)
// Assert elementMap is correct
EXPECT_EQ(elements.size(), 38);
EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1);
#ifndef FC_USE_TNP_FIX
EXPECT_EQ(
elements[IndexedName("Face", 1)],
MappedName(
"Face3;:M;CUT;:H1:7,F;:U;CUT;:H1:7,E;:L(Face5;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E|Face5;:M;"
"CUT;:H1:7,F;:U2;CUT;:H1:8,E;:U;CUT;:H1:7,V;:L(Face6;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E;:U;"
"CUT;:H1:7,V);CUT;:H1:3c,E|Face6;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E);CUT;:H1:cb,F"));
#else
EXPECT_EQ(elements[IndexedName("Face", 1)], MappedName("Face1;CUT;:H1:4,F"));
#endif
}
TEST_F(TopoShapeExpansionTest, makeElementBooleanFuse)
@@ -1448,12 +1452,16 @@ TEST_F(TopoShapeExpansionTest, makeElementBooleanFuse)
// Assert element map is correct
EXPECT_EQ(elements.size(), 66);
EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1);
#ifndef FC_USE_TNP_FIX
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"));
#else
EXPECT_EQ(elements[IndexedName("Face", 1)], MappedName("Face1;FUS;:H1:4,F"));
#endif
}
TEST_F(TopoShapeExpansionTest, makeElementDraft)
@@ -1707,12 +1715,16 @@ TEST_F(TopoShapeExpansionTest, makeElementGeneralFuse)
// Assert elementMap is correct
EXPECT_EQ(elements.size(), 72);
EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1);
#ifndef FC_USE_TNP_FIX
EXPECT_EQ(
elements[IndexedName("Face", 1)],
MappedName(
"Face3;:M;GFS;:H1:7,F;:U;GFS;:H1:7,E;:L(Face5;:M;GFS;:H1:7,F;:U2;GFS;:H1:8,E|Face5;:M;"
"GFS;:H1:7,F;:U2;GFS;:H1:8,E;:U;GFS;:H1:7,V;:L(Face6;:M;GFS;:H1:7,F;:U2;GFS;:H1:8,E;:U;"
"GFS;:H1:7,V);GFS;:H1:3c,E|Face6;:M;GFS;:H1:7,F;:U2;GFS;:H1:8,E);GFS;:H1:cb,F"));
#else
EXPECT_EQ(elements[IndexedName("Face", 1)], MappedName("Face1;GFS;:H1:4,F"));
#endif
}
TEST_F(TopoShapeExpansionTest, makeElementFuse)
@@ -1732,12 +1744,16 @@ TEST_F(TopoShapeExpansionTest, makeElementFuse)
// Assert elementMap is correct
EXPECT_EQ(elements.size(), 66);
EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1);
#ifndef FC_USE_TNP_FIX
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"));
#else
EXPECT_EQ(elements[IndexedName("Face", 1)], MappedName("Face1;FUS;:H1:4,F"));
#endif
}
TEST_F(TopoShapeExpansionTest, makeElementCut)
@@ -1758,12 +1774,16 @@ TEST_F(TopoShapeExpansionTest, makeElementCut)
// Assert elementMap is correct
EXPECT_EQ(elements.size(), 38);
EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1);
#ifndef FC_USE_TNP_FIX
EXPECT_EQ(
elements[IndexedName("Face", 1)],
MappedName(
"Face3;:M;CUT;:H1:7,F;:U;CUT;:H1:7,E;:L(Face5;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E|Face5;:M;"
"CUT;:H1:7,F;:U2;CUT;:H1:8,E;:U;CUT;:H1:7,V;:L(Face6;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E;:U;"
"CUT;:H1:7,V);CUT;:H1:3c,E|Face6;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E);CUT;:H1:cb,F"));
#else
EXPECT_EQ(elements[IndexedName("Face", 1)], MappedName("Face1;CUT;:H1:4,F"));
#endif
}
TEST_F(TopoShapeExpansionTest, makeElementChamfer)
@@ -2170,12 +2190,16 @@ TEST_F(TopoShapeExpansionTest, makeElementTransformWithMap)
// Assert elementMap is correct
EXPECT_EQ(elements.size(), 66);
EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1);
#ifndef FC_USE_TNP_FIX
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"));
#else
EXPECT_EQ(elements[IndexedName("Face", 1)], MappedName("Face1;FUS;:H1:4,F"));
#endif
}
TEST_F(TopoShapeExpansionTest, makeElementGTransformWithoutMap)
@@ -2216,12 +2240,16 @@ TEST_F(TopoShapeExpansionTest, makeElementGTransformWithMap)
// Assert elementMap is correct
EXPECT_EQ(elements.size(), 66);
EXPECT_EQ(elements.count(IndexedName("Face", 1)), 1);
#ifndef FC_USE_TNP_FIX
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"));
#else
EXPECT_EQ(elements[IndexedName("Face", 1)], MappedName("Face1;FUS;:H1:4,F"));
#endif
}
// Not testing _makeElementTransform as it is a thin wrapper that calls the same places as the four
@@ -2594,6 +2622,7 @@ TEST_F(TopoShapeExpansionTest, traceElement)
// Act
result.traceElement(mappedName, cb);
// Assert we have the element map we think we do.
#ifndef FC_USE_TNP_FIX
EXPECT_TRUE(allElementsMatch(
result,
{
@@ -2641,6 +2670,49 @@ TEST_F(TopoShapeExpansionTest, traceElement)
"Face6;:M;CUT;:H1:7,F;:U2;CUT;:H1:8,E;:U;CUT;:H1:7,V",
"Face6;:M;CUT;:H1:7,F;:U;CUT;:H1:7,E",
}));
#else
EXPECT_TRUE(allElementsMatch(result,
{
"Edge10;:G(Edge2;K-1;:H2:4,E);CUT;:H1:1a,V",
"Edge10;:M;CUT;:H1:7,E",
"Edge11;:M;CUT;:H2:7,E",
"Edge11;CUT;:H1:4,E",
"Edge12;:M;CUT;:H2:7,E",
"Edge12;CUT;:H1:4,E",
"Edge1;CUT;:H1:4,E",
"Edge2;:M;CUT;:H2:7,E",
"Edge2;CUT;:H1:4,E",
"Edge3;CUT;:H1:4,E",
"Edge3;CUT;:H2:4,E",
"Edge4;:M;CUT;:H2:7,E",
"Edge4;CUT;:H1:4,E",
"Edge6;:G(Edge12;K-1;:H2:4,E);CUT;:H1:1b,V",
"Edge6;:M;CUT;:H1:7,E",
"Edge7;CUT;:H1:4,E",
"Edge8;:G(Edge11;K-1;:H2:4,E);CUT;:H1:1b,V",
"Edge8;:M;CUT;:H1:7,E",
"Edge9;:G(Edge4;K-1;:H2:4,E);CUT;:H1:1a,V",
"Edge9;:M;CUT;:H1:7,E",
"Face1;:M;CUT;:H2:7,F",
"Face1;CUT;:H1:4,F",
"Face2;:G(Face4;K-1;:H2:4,F);CUT;:H1:1a,E",
"Face2;:M;CUT;:H1:7,F",
"Face3;:G(Face1;K-1;:H2:4,F);CUT;:H1:1a,E",
"Face3;:M;CUT;:H1:7,F",
"Face4;:M;CUT;:H2:7,F",
"Face4;CUT;:H1:4,F",
"Face5;:M;CUT;:H1:7,F",
"Face6;:M;CUT;:H1:7,F",
"Vertex1;CUT;:H1:4,V",
"Vertex2;CUT;:H1:4,V",
"Vertex3;CUT;:H1:4,V",
"Vertex3;CUT;:H2:4,V",
"Vertex4;CUT;:H1:4,V",
"Vertex4;CUT;:H2:4,V",
"Vertex7;CUT;:H1:4,V",
"Vertex8;CUT;:H1:4,V",
}));
#endif
}
TEST_F(TopoShapeExpansionTest, makeElementOffset)