model.testNbSubShapes(Filling_2, GeomAPI_Shape.FACE, [1])
model.testNbSubShapes(Filling_2, GeomAPI_Shape.EDGE, [4])
model.testNbSubShapes(Filling_2, GeomAPI_Shape.VERTEX, [8])
-model.testResultsAreas(Filling_2, [29.10364506])
+model.testResultsAreas(Filling_2, [29.09175882])
model.testNbResults(Filling_3, 1)
model.testNbSubResults(Filling_3, [0])
model.testNbSubShapes(Filling_3, GeomAPI_Shape.FACE, [1])
model.testNbSubShapes(Filling_3, GeomAPI_Shape.EDGE, [4])
model.testNbSubShapes(Filling_3, GeomAPI_Shape.VERTEX, [8])
-model.testResultsAreas(Filling_3, [30.744277238])
+model.testResultsAreas(Filling_3, [30.720017606])
assert(model.checkPythonDump())
ModelGeomAlgo
Locale
test_API
+ TestModels
)
# Close SALOME GUI
import salome_utils
import subprocess
+import platform
port = salome_utils.getPortNumber()
-proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)])
+if platform.system() == "Windows":
+ proc = subprocess.Popen(["python", "killSalomeWithPort.py", "{}".format(port)])
+else:
+ proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)])
SketchProjection_19 = Sketch_8.addProjection(model.selection("EDGE", "Split_2_1_17/Modified_Edge&PartSet/YOZ/YOZ&Sketch_1/SketchArc_2_2"), False)
SketchProjection_19.setName("SketchProjection_40")
SketchProjection_19.result().setName("SketchProjection_40")
-SketchBSpline_1 = SketchProjection_19.createdFeature()
+SketchProj19_1 = SketchProjection_19.createdFeature()
### Create SketchProjection
SketchProjection_20 = Sketch_8.addProjection(model.selection("EDGE", "Partition_1_1_4/Generated_Edge&PartSet/YOZ/YOZ&Sketch_1/SketchLine_19"), False)
SketchLine_78.setName("SketchLine_119")
SketchLine_78.result().setName("SketchLine_119")
Sketch_8.setCoincident(SketchLine_74.endPoint(), SketchLine_78.result())
-Sketch_8.setCoincident(SketchLine_74.startPoint(), SketchAPI_BSpline(SketchBSpline_1).startPoint())
+Sketch_8.setCoincident(SketchLine_74.startPoint(), SketchAPI_Arc(SketchProj19_1).startPoint())
### Create SketchLine
SketchLine_79 = Sketch_8.addLine(5.676067550792231, 10.23944020672391, 5.829536340268943, 10.44848598250872)
Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", (3.237566604725065, 1.012489110826635e-16, 11.61400119092393)), model.selection("SOLID", (3.223802337712571, 1.605864674679632e-16, 11.57493485456337))], model.selection("FACE", "PartSet/YOZ"), keepOriginal = True)
### Create Cut
-Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", (-0.02393444277354129, -2.619925842544883e-15, -2.580701826672511))], [model.selection("COMPOUND", (0, 0, 11.60508262087049))])
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", (0, 0, -2.581694))], [model.selection("COMPOUND", (0, 0, 11.60508262087049))])
### Create Fuse
-Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", (-0.02010673966564346, 1.098068506034238e-08, -2.591493279117804)), model.selection("COMPOUND", (0, 0, 11.54608275997197))], removeEdges = True)
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", (0, 0, -2.592352)), model.selection("COMPOUND", (0, 0, 11.54608275997197))], removeEdges = True)
### Create Plane
Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 3.6, False)
Rotation_2 = model.addRotation(Part_1_doc, [model.selection("SOLID", (5, 0, 1.2))], axis = model.selection("EDGE", "PartSet/OZ"), angle = -90)
### Create Fuse
-Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", (-0.01517504751343968, 2.050041270815023e-08, -2.581926283264154)), model.selection("COMPOUND", (6.661338147750939e-16, -6.164784975045299, 1.5))], removeEdges = True)
+Fuse_2 = model.addFuse(Part_1_doc, [model.selection("SOLID", (0, 0, -2.582588)), model.selection("COMPOUND", (6.661338147750939e-16, -6.164784975045299, 1.5))], removeEdges = True)
### Create Cut
-Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", (-0.01123484393534465, -0.0370107755507461, -2.561989939908471))], [model.selection("SOLID", (6.683953801956267e-16, -5, 1.2))])
+Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", (0, -0.030528, -2.562454))], [model.selection("SOLID", (6.683953801956267e-16, -5, 1.2))])
### Create Group
Group_1_objects = [model.selection("VERTEX", (-4.1398177019328, 0, 11.393656164374)),
Group_3 = model.addGroup(Part_1_doc, "FACE", Group_3_objects)
### Create Partition
-Partition_1_objects = [model.selection("SOLID", (-0.01000739040276288, -0.02886888807097911, -2.568297753475152)),
+Partition_1_objects = [model.selection("SOLID", (0, -0.0201706, -2.568703)),
model.selection("FACE", "PartSet/XOZ"),
model.selection("FACE", "PartSet/YOZ")]
Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects, keepSubResults = True)
SketchProjection_19 = Sketch_8.addProjection(model.selection("EDGE", (0, 5.790750667181333, 10.12202136327199)), False)
SketchProjection_19.setName("SketchProjection_40")
SketchProjection_19.result().setName("SketchProjection_40")
-SketchBSpline_1 = SketchProjection_19.createdFeature()
+SketchProj19_1 = SketchProjection_19.createdFeature()
### Create SketchProjection
SketchProjection_20 = Sketch_8.addProjection(model.selection("EDGE", (0, 6.534999999999997, 9.721499999999999)), False)
SketchLine_78.setName("SketchLine_119")
SketchLine_78.result().setName("SketchLine_119")
Sketch_8.setCoincident(SketchLine_74.endPoint(), SketchLine_78.result())
-Sketch_8.setCoincident(SketchLine_74.startPoint(), SketchAPI_BSpline(SketchBSpline_1).startPoint())
+Sketch_8.setCoincident(SketchLine_74.startPoint(), SketchAPI_Arc(SketchProj19_1).startPoint())
### Create SketchLine
SketchLine_79 = Sketch_8.addLine(5.676067550792231, 10.23944020672391, 5.829536340268943, 10.44848598250872)
model.do()
### Create Revolution
-Revolution_9 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", (0, 5.830822237526045, 10.15645361216909))], model.selection("EDGE", "PartSet/OZ"), 360, 0, "Edges")
+Revolution_9 = model.addRevolution(Part_1_doc, [model.selection("COMPOUND", (0, 5.830822237526045, 10.3860737))], model.selection("EDGE", "PartSet/OZ"), 360, 0, "Edges")
### Create Split
Split_4 = model.addSplit(Part_1_doc, [model.selection("COMPOUND", "all-in-Split_3")], [model.selection("COMPOUND", "all-in-Revolution_9")], keepSubResults = True)
Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("WIRE", (3.862008317343538, 0, 11.38077471561056))], model.selection("EDGE", (3.241000000000025, 0, 11.62374600149389)), 360, 0)
Revolution_3 = model.addRevolution(Part_1_doc, [model.selection("WIRE", (4.212769702413368, 0, 11.10430922268928))], model.selection("EDGE", (3.241000000000025, 0, 11.62374600149389)), 360, 0)
Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", (3.237566604725065, 0, 11.61400119092393)), model.selection("SOLID", (3.223802337712571, 0, 11.57493485456337))], model.selection("FACE", "PartSet/YOZ"), True)
-Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", (-0.02393444277354109, 0, -2.580701826672493))], [model.selection("COMPOUND", (0, 0, 11.60508262087049))])
-Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", (-0.0201067396659898, 0, -2.591493279115657)), model.selection("COMPOUND", (0, 0, 11.54608275997197))], removeEdges = True)
+Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", (0, 0, -2.5816942490967))], [model.selection("COMPOUND", (0, 0, 11.60508262087049))])
+Fuse_1 = model.addFuse(Part_1_doc, [model.selection("SOLID", (0, 0, -2.5923523532641)), model.selection("COMPOUND", (0, 0, 11.54608275997197))], removeEdges = True)
Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 3.6, False)
Sketch_3 = model.addSketch(Part_1_doc, model.selection("FACE", (0, 0, 3.6)))
SketchProjection_9 = Sketch_3.addProjection(model.selection("EDGE", (-6.188, 7.578114393123822e-16, -3.45)), True)
Extrusion_2 = model.addExtrusion(Part_1_doc, [model.selection("FACE", (0, 0, 1.2))], model.selection(), 10, 0)
Rotation_1_objects = [model.selection("SOLID", (5, 1.166200656118862e-18, 1.2)), model.selection("SOLID", (6.049686362669476, 0, 1.5)), model.selection("SOLID", (6.320976310013338, 0, 1.5))]
Rotation_1 = model.addRotation(Part_1_doc, Rotation_1_objects, model.selection("EDGE", "PartSet/OZ"), -90)
-Fuse_2_objects_1 = [model.selection("SOLID", (-0.01517504751345233, 0, -2.581926283264175)), model.selection("SOLID", (0, -6.049686362669479, 1.5)), model.selection("SOLID", (0, -6.320976310013339, 1.5))]
+Fuse_2_objects_1 = [model.selection("SOLID", (0, 0, -2.5825883331029)), model.selection("SOLID", (0, -6.049686362669479, 1.5)), model.selection("SOLID", (0, -6.320976310013339, 1.5))]
Fuse_2 = model.addFuse(Part_1_doc, Fuse_2_objects_1)
-Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", (-0.01017608298903453, -0.03890028204629473, -2.562040714294322))], [model.selection("SOLID", (0, -5, 1.2))])
-FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", (-0.008741742572144908, -0.03112823644757425, -2.568357186681257)))
+Cut_2 = model.addCut(Part_1_doc, [model.selection("SOLID", (0, -0.0305282901284, -2.5624546739218))], [model.selection("SOLID", (0, -5, 1.2))])
+FusionFaces_1 = model.addFusionFaces(Part_1_doc, model.selection("SOLID", (0, -0.020170634783153, -2.5687034308941)))
model.end()
model.testNbSubShapes(FusionFaces_1, GeomAPI_Shape.FACE, [47])
model.testNbSubShapes(FusionFaces_1, GeomAPI_Shape.EDGE, [202])
model.testNbSubShapes(FusionFaces_1, GeomAPI_Shape.VERTEX, [404])
-model.testResultsVolumes(FusionFaces_1, [612.7268292882])
+model.testResultsVolumes(FusionFaces_1, [612.727466])
assert(model.checkPythonDump())
ExtrusionCut_2.setNestedSketch(Sketch_2)
model.do()
Shape = ExtrusionCut_2.results()[0].resultSubShapePair()[0].shape()
-checkMiddlePoint(Shape, 4.999955838, 4.99999192, 4.677925562)
+checkMiddlePoint(Shape, 4.999955680, 4.99999176, 4.677925400)
model.end()
ExtrusionFuse_2.setNestedSketch(Sketch_2)
model.do()
Shape = ExtrusionFuse_2.results()[0].resultSubShapePair()[0].shape()
-checkMiddlePoint(Shape, 4.97994427, 4.995857948, 4.254078314)
+checkMiddlePoint(Shape, 4.97994444, 4.995858131, 4.254077951)
model.end()
model.testNbSubResults(Extrusion_1, [2])
model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [2])
model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [13])
-model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [61])
-model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [122])
-model.testResultsVolumes(Extrusion_1, [41289.10946])
+model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [59])
+model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [118])
+model.testResultsVolumes(Extrusion_1, [41289.17344])
# change radius of sketch circle and check failure
ParamRCir.setValue(10)
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.EDGE, [53])
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.VERTEX, [106])
model.testResultsVolumes(Fillet_5, [976.519471836586])
-refPoint = GeomAPI_Pnt(54.98720346, 4.918055722, 4.987203302)
-midPoint = Fillet_5.defaultResult().shape().middlePoint()
-assert(midPoint.distance(refPoint) < TOLERANCE)
+model.checkMiddlePoint(Fillet_5.defaultResult().shape(), 54.98720346, 4.918055722, 4.987203302)
Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_2_1/Top][Box_2_1/Front]"), model.selection("FACE", "Box_2_1/Right")], RADIUS_1, RADIUS_2)
model.testNbResults(Fillet_6, 1)
model.testNbSubShapes(Fillet_6, GeomAPI_Shape.EDGE, [95])
model.testNbSubShapes(Fillet_6, GeomAPI_Shape.VERTEX, [190])
model.testResultsVolumes(Fillet_6, [1565.568094166])
-refPoint = GeomAPI_Pnt(2.7448, 2.7448, 5)
-midPoint = Fillet_6.defaultResult().shape().middlePoint()
-assert(midPoint.distance(refPoint) < TOLERANCE)
+model.checkMiddlePoint(Fillet_6.defaultResult().shape(), 2.58156073, 2.58159465, 4.83676073)
Fillet_7 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[AngularCopy_1_1_1/MF:Rotated&Box_3_1/Back][AngularCopy_1_1_1/MF:Rotated&Box_3_1/Top]"), model.selection("FACE", "AngularCopy_1_1_2/MF:Rotated&Box_3_1/Left")], RADIUS_1, RADIUS_2)
model.testNbResults(Fillet_7, 2)
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.EDGE, [50])
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.VERTEX, [100])
model.testResultsVolumes(Fillet_5, [976.068565925934])
-refPoint = GeomAPI_Pnt(55.0654360945, 5.015632459, 4.985518188)
-midPoint = Fillet_5.defaultResult().shape().middlePoint()
-assert(midPoint.distance(refPoint) < TOLERANCE)
+model.checkMiddlePoint(Fillet_5.defaultResult().shape(), 55.0654360945, 5.015632459, 4.985518188)
Recover_1 = model.addRecover(Part_1_doc, Fillet_5, [Compound_1.result()], True)
Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Recover_1_1_7_2/Modified_Face&Box_2_1/Top][Recover_1_1_7_2/Modified_Face&Box_2_1/Front]"), model.selection("FACE", "Recover_1_1_7_2/Modified_Face&Box_2_1/Right")], RADIUS_1, RADIUS_2)
model.testNbSubShapes(Fillet_6, GeomAPI_Shape.EDGE, [95])
model.testNbSubShapes(Fillet_6, GeomAPI_Shape.VERTEX, [190])
model.testResultsVolumes(Fillet_6, [1565.568094166])
-refPoint = GeomAPI_Pnt(2.7448, 2.7448, 5)
-midPoint = Fillet_6.defaultResult().shape().middlePoint()
-assert(midPoint.distance(refPoint) < TOLERANCE)
+model.checkMiddlePoint(Fillet_6.defaultResult().shape(), 2.58156073, 2.58159465, 4.83676073)
Recover_2 = model.addRecover(Part_1_doc, Fillet_6, [Compound_1.result()], True)
Fillet_7 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Recover_2_1_8_1/Modified_Face&Box_3_1/Back][Recover_2_1_8_1/Modified_Face&Box_3_1/Top]"), model.selection("FACE", "Recover_2_1_8_2/Modified_Face&Box_3_1/Left")], RADIUS_1, RADIUS_2)
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.EDGE, [53])
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.VERTEX, [106])
model.testResultsVolumes(Fillet_5, [976.519471836586])
-refPoint = GeomAPI_Pnt(54.98720346, 4.918055722, 4.987203302)
-midPoint = Fillet_5.defaultResult().shape().middlePoint()
-assert(midPoint.distance(refPoint) < TOLERANCE)
+model.checkMiddlePoint(Fillet_5.defaultResult().shape(), 54.98720346, 4.918055722, 4.987203302)
Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Partition_1_1_2/Modified_Face&Box_2_1/Top][Box_2_1/Front]"), model.selection("FACE", "Box_2_1/Right")], RADIUS_1, RADIUS_2, keepSubResults = True)
model.testNbResults(Fillet_6, 1)
model.testNbSubShapes(Fillet_6, GeomAPI_Shape.EDGE, [95])
model.testNbSubShapes(Fillet_6, GeomAPI_Shape.VERTEX, [190])
model.testResultsVolumes(Fillet_6, [1565.568094166])
-refPoint = GeomAPI_Pnt(2.7448, 2.7448, 5)
-midPoint = Fillet_6.defaultResult().shape().middlePoint()
-assert(midPoint.distance(refPoint) < TOLERANCE)
+model.checkMiddlePoint(Fillet_6.defaultResult().shape(), 2.58156073, 2.58159465, 4.83676073)
Fillet_7 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[AngularCopy_1_1_1/MF:Rotated&Box_3_1/Back][AngularCopy_1_1_1/MF:Rotated&Box_3_1/Top]"), model.selection("FACE", "AngularCopy_1_1_2/MF:Rotated&Box_3_1/Left")], RADIUS_1, RADIUS_2, keepSubResults = True)
model.testNbResults(Fillet_7, 1)
model.testNbSubShapes(Fillet_7, GeomAPI_Shape.EDGE, [98])
model.testNbSubShapes(Fillet_7, GeomAPI_Shape.VERTEX, [196])
model.testResultsVolumes(Fillet_7, [2976.0685684791988])
-refPoint = GeomAPI_Pnt(-20.9807621135, 42.806, 5)
-midPoint = Fillet_7.defaultResult().shape().middlePoint()
-assert(midPoint.distance(refPoint) < TOLERANCE)
+model.checkMiddlePoint(Fillet_7.defaultResult().shape(), -20.9807621135, 42.806, 5)
+
model.end()
model.begin()
assertResult(Fillet_5)
Fillet_6 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Compound_1_1_7_2/Modified_Face&Box_2_1/Top][Compound_1_1_7_2/Modified_Face&Box_2_1/Front]"), model.selection("FACE", "Compound_1_1_7_2/Modified_Face&Box_2_1/Right")], RADIUS_1, RADIUS_2, keepSubResults = True)
-REFERENCE[6] = GeomAPI_Pnt(2.7448, 2.7448, 5)
+REFERENCE[6] = GeomAPI_Pnt(2.58156073, 2.58159465, 4.83676073)
NB_FACES += 6
NB_EDGES += 29
NB_VERTICES += 58
RevolutionFuse_1.setNestedSketch(Sketch_1)
model.do()
Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape()
-checkMiddlePoint(Shape, 5.000000277, 2.2088446592, 2.5458802675)
+checkMiddlePoint(Shape, 5, 2.2080639645, 2.5532186547)
RevolutionFuse_1.setPlanesAndOffsets(model.selection(), 0, model.selection("FACE", "Box_1_1/Bottom"), 0)
model.do()
model.do()
Shape = RevolutionFuse_1.results()[0].resultSubShapePair()[0].shape()
-checkMiddlePoint(Shape, 6.3892968486, 5.0, 6.3892968486)
+checkMiddlePoint(Shape, 6.3943254561, 5.0, 6.3943306351)
model.end()
#include "GeomAPI_Shape.h"
+#include <Basics_OCCTVersion.hxx>
+
#include <GeomAPI_Pnt.h>
#include <GeomAPI_Vertex.h>
#include <GeomAPI_Edge.h>
#include <sstream>
#include <algorithm> // for std::transform
-#include <BRepTools.hxx>
-
#define MY_SHAPE implPtr<TopoDS_Shape>()
GeomAPI_Shape::GeomAPI_Shape()
const TopoDS_Shape& aShape2 = theShape2->impl<TopoDS_Shape>();
bool isLess = aShape1.TShape() < aShape2.TShape();
if (aShape1.TShape() == aShape2.TShape()) {
+#if OCC_VERSION_LARGE < 0x07080000
Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast());
Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast());
+#else
+ Standard_Integer aHash1 = aShape1.Location().HashCode();
+ Standard_Integer aHash2 = aShape2.Location().HashCode();
+#endif
isLess = aHash1 < aHash2;
}
return isLess;
const TopoDS_Shape& aShape2 = theShape2->impl<TopoDS_Shape>();
bool isLess = aShape1.TShape() < aShape2.TShape();
if (aShape1.TShape() == aShape2.TShape()) {
+#if OCC_VERSION_LARGE < 0x07080000
Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast());
Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast());
+#else
+ Standard_Integer aHash1 = aShape1.Location().HashCode();
+ Standard_Integer aHash2 = aShape2.Location().HashCode();
+#endif
isLess = (aHash1 < aHash2) ||
(aHash1 == aHash2 && aShape1.Orientation() < aShape2.Orientation());
}
int GeomAPI_Shape::Hash::operator()(const std::shared_ptr<GeomAPI_Shape>& theShape) const
{
const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
+#if OCC_VERSION_LARGE < 0x07080000
return aShape.HashCode(IntegerLast());
+#else
+ return std::hash<TopoDS_Shape>{}(aShape);
+#endif
}
bool GeomAPI_Shape::Equal::operator()(const std::shared_ptr<GeomAPI_Shape>& theShape1,
const TopoDS_Shape& aShape1 = theShape1->impl<TopoDS_Shape>();
const TopoDS_Shape& aShape2 = theShape2->impl<TopoDS_Shape>();
+#if OCC_VERSION_LARGE < 0x07080000
Standard_Integer aHash1 = aShape1.Location().HashCode(IntegerLast());
Standard_Integer aHash2 = aShape2.Location().HashCode(IntegerLast());
+#else
+ Standard_Integer aHash1 = aShape1.Location().HashCode();
+ Standard_Integer aHash2 = aShape2.Location().HashCode();
+#endif
return aShape1.TShape() == aShape2.TShape() && aHash1 == aHash2;
}
#include <XCAFDoc_ShapeTool.hxx>
#include <XCAFDoc_ColorTool.hxx>
#include <STEPCAFControl_Writer.hxx>
+#include <StepData_StepModel.hxx>
+#include <UnitsMethods.hxx>
#include <Interface_Static.hxx>
#include <Quantity_Color.hxx>
Interface_Static::SetCVal("xstep.cascade.unit", "M");
Interface_Static::SetIVal("write.step.nonmanifold", 0); // 1 don't allow to export assemly tree
Interface_Static::SetCVal("write.step.unit", "M");
-#else
+#elif OCC_VERSION_LARGE < 0x07080000
STEPCAFControl_Writer aWriterTmp;
Interface_Static::SetCVal("xstep.cascade.unit", "M");
Interface_Static::SetIVal("write.step.nonmanifold", 0); // 1 don't allow to export assemly tree
Interface_Static::SetCVal("write.step.unit", "M");
STEPCAFControl_Writer aWriter;
+#else
+ STEPCAFControl_Writer aWriter;
+ Interface_Static::SetCVal("xstep.cascade.unit", "M");
+ Interface_Static::SetIVal("write.step.nonmanifold", 0); // 1 don't allow to export assemly tree
+ Interface_Static::SetCVal("write.step.unit", "M");
+ Handle(StepData_StepModel) aModel = aWriter.ChangeWriter().Model();
+ aModel->InternalParameters.InitFromStatic();
+ Standard_Integer aWriteUnitInt = Interface_Static::IVal("write.step.unit");
+ Standard_Real aWriteUnitReal = UnitsMethods::GetLengthFactorValue(aWriteUnitInt);
+ aModel->SetWriteLengthUnit(aWriteUnitReal);
#endif
auto aStatus = aWriter.Transfer(aDoc, STEPControl_AsIs);
//
return 0;
}
-//=======================================================================
-//function : BuildTriangulation
-//purpose :
-//=======================================================================
-Standard_Boolean
- GEOMAlgo_AlgoTools::BuildTriangulation (const TopoDS_Shape& theShape)
-{
- // calculate deflection
- Standard_Real aDeviationCoefficient = 0.001;
-
- Bnd_Box B;
- BRepBndLib::Add(theShape, B);
- Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
- B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-
- Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin;
- Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4;
- Standard_Real aHLRAngle = 0.349066;
-
- // build triangulation
- BRepMesh_IncrementalMesh Inc (theShape, aDeflection, Standard_False, aHLRAngle);
-
- // check triangulation
- bool isTriangulation = true;
-
- TopExp_Explorer exp (theShape, TopAbs_FACE);
- if (exp.More())
- {
- TopLoc_Location aTopLoc;
- Handle(Poly_Triangulation) aTRF;
- aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
- if (aTRF.IsNull()) {
- isTriangulation = false;
- }
- }
- else // no faces, try edges
- {
- TopExp_Explorer expe (theShape, TopAbs_EDGE);
- if (!expe.More()) {
- isTriangulation = false;
- }
- else {
- TopLoc_Location aLoc;
- Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc);
- if (aPE.IsNull()) {
- isTriangulation = false;
- }
- }
- }
- return isTriangulation;
-}
//=======================================================================
//function : IsCompositeShape
static Standard_Boolean IsCompositeShape(const TopoDS_Shape& aS);
- GEOMALGOIMPL_EXPORT
- static Standard_Boolean BuildTriangulation(const TopoDS_Shape& aS);
-
GEOMALGOIMPL_EXPORT
static Standard_Integer RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMSD,
const Standard_Real aTol,
#include <TopoDS_Shape.hxx>
#include <Standard_Integer.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
+#if OCC_VERSION_LARGE < 0x07080000
+
#include <TColStd_MapIntegerHasher.hxx>
#define _NCollection_MapHasher
#undef _NCollection_MapHasher
+#else
+
+#include <NCollection_IndexedDataMap.hxx>
+
+typedef NCollection_IndexedDataMap<Standard_Integer, TopoDS_Shape> GEOMAlgo_IndexedDataMapOfIntegerShape;
+
+#endif // OCC_VERSION_LARGE < 0x07080000
#endif
//
#include <GEOMAlgo_PassKeyShape.hxx>
+#include <Basics_OCCTVersion.hxx>
+
#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
Clear();
myNbIds=1;
myMap.Add(aS1);
+#if OCC_VERSION_LARGE < 0x07080000
aHC=aS1.HashCode(myUpper);
+#else
+ aHC = std::hash<TopoDS_Shape>{}(aS1);
+#endif
mySum=NormalizedId(aHC, myNbIds);
}
//=======================================================================
myNbIds=myMap.Extent();
for(i=1; i<=myNbIds; ++i) {
const TopoDS_Shape& aS=myMap(i);
+#if OCC_VERSION_LARGE < 0x07080000
aId=aS.HashCode(myUpper);
+#else
+ aId = std::hash<TopoDS_Shape>{}(aS);
+#endif
aIdN=NormalizedId(aId, myNbIds);
mySum+=aIdN;
}
}
return !bRet;
}
+#if OCC_VERSION_LARGE < 0x07080000
//=======================================================================
//function : HashCode
//purpose :
{
return ::HashCode(mySum, aUpper);
}
+#endif
//=======================================================================
//function : Dump
//purpose :
#include <GeomAlgoImpl.h>
+#include <Basics_OCCTVersion.hxx>
+
#include <Standard.hxx>
#include <Standard_Macro.hxx>
#include <Standard_Integer.hxx>
GEOMALGOIMPL_EXPORT
Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aOther) const;
+#if OCC_VERSION_LARGE < 0x07080000
GEOMALGOIMPL_EXPORT
Standard_Integer HashCode(const Standard_Integer Upper) const;
+#endif
+
+ GEOMALGOIMPL_EXPORT
+ bool operator==(const GEOMAlgo_PassKeyShape& theOther) const
+ {
+ return IsEqual(theOther);
+ }
+
+ GEOMALGOIMPL_EXPORT
+ size_t GetSum() const { return (size_t)mySum; }
GEOMALGOIMPL_EXPORT
void Dump(const Standard_Integer aHex = 0) const;
//
#include <GEOMAlgo_PassKeyShapeMapHasher.hxx>
+#if OCC_VERSION_LARGE < 0x07080000
+
//=======================================================================
//function : HashCode
//purpose :
{
return aPK1.IsEqual(aPK2);
}
+
+#else
+
+size_t GEOMAlgo_PassKeyShapeMapHasher::operator()(const GEOMAlgo_PassKeyShape& aPKey) const
+{
+ return aPKey.GetSum();
+}
+
+bool GEOMAlgo_PassKeyShapeMapHasher::operator()(const GEOMAlgo_PassKeyShape& aPKey1,
+ const GEOMAlgo_PassKeyShape& aPKey2) const
+{
+ return aPKey1.IsEqual(aPKey2);
+}
+
+#endif // OCC_VERSION_LARGE < 0x07080000
#include <Standard_Boolean.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
+#include <Basics_OCCTVersion.hxx>
+
//=======================================================================
//class : GEOMAlgo_PassKeyShapeMapHasher
//purpose :
class GEOMAlgo_PassKeyShapeMapHasher
{
public:
+#if OCC_VERSION_LARGE < 0x07080000
GEOMALGOIMPL_EXPORT
static Standard_Integer HashCode(const GEOMAlgo_PassKeyShape& aPKey,
const Standard_Integer Upper) ;
GEOMALGOIMPL_EXPORT
static Standard_Boolean IsEqual(const GEOMAlgo_PassKeyShape& aPKey1,
const GEOMAlgo_PassKeyShape& aPKey2) ;
+#else
+ GEOMALGOIMPL_EXPORT
+ size_t operator()(const GEOMAlgo_PassKeyShape& aPKey) const;
+
+ GEOMALGOIMPL_EXPORT
+ bool operator()(const GEOMAlgo_PassKeyShape& aPKey1,
+ const GEOMAlgo_PassKeyShape& aPKey2) const;
+#endif // OCC_VERSION_LARGE < 0x07080000
};
#endif
#include <Model_BodyBuilder.h>
+#include <Basics_OCCTVersion.hxx>
+
#include <Locale_Convert.h>
#include <Model_Data.h>
continue;
Standard_Integer anID = 0;
for(TopTools_ListIteratorOfListOfShape aFaceIt(ancestors); aFaceIt.More(); aFaceIt.Next()) {
+#if OCC_VERSION_LARGE < 0x07080000
anID ^= HashCode(aFaceIt.ChangeValue(), 1990657); // Pierpont prime
+#else
+ anID ^= ((std::hash<TopoDS_Shape>{}(aFaceIt.ChangeValue()) & IntegerLast()) % 1990657 + 1); // Pierpont prime
+#endif
}
if (aFacesIDs.IsBound(anID)) { // there found same edge, check they really have same faces
const NCollection_List<TopoDS_Shape>& aSameFaces1 =
/// references and Boolean and Integer Arrays for the current moment.
static bool isEqualContent(Handle(TDF_Attribute) theAttr1, Handle(TDF_Attribute) theAttr2)
{
- if (Standard_GUID::IsEqual(theAttr1->ID(), TDF_Reference::GetID())) { // reference
+ Standard_GUID aGUID1 = theAttr1->ID();
+ if (aGUID1 == TDF_Reference::GetID()) { // reference
Handle(TDF_Reference) aRef1 = Handle(TDF_Reference)::DownCast(theAttr1);
Handle(TDF_Reference) aRef2 = Handle(TDF_Reference)::DownCast(theAttr2);
if (aRef1.IsNull() && aRef2.IsNull())
if (aRef1.IsNull() || aRef2.IsNull())
return false;
return aRef1->Get().IsEqual(aRef2->Get()) == Standard_True;
- } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_BooleanArray::GetID())) {
+ } else if (aGUID1 == TDataStd_BooleanArray::GetID()) {
Handle(TDataStd_BooleanArray) anArr1 = Handle(TDataStd_BooleanArray)::DownCast(theAttr1);
Handle(TDataStd_BooleanArray) anArr2 = Handle(TDataStd_BooleanArray)::DownCast(theAttr2);
if (anArr1.IsNull() && anArr2.IsNull())
}
return true;
}
- } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_IntegerArray::GetID())) {
+ } else if (aGUID1 == TDataStd_IntegerArray::GetID()) {
Handle(TDataStd_IntegerArray) anArr1 = Handle(TDataStd_IntegerArray)::DownCast(theAttr1);
Handle(TDataStd_IntegerArray) anArr2 = Handle(TDataStd_IntegerArray)::DownCast(theAttr2);
if (anArr1.IsNull() && anArr2.IsNull())
}
return true;
}
- } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_ReferenceArray::GetID())) {
+ } else if (aGUID1 == TDataStd_ReferenceArray::GetID()) {
Handle(TDataStd_ReferenceArray) anArr1 = Handle(TDataStd_ReferenceArray)::DownCast(theAttr1);
Handle(TDataStd_ReferenceArray) anArr2 = Handle(TDataStd_ReferenceArray)::DownCast(theAttr2);
if (anArr1.IsNull() && anArr2.IsNull())
}
return true;
}
- } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_ReferenceList::GetID())) {
+ } else if (aGUID1 == TDataStd_ReferenceList::GetID()) {
Handle(TDataStd_ReferenceList) aList1 = Handle(TDataStd_ReferenceList)::DownCast(theAttr1);
Handle(TDataStd_ReferenceList) aList2= Handle(TDataStd_ReferenceList)::DownCast(theAttr2);
if (aList1.IsNull() && aList2.IsNull())
return false;
}
return !aLIter1.More() && !aLIter2.More(); // both lists are with the same size
- } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDF_TagSource::GetID())) {
+ } else if (aGUID1 == TDF_TagSource::GetID()) {
return true; // it just for created and removed feature: nothing is changed
}
return false;
continue; // attribute is not changed actually
}
} else
- if (Standard_GUID::IsEqual(anADelta->Attribute()->ID(), TDataStd_AsciiString::GetID())) {
+ if (anADelta->Attribute()->ID() == TDataStd_AsciiString::GetID()) {
continue; // error message is disappeared
}
}
//
#include <Model_Objects.h>
+
+#include <Basics_OCCTVersion.hxx>
+
#include <Model_Data.h>
#include <Model_Document.h>
#include <Model_Events.h>
#include <TDataStd_HLabelArray1.hxx>
#include <TDF_Reference.hxx>
#include <TDF_ChildIDIterator.hxx>
-#include <TDF_LabelMapHasher.hxx>
#include <TDF_LabelMap.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
+#if OCC_VERSION_LARGE < 0x07080000
+
+#include <TDF_LabelMapHasher.hxx>
// for TDF_Label map usage
static Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper);
static Standard_Boolean IsEqual(const TDF_Label& theLab1, const TDF_Label& theLab2);
+#endif
+
int kUNDEFINED_FEATURE_INDEX = -1;
static const std::string& groupNameFoldering(const std::string& theGroupID,
int aRefIndex = aRefs->Lower();
for(; aRefIndex <= aRefs->Upper(); ++aRefIndex) { // iterate all existing features
TDF_Label aCurLabel = aRefs->Value(aRefIndex);
- if (IsEqual(aCurLabel, aFirstFeatureLabel))
+ if (aCurLabel.IsEqual(aFirstFeatureLabel))
break; // no need to continue searching
// searching the folder below, just continue to search last feature from the list
// because the folder may end by the feature which is
// neither a sub-feature nor a feature in history.
if (!aLastFeatureInFolder.IsNull()) {
- if (IsEqual(aCurLabel, aLastFeatureInFolder))
+ if (aCurLabel.IsEqual(aLastFeatureInFolder))
aLastFeatureInFolder.Nullify(); // the last feature in the folder is achieved
continue;
}
return FeaturePtr(); // invalid
}
+#if OCC_VERSION_LARGE < 0x07080000
Standard_Integer HashCode(const TDF_Label& theLab, const Standard_Integer theUpper)
{
return TDF_LabelMapHasher::HashCode(theLab, theUpper);
{
return TDF_LabelMapHasher::IsEqual(theLab1, theLab2);
}
+#endif
model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.FACE, [44])
model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.EDGE, [192])
model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.VERTEX, [384])
-model.testResultsVolumes(Symmetry_2, [0.714262940088946862715602037])
+model.testResultsVolumes(Symmetry_2, [0.71426763])
from ModelAPI import *
aFactory = ModelAPI_Session.get().validators()
assert error == '', "The feature {0} is in error: {1}".format(name, error)
# raise an error if the the feature is not valid (without error message)
assert aFactory.validate(feature), "The feature {0} is in error.".format(name)
+
+def checkMiddlePoint(theShape, theX, theY, theZ, theTolerance = 1.e-7):
+ """ Check coordinates of middle point of the given shape.
+ :param theShape the shape to check
+ :param theX, theY, theZ the expected coordinates
+ :param theTolerance comparison tolerance
+ """
+ assert(theShape is not None)
+ midPoint = theShape.middlePoint()
+ isEqual = math.fabs(midPoint.x() - theX) < theTolerance and math.fabs(midPoint.y() - theY) < theTolerance and math.fabs(midPoint.z() - theZ) < theTolerance
+ assert(isEqual), "Middle point: actual ({}, {}, {}) != expected ({}, {}, {})".format(midPoint.x(), midPoint.y(), midPoint.z(), theX, theY, theZ)
ENABLE_TESTING()
-file(GLOB pyFiles "*.py")
+file(GLOB pyFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
SET(RESTRICTED_ROOT_DIR $ENV{RESTRICTED_ROOT_DIR} CACHE PATH "Path to the restricted repository")
endforeach(eachFilePath ${ARGN})
ADD_CUSTOM_TARGET(run_models_tests COMMAND ${CMAKE_CTEST_COMMAND} -C "${CMAKE_BUILD_TYPE}" -L "models_tests")
+
+include(tests.set)
+
+if(${HAVE_SALOME})
+ enable_testing()
+ set(TEST_INSTALL_DIRECTORY "${SALOME_SHAPER_INSTALL_TESTS}/TestModels")
+
+ install(FILES CTestTestfileInstall.cmake
+ DESTINATION ${TEST_INSTALL_DIRECTORY}
+ RENAME CTestTestfile.cmake)
+ install(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY})
+
+ set(TMP_TESTS_NAMES)
+ foreach(tfile ${TEST_NAMES})
+ list(APPEND TMP_TESTS_NAMES ${CMAKE_CURRENT_SOURCE_DIR}/${tfile})
+ endforeach(tfile ${TEST_NAMES})
+
+ install(FILES ${TMP_TESTS_NAMES} DESTINATION ${TEST_INSTALL_DIRECTORY})
+endif(${HAVE_SALOME})
--- /dev/null
+# Copyright (C) 2021-2024 CEA, EDF
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+include(tests.set)
+
+foreach(tfile ${TEST_NAMES})
+ set(TEST_NAME ${COMPONENT_NAME}_Models_${tfile})
+ add_test(${TEST_NAME} python ${tfile})
+ set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+endforeach()
# Test reexecution after parameter change
Parameter_BPS.setValue(3)
model.do()
-model.testResultsVolumes(ExtrusionCut_3, [154096.039414040715200826525688171])
+model.testResultsVolumes(ExtrusionCut_3, [154095.923043997521745041012763977])
Parameter_BPS.setValue(6)
model.end()
model.testNbSubShapes(ExtrusionCut_3, GeomAPI_Shape.FACE, [70])
model.testNbSubShapes(ExtrusionCut_3, GeomAPI_Shape.EDGE, [326])
model.testNbSubShapes(ExtrusionCut_3, GeomAPI_Shape.VERTEX, [652])
-model.testResultsVolumes(ExtrusionCut_3, [156878.517351274640532210469245911])
+model.testResultsVolumes(ExtrusionCut_3, [156878.400948128226445987820625305])
assert(model.checkPythonDump())
# Test reexecution after parameter change
Parameter_H.setValue(14)
model.do()
-model.testResultsVolumes(ExtrusionCut_2, [10205.25717])
+model.testResultsVolumes(ExtrusionCut_2, [10205.255530970627660281024873257])
Parameter_H.setValue(12)
model.end()
model.testNbSubResults(ExtrusionCut_2, [0])
model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.SOLID, [1])
model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.FACE, [551])
-model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.EDGE, [3481])
-model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.VERTEX, [6962])
-model.testResultsVolumes(ExtrusionCut_2, [10362.3368])
+model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.EDGE, [3473])
+model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.VERTEX, [6946])
+model.testResultsVolumes(ExtrusionCut_2, [10362.335163650115646305494010448])
assert(model.checkPythonDump())
# Test reexecution after parameter change
Parameter_R.setValue(5)
model.do()
-model.testResultsVolumes(ExtrusionCut_4, [502616.749082866765093058347702026])
+model.testResultsVolumes(ExtrusionCut_4, [502617.059752906498033553361892700])
Parameter_R.setValue(3)
model.end()
model.testNbSubShapes(ExtrusionCut_4, GeomAPI_Shape.FACE, [81])
model.testNbSubShapes(ExtrusionCut_4, GeomAPI_Shape.EDGE, [406])
model.testNbSubShapes(ExtrusionCut_4, GeomAPI_Shape.VERTEX, [812])
-model.testResultsVolumes(ExtrusionCut_4, [502903.236060981987975537776947021])
+model.testResultsVolumes(ExtrusionCut_4, [502903.528831139323301613330841064])
assert(model.checkPythonDump())
model.testNbSubShapes(Revolution_1, GeomAPI_Shape.FACE, [35])
model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [114])
model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [228])
-model.testResultsVolumes(Revolution_1, [29055.346994571114919381216168404])
+model.testResultsVolumes(Revolution_1, [29055.379817395245481748133897781])
Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "PartSet/OY"), model.selection("VERTEX", "Sketch_1/SketchPoint_2"), True)
model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.FACE, [36])
model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.EDGE, [132])
model.testNbSubShapes(ExtrusionCut_1, GeomAPI_Shape.VERTEX, [264])
-model.testResultsVolumes(ExtrusionCut_1, [28943.115000463178148493170738220])
+model.testResultsVolumes(ExtrusionCut_1, [28943.145978945081878919154405594])
Fillet_1 = model.addFillet(Part_1_doc, [model.selection("EDGE", "[Revolution_1_1/Generated_Face&Sketch_1/SketchLine_21][Revolution_1_1/Generated_Face&Sketch_1/SketchLine_20]")], "Fillet1")
# check Fillet_1
model.testNbSubShapes(Fillet_1, GeomAPI_Shape.FACE, [37])
model.testNbSubShapes(Fillet_1, GeomAPI_Shape.EDGE, [136])
model.testNbSubShapes(Fillet_1, GeomAPI_Shape.VERTEX, [272])
-model.testResultsVolumes(Fillet_1, [28340.280766451105591841042041779])
+model.testResultsVolumes(Fillet_1, [28340.312197727056627627462148666])
Fillet_2 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_31"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_29"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_27"), model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_25")], "Fillet2")
# check Fillet_2
model.testNbSubShapes(Fillet_2, GeomAPI_Shape.FACE, [45])
model.testNbSubShapes(Fillet_2, GeomAPI_Shape.EDGE, [168])
model.testNbSubShapes(Fillet_2, GeomAPI_Shape.VERTEX, [336])
-model.testResultsVolumes(Fillet_2, [28339.715350479829794494435191154])
+model.testResultsVolumes(Fillet_2, [28339.746210508856165688484907150])
Fillet_3 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_19")], "Fillet3")
# check Fillet_3
model.testNbSubShapes(Fillet_3, GeomAPI_Shape.FACE, [47])
model.testNbSubShapes(Fillet_3, GeomAPI_Shape.EDGE, [176])
model.testNbSubShapes(Fillet_3, GeomAPI_Shape.VERTEX, [352])
-model.testResultsVolumes(Fillet_3, [28338.609830057110229972749948502])
+model.testResultsVolumes(Fillet_3, [28338.641671687521011335775256157])
Fillet_4 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_11")], "Fillet3")
# check Fillet_4
model.testNbSubShapes(Fillet_4, GeomAPI_Shape.FACE, [49])
model.testNbSubShapes(Fillet_4, GeomAPI_Shape.EDGE, [184])
model.testNbSubShapes(Fillet_4, GeomAPI_Shape.VERTEX, [368])
-model.testResultsVolumes(Fillet_4, [28347.280717884430487174540758133])
+model.testResultsVolumes(Fillet_4, [28347.312910383880080189555883408])
Fillet_5 = model.addFillet(Part_1_doc, [model.selection("FACE", "Revolution_1_1/Generated_Face&Sketch_1/SketchLine_9")], "Fillet2")
# check Fillet_5
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.FACE, [51])
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.EDGE, [192])
model.testNbSubShapes(Fillet_5, GeomAPI_Shape.VERTEX, [384])
-model.testResultsVolumes(Fillet_5, [28343.655816829603281803429126740])
+model.testResultsVolumes(Fillet_5, [28343.688540020142681896686553955])
ExtrusionCut_2 = model.addExtrusionCut(Part_1_doc, [], model.selection(), "D4_out/2", "D4_out/2", [model.selection("SOLID", "Fillet_5_1")])
Sketch_3 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.FACE, [55])
model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.EDGE, [214])
model.testNbSubShapes(ExtrusionCut_2, GeomAPI_Shape.VERTEX, [428])
-model.testResultsVolumes(ExtrusionCut_2, [28317.789547563083033310249447823])
+model.testResultsVolumes(ExtrusionCut_2, [28317.815904764789593173190951347])
Folder_1 = model.addFolder(Part_1_doc, Fillet_1, Fillet_5)
model.testNbSubResults(RevolutionCut_1, [0])
model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.SOLID, [1])
model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.FACE, [59])
-model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.EDGE, [242])
-model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.VERTEX, [484])
-model.testResultsVolumes(RevolutionCut_1, [28297.246041844206047244369983673])
+model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.EDGE, [240])
+model.testNbSubShapes(RevolutionCut_1, GeomAPI_Shape.VERTEX, [480])
+model.testResultsVolumes(RevolutionCut_1, [28297.263961183885840000584721565])
RevolutionCut_2 = model.addRevolutionCut(Part_1_doc, [], model.selection("EDGE", "PartSet/OX"), 360, 0, [model.selection("SOLID", "RevolutionCut_1_1")])
Sketch_5 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
model.testNbSubResults(RevolutionCut_2, [0])
model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.SOLID, [1])
model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.FACE, [60])
-model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.EDGE, [246])
-model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.VERTEX, [492])
-model.testResultsVolumes(RevolutionCut_2, [28288.868184623894194373860955238])
+model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.EDGE, [244])
+model.testNbSubShapes(RevolutionCut_2, GeomAPI_Shape.VERTEX, [488])
+model.testResultsVolumes(RevolutionCut_2, [28288.886350037606462137773633003])
Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/XOY"), 0, False)
Partition_1 = model.addPartition(Part_1_doc, [model.selection("SOLID", "RevolutionCut_2_1"), model.selection("FACE", "Plane_2")])
model.testNbSubResults(Partition_1, [2])
model.testNbSubShapes(Partition_1, GeomAPI_Shape.SOLID, [2])
model.testNbSubShapes(Partition_1, GeomAPI_Shape.FACE, [127])
-model.testNbSubShapes(Partition_1, GeomAPI_Shape.EDGE, [738])
-model.testNbSubShapes(Partition_1, GeomAPI_Shape.VERTEX, [1476])
+model.testNbSubShapes(Partition_1, GeomAPI_Shape.EDGE, [736])
+model.testNbSubShapes(Partition_1, GeomAPI_Shape.VERTEX, [1472])
model.testResultsVolumes(Partition_1, [28288.886256640704232268035411835])
Result = model.addRemoveSubShapes(Part_1_doc, model.selection("COMPSOLID", "Partition_1_1"))
model.testNbSubResults(Result, [0])
model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1])
model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63])
-model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
-model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
+model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
+model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
model.testResultsVolumes(Result, [22968.704503291784931207075715065])
Param_Drill1Loc.setValue(15)
model.testNbSubResults(Result, [0])
model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1])
model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63])
-model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
-model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
+model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
+model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
model.testResultsVolumes(Result, [22969.259323538735770853236317635])
Param_Drill1Holder.setValue(16)
model.testNbSubResults(Result, [0])
model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1])
model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63])
-model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
-model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
+model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
+model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
model.testResultsVolumes(Result, [22969.553506208951148437336087227])
Param_Drill2Loc.setValue(7.5)
model.testNbSubResults(Result, [0])
model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1])
model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63])
-model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
-model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
+model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
+model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
model.testResultsVolumes(Result, [22969.986144881491782143712043762])
Param_Drill2Radius.setValue(1.9)
model.testNbSubResults(Result, [0])
model.testNbSubShapes(Result, GeomAPI_Shape.SOLID, [1])
model.testNbSubShapes(Result, GeomAPI_Shape.FACE, [63])
-model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [364])
-model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [728])
+model.testNbSubShapes(Result, GeomAPI_Shape.EDGE, [366])
+model.testNbSubShapes(Result, GeomAPI_Shape.VERTEX, [732])
model.testResultsVolumes(Result, [22956.808010807682876475155353546])
Param_Fillet1.setValue(3)
--- /dev/null
+# Copyright (C) 2021-2024 CEA, EDF
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(TEST_NAMES
+ angle30.py
+ bearing_puller.py
+ bobine_film_reel.py
+ bracket32.py
+ bushing.py
+ case24.py
+ clothespin.py
+ coronavirus.py
+ CSWA.py
+ ecran.py
+ flange.py
+ gear.py
+ idler_plate.py
+ piece_02.py
+ piece_09.py
+ piece_12.py
+ plug.py
+ sprocket.py
+ stair_with_cycle.py
+ visor_support.py
+ wheel_rim.py
+)
model.testNbSubShapes(Fillet_1, GeomAPI_Shape.FACE, [5])
model.testNbSubShapes(Fillet_1, GeomAPI_Shape.EDGE, [18])
model.testNbSubShapes(Fillet_1, GeomAPI_Shape.VERTEX, [36])
-model.testResultsVolumes(Fillet_1, [13.34526088678])
+model.testResultsVolumes(Fillet_1, [13.345256419562657512756231881])
Symmetry_1 = model.addSymmetry(Part_1_doc, [model.selection("SOLID", "Fillet_1_1")], model.selection("FACE", "PartSet/YOZ"), keepOriginal = True, keepSubResults = True)
Cut_1 = model.addCut(Part_1_doc, [model.selection("SOLID", "Chamfer_1_1")], [model.selection("COMPOUND", "Symmetry_1_1")], keepSubResults = True)
model.testNbSubShapes(Boolean_1, GeomAPI_Shape.FACE, [35])
model.testNbSubShapes(Boolean_1, GeomAPI_Shape.EDGE, [162])
model.testNbSubShapes(Boolean_1, GeomAPI_Shape.VERTEX, [324])
-model.testResultsVolumes(Boolean_1, [2052731.260104598477482795715332031])
+model.testResultsVolumes(Boolean_1, [2052720.339581762673333287239074707])
assert(model.checkPythonDump())