From d04ea67117f609da08de8ae7631e8f2f844ea437 Mon Sep 17 00:00:00 2001 From: Artem Zhidkov Date: Tue, 9 Feb 2021 17:47:18 +0300 Subject: [PATCH] Improve GeomAlgoAPI_ShapeTools::volume() method to return the volume of the shape only, and forbid to return an area. For the calculation of area GeomAlgoAPI_ShapeTools::area() should be used. Update test cases according to the new behavior of shape properties calculation. --- src/BuildPlugin/Test/Test20513_1.py | 2 +- src/BuildPlugin/Test/Test20513_2.py | 6 ++--- src/BuildPlugin/Test/Test2398.py | 2 +- src/BuildPlugin/Test/Test2409.py | 2 +- .../Test/TestFace_WholeSketch_1.py | 2 +- .../Test/TestFace_WholeSketch_2.py | 2 +- .../Test/TestShell_WholeSketch_1.py | 2 +- .../Test/TestShell_WholeSketch_2.py | 2 +- src/CollectionPlugin/Test/Test2977.py | 2 +- .../Test/TestGroupAddition.py | 2 +- .../Test/TestGroupIntersection.py | 2 +- .../FeaturesPlugin_BooleanFuse.cpp | 2 +- .../FeaturesPlugin_BooleanSmash.cpp | 4 +-- .../FeaturesPlugin_CompositeBoolean.cpp | 6 ++--- src/FeaturesPlugin/Test/Test17261.py | 2 +- src/FeaturesPlugin/Test/Test17281.py | 2 +- src/FeaturesPlugin/Test/Test18836.py | 4 +-- src/FeaturesPlugin/Test/Test19065.py | 2 +- src/FeaturesPlugin/Test/Test19066.py | 2 +- .../Test/TestExtrusion_ByFaces13.py | 10 ++++---- .../Test/TestExtrusion_ByFaces14.py | 10 ++++---- .../Test/TestExtrusion_ByFaces15.py | 14 +++++------ .../Test/TestExtrusion_ByFaces16.py | 6 ++--- .../Test/TestExtrusion_ByFaces17.py | 20 +++++++-------- .../Test/TestExtrusion_ByFaces18.py | 10 ++++---- .../Test/TestExtrusion_ByFaces19.py | 16 ++++++------ ...stMultiRotation_MultiLevelCompound_v0_3.py | 9 +++++-- ...stMultiRotation_MultiLevelCompound_v0_4.py | 9 +++++-- ...tMultiRotation_MultiLevelCompound_v95_3.py | 9 +++++-- ...ultiTranslation_MultiLevelCompound_v0_3.py | 9 +++++-- ...ultiTranslation_MultiLevelCompound_v0_4.py | 9 +++++-- ...ltiTranslation_MultiLevelCompound_v95_3.py | 9 +++++-- src/FeaturesPlugin/Test/TestPipe_Edge.py | 4 +-- src/FeaturesPlugin/Test/TestPipe_Wire.py | 2 +- .../TestPlacement_MultiLevelCompound_v0_5.py | 9 +++++-- .../TestPlacement_MultiLevelCompound_v0_6.py | 9 +++++-- .../TestPlacement_MultiLevelCompound_v95_5.py | 9 +++++-- .../Test/TestRevolutionOfEdge.py | 4 +-- .../TestRotation_MultiLevelCompound_v0_3.py | 9 +++++-- .../TestRotation_MultiLevelCompound_v0_4.py | 9 +++++-- .../TestRotation_MultiLevelCompound_v95_3.py | 9 +++++-- .../Test/TestScale_MultiLevelCompound_v0_3.py | 9 +++++-- .../Test/TestScale_MultiLevelCompound_v0_4.py | 9 +++++-- .../TestScale_MultiLevelCompound_v95_3.py | 9 +++++-- .../TestSymmetry_MultiLevelCompound_v0_4.py | 9 +++++-- .../TestSymmetry_MultiLevelCompound_v0_5.py | 9 +++++-- .../TestSymmetry_MultiLevelCompound_v95_4.py | 9 +++++-- ...TestTranslation_MultiLevelCompound_v0_4.py | 9 +++++-- ...TestTranslation_MultiLevelCompound_v0_5.py | 9 +++++-- ...estTranslation_MultiLevelCompound_v95_4.py | 9 +++++-- src/Locale/Test/TestUTF8.py | 3 ++- src/ModelAPI/Test/Test19019_1.py | 2 +- .../ModelHighAPI_FeatureStore.cpp | 10 ++++++++ src/PythonAPI/model/tests/tests.py | 25 +++++++++++++++++++ 54 files changed, 258 insertions(+), 117 deletions(-) diff --git a/src/BuildPlugin/Test/Test20513_1.py b/src/BuildPlugin/Test/Test20513_1.py index 11192d91d..bc367a8ec 100644 --- a/src/BuildPlugin/Test/Test20513_1.py +++ b/src/BuildPlugin/Test/Test20513_1.py @@ -92,6 +92,6 @@ model.testNbSubShapes(Filling_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Filling_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Filling_1, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Filling_1, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Filling_1, [1872.0403629667237]) +model.testResultsAreas(Filling_1, [1872.0403629667237]) assert(model.checkPythonDump()) diff --git a/src/BuildPlugin/Test/Test20513_2.py b/src/BuildPlugin/Test/Test20513_2.py index 0809e739e..45196abc9 100644 --- a/src/BuildPlugin/Test/Test20513_2.py +++ b/src/BuildPlugin/Test/Test20513_2.py @@ -1121,7 +1121,7 @@ model.testNbSubShapes(Filling_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Filling_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Filling_1, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Filling_1, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Filling_1, [28.94082894]) +model.testResultsAreas(Filling_1, [28.94082894]) model.testNbResults(Filling_2, 1) model.testNbSubResults(Filling_2, [0]) @@ -1129,7 +1129,7 @@ model.testNbSubShapes(Filling_2, GeomAPI_Shape.SOLID, [0]) 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.testResultsVolumes(Filling_2, [29.198793093]) +model.testResultsAreas(Filling_2, [29.198793093]) model.testNbResults(Filling_3, 1) model.testNbSubResults(Filling_3, [0]) @@ -1137,6 +1137,6 @@ model.testNbSubShapes(Filling_3, GeomAPI_Shape.SOLID, [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.testResultsVolumes(Filling_3, [30.74501422428]) +model.testResultsAreas(Filling_3, [30.74501422428]) assert(model.checkPythonDump()) diff --git a/src/BuildPlugin/Test/Test2398.py b/src/BuildPlugin/Test/Test2398.py index f5a5b5e36..5b53791f8 100644 --- a/src/BuildPlugin/Test/Test2398.py +++ b/src/BuildPlugin/Test/Test2398.py @@ -102,7 +102,7 @@ for ref in REF_DATA: model.testNbSubShapes(ref[0], GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(ref[0], GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(ref[0], GeomAPI_Shape.VERTEX, [8]) - model.testResultsVolumes(ref[0], [ref[1]]) + model.testResultsAreas(ref[0], [ref[1]]) model.end() diff --git a/src/BuildPlugin/Test/Test2409.py b/src/BuildPlugin/Test/Test2409.py index 52679f434..15c7d1e22 100644 --- a/src/BuildPlugin/Test/Test2409.py +++ b/src/BuildPlugin/Test/Test2409.py @@ -56,7 +56,7 @@ assert(Filling_1.feature().error() == "") from GeomAPI import GeomAPI_Shape model.testNbResults(Filling_1, 1) model.testNbSubShapes(Filling_1, GeomAPI_Shape.FACE, [1]) -model.testResultsVolumes(Filling_1, [3500]) +model.testResultsAreas(Filling_1, [3500]) model.end() diff --git a/src/BuildPlugin/Test/TestFace_WholeSketch_1.py b/src/BuildPlugin/Test/TestFace_WholeSketch_1.py index cc6020f42..af3b48ae5 100644 --- a/src/BuildPlugin/Test/TestFace_WholeSketch_1.py +++ b/src/BuildPlugin/Test/TestFace_WholeSketch_1.py @@ -44,6 +44,6 @@ model.testNbResults(Face_1, 1) model.testNbSubShapes(Face_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Face_1, GeomAPI_Shape.EDGE, [3]) model.testNbSubShapes(Face_1, GeomAPI_Shape.VERTEX, [6]) -model.testResultsVolumes(Face_1, [441.0539215686274]) +model.testResultsAreas(Face_1, [441.0539215686274]) assert(model.checkPythonDump()) diff --git a/src/BuildPlugin/Test/TestFace_WholeSketch_2.py b/src/BuildPlugin/Test/TestFace_WholeSketch_2.py index 3bd558fec..a6b249a9a 100644 --- a/src/BuildPlugin/Test/TestFace_WholeSketch_2.py +++ b/src/BuildPlugin/Test/TestFace_WholeSketch_2.py @@ -44,6 +44,6 @@ model.testNbResults(Face_1, 3) model.testNbSubShapes(Face_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Face_1, GeomAPI_Shape.EDGE, [3, 2, 2]) model.testNbSubShapes(Face_1, GeomAPI_Shape.VERTEX, [6, 4, 4]) -model.testResultsVolumes(Face_1, [441.0539215686274, 628.318530717958, 628.318530717958]) +model.testResultsAreas(Face_1, [441.0539215686274, 628.318530717958, 628.318530717958]) assert(model.checkPythonDump()) diff --git a/src/BuildPlugin/Test/TestShell_WholeSketch_1.py b/src/BuildPlugin/Test/TestShell_WholeSketch_1.py index 552fcb8ce..79badd494 100644 --- a/src/BuildPlugin/Test/TestShell_WholeSketch_1.py +++ b/src/BuildPlugin/Test/TestShell_WholeSketch_1.py @@ -44,6 +44,6 @@ model.testNbResults(Shell_1, 1) model.testNbSubShapes(Shell_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Shell_1, GeomAPI_Shape.EDGE, [3]) model.testNbSubShapes(Shell_1, GeomAPI_Shape.VERTEX, [6]) -model.testResultsVolumes(Shell_1, [441.0539215686274]) +model.testResultsAreas(Shell_1, [441.0539215686274]) assert(model.checkPythonDump()) diff --git a/src/BuildPlugin/Test/TestShell_WholeSketch_2.py b/src/BuildPlugin/Test/TestShell_WholeSketch_2.py index 147ba773d..553bc8666 100644 --- a/src/BuildPlugin/Test/TestShell_WholeSketch_2.py +++ b/src/BuildPlugin/Test/TestShell_WholeSketch_2.py @@ -44,6 +44,6 @@ model.testNbResults(Shell_1, 2) model.testNbSubShapes(Shell_1, GeomAPI_Shape.FACE, [1, 2]) model.testNbSubShapes(Shell_1, GeomAPI_Shape.EDGE, [3, 4]) model.testNbSubShapes(Shell_1, GeomAPI_Shape.VERTEX, [6, 8]) -model.testResultsVolumes(Shell_1, [441.0539215686274, 1256.637061435917]) +model.testResultsAreas(Shell_1, [441.0539215686274, 1256.637061435917]) assert(model.checkPythonDump()) diff --git a/src/CollectionPlugin/Test/Test2977.py b/src/CollectionPlugin/Test/Test2977.py index 4cd7c5d85..6ab82788a 100644 --- a/src/CollectionPlugin/Test/Test2977.py +++ b/src/CollectionPlugin/Test/Test2977.py @@ -39,6 +39,6 @@ model.testNbSubShapes(GroupSubstraction_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(GroupSubstraction_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(GroupSubstraction_1, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(GroupSubstraction_1, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(GroupSubstraction_1, [200]) +model.testResultsAreas(GroupSubstraction_1, [200]) assert(model.checkPythonDump()) diff --git a/src/CollectionPlugin/Test/TestGroupAddition.py b/src/CollectionPlugin/Test/TestGroupAddition.py index 2b710ae94..f64841946 100644 --- a/src/CollectionPlugin/Test/TestGroupAddition.py +++ b/src/CollectionPlugin/Test/TestGroupAddition.py @@ -37,6 +37,6 @@ model.testNbSubShapes(GroupAddition_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(GroupAddition_1, GeomAPI_Shape.FACE, [3]) model.testNbSubShapes(GroupAddition_1, GeomAPI_Shape.EDGE, [12]) model.testNbSubShapes(GroupAddition_1, GeomAPI_Shape.VERTEX, [24]) -model.testResultsVolumes(GroupAddition_1, [300]) +model.testResultsAreas(GroupAddition_1, [300]) assert(model.checkPythonDump()) diff --git a/src/CollectionPlugin/Test/TestGroupIntersection.py b/src/CollectionPlugin/Test/TestGroupIntersection.py index 5aa68cea6..3b3add5a6 100644 --- a/src/CollectionPlugin/Test/TestGroupIntersection.py +++ b/src/CollectionPlugin/Test/TestGroupIntersection.py @@ -40,6 +40,6 @@ model.testNbSubShapes(GroupIntersection_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(GroupIntersection_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(GroupIntersection_1, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(GroupIntersection_1, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(GroupIntersection_1, [100]) +model.testResultsAreas(GroupIntersection_1, [100]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp index 3ab6d589c..58af29113 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanFuse.cpp @@ -185,7 +185,7 @@ void FeaturesPlugin_BooleanFuse::execute() std::shared_ptr aCutAlgo( new GeomAlgoAPI_Boolean(aOneObjectList, aShapesToAdd, GeomAlgoAPI_Tools::BOOL_CUT)); - if (GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) { + if (GeomAlgoAPI_ShapeTools::area(aCutAlgo->shape()) > 1.e-27) { aSolidsToFuse.push_back(aCutAlgo->shape()); aMakeShapeList->appendAlgo(aCutAlgo); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp index 0c7f3bab1..c38e8c5ee 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_BooleanSmash.cpp @@ -110,7 +110,7 @@ void FeaturesPlugin_BooleanSmash::execute() aShapesToAdd, GeomAlgoAPI_Tools::BOOL_CUT)); - if (GeomAlgoAPI_ShapeTools::volume(anObjectsCutAlgo->shape()) > 1.e-27) { + if (GeomAlgoAPI_ShapeTools::area(anObjectsCutAlgo->shape()) > 1.e-27) { aShapesToSmash.clear(); aShapesToSmash.push_back(anObjectsCutAlgo->shape()); aMakeShapeList->appendAlgo(anObjectsCutAlgo); @@ -122,7 +122,7 @@ void FeaturesPlugin_BooleanSmash::execute() aShapesToAdd, GeomAlgoAPI_Tools::BOOL_CUT)); - if (GeomAlgoAPI_ShapeTools::volume(aToolsCutAlgo->shape()) > 1.e-27) { + if (GeomAlgoAPI_ShapeTools::area(aToolsCutAlgo->shape()) > 1.e-27) { aTools.clear(); aTools.push_back(aToolsCutAlgo->shape()); aMakeShapeList->appendAlgo(aToolsCutAlgo); diff --git a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp index cf8706cac..db4917048 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_CompositeBoolean.cpp @@ -181,7 +181,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, return false; } - if(GeomAlgoAPI_ShapeTools::volume(aBoolAlgo->shape()) > 1.e-27) { + if(GeomAlgoAPI_ShapeTools::area(aBoolAlgo->shape()) > 1.e-27) { theObjects.push_back(anObject); theMakeShapes.push_back(aBoolAlgo); } @@ -238,7 +238,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, aMakeShapeList->appendAlgo(aFillerAlgo); } - if(GeomAlgoAPI_ShapeTools::volume(aBoolRes) > 1.e-27) { + if(GeomAlgoAPI_ShapeTools::area(aBoolRes) > 1.e-27) { theObjects.push_back(aCompSolid); theMakeShapes.push_back(aMakeShapeList); } @@ -323,7 +323,7 @@ bool FeaturesPlugin_CompositeBoolean::makeBoolean(const ListOfShape& theTools, std::shared_ptr aCutAlgo(new GeomAlgoAPI_Boolean(aSolidsToFuse, aShapesToAdd, GeomAlgoAPI_Tools::BOOL_CUT)); - if(aCutAlgo->isDone() && GeomAlgoAPI_ShapeTools::volume(aCutAlgo->shape()) > 1.e-27) { + if(aCutAlgo->isDone() && GeomAlgoAPI_ShapeTools::area(aCutAlgo->shape()) > 1.e-27) { aSolidsToFuse.clear(); aSolidsToFuse.push_back(aCutAlgo->shape()); aMakeShapeList->appendAlgo(aCutAlgo); diff --git a/src/FeaturesPlugin/Test/Test17261.py b/src/FeaturesPlugin/Test/Test17261.py index 6d86ad437..45fd53b57 100644 --- a/src/FeaturesPlugin/Test/Test17261.py +++ b/src/FeaturesPlugin/Test/Test17261.py @@ -142,6 +142,6 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [15]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [102]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [204]) -model.testResultsVolumes(Extrusion_1, [466.947878]) +model.testResultsAreas(Extrusion_1, [466.947878]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test17281.py b/src/FeaturesPlugin/Test/Test17281.py index c81ad2d64..a823b45c5 100644 --- a/src/FeaturesPlugin/Test/Test17281.py +++ b/src/FeaturesPlugin/Test/Test17281.py @@ -81,6 +81,6 @@ model.testNbSubShapes(Pipe_2, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Pipe_2, [280.91366299542733]) +model.testResultsAreas(Pipe_2, [280.91366299542733]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/Test18836.py b/src/FeaturesPlugin/Test/Test18836.py index a00106807..7786351b7 100644 --- a/src/FeaturesPlugin/Test/Test18836.py +++ b/src/FeaturesPlugin/Test/Test18836.py @@ -78,7 +78,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [16]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [64]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [128]) -model.testResultsVolumes(Extrusion_1, [10242.31054]) +model.testResultsAreas(Extrusion_1, [10242.31054]) model.testNbResults(Extrusion_2, 1) model.testNbSubResults(Extrusion_2, [16]) @@ -86,6 +86,6 @@ model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.FACE, [16]) model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.EDGE, [64]) model.testNbSubShapes(Extrusion_2, GeomAPI_Shape.VERTEX, [128]) -model.testResultsVolumes(Extrusion_2, [10242.31054]) +model.testResultsAreas(Extrusion_2, [10242.31054]) assert(model.checkPythonDump()) \ No newline at end of file diff --git a/src/FeaturesPlugin/Test/Test19065.py b/src/FeaturesPlugin/Test/Test19065.py index 92b68beaf..69d10692d 100644 --- a/src/FeaturesPlugin/Test/Test19065.py +++ b/src/FeaturesPlugin/Test/Test19065.py @@ -85,7 +85,7 @@ model.testNbSubShapes(Pipe_2, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.FACE, [5]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.EDGE, [20]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.VERTEX, [40]) -model.testResultsVolumes(Pipe_2, [26549.49767585]) +model.testResultsAreas(Pipe_2, [26549.49767585]) # Cut should have no results model.testNbResults(Cut_1, 0) diff --git a/src/FeaturesPlugin/Test/Test19066.py b/src/FeaturesPlugin/Test/Test19066.py index 41e4615f4..da092afd0 100644 --- a/src/FeaturesPlugin/Test/Test19066.py +++ b/src/FeaturesPlugin/Test/Test19066.py @@ -109,6 +109,6 @@ model.testNbSubShapes(Pipe_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Pipe_1, GeomAPI_Shape.FACE, [12]) model.testNbSubShapes(Pipe_1, GeomAPI_Shape.EDGE, [48]) model.testNbSubShapes(Pipe_1, GeomAPI_Shape.VERTEX, [96]) -model.testResultsVolumes(Pipe_1, [27370.29819]) +model.testResultsAreas(Pipe_1, [27370.29819]) assert(model.checkPythonDump()) diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces13.py b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces13.py index dbae3cea1..0d89fc335 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces13.py +++ b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces13.py @@ -62,7 +62,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [2377.030013, 800, 2377.030013, 916.515139]) +model.testResultsAreas(Extrusion_1, [2377.030013, 800, 2377.030013, 916.515139]) # change radius of cylinder ParamR.setValue(10) @@ -82,7 +82,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1840.601542, 529.150262, 1840.601542, 692.820323]) +model.testResultsAreas(Extrusion_1, [1840.601542, 529.150262, 1840.601542, 692.820323]) # change offsetting "To" face ParamTo.setValue(-20) @@ -98,7 +98,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [2899.292521, 1039.2304845, 2899.292521, 1131.3708499]) +model.testResultsAreas(Extrusion_1, [2899.292521, 1039.2304845, 2899.292521, 1131.3708499]) # offset "From" face ParamFrom.setValue(20) @@ -109,7 +109,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [3899.292521, 1439.2304845, 3899.292521, 1531.3708499]) +model.testResultsAreas(Extrusion_1, [3899.292521, 1439.2304845, 3899.292521, 1531.3708499]) ParamFrom.setValue(-20) model.do() @@ -119,7 +119,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1899.292521, 639.2304845, 1899.292521, 731.3708499]) +model.testResultsAreas(Extrusion_1, [1899.292521, 639.2304845, 1899.292521, 731.3708499]) model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces14.py b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces14.py index ebac64a8b..b519388d6 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces14.py +++ b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces14.py @@ -63,7 +63,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [4877.030013, 1800, 4877.030013, 1916.515139]) +model.testResultsAreas(Extrusion_1, [4877.030013, 1800, 4877.030013, 1916.515139]) # change radius of cylinder and check failure ParamR.setValue(10) @@ -83,7 +83,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [4340.6015418, 1529.1502622, 4340.6015418, 1692.820323]) +model.testResultsAreas(Extrusion_1, [4340.6015418, 1529.1502622, 4340.6015418, 1692.820323]) # change offsetting "To" face and check failure ParamTo.setValue(-20) @@ -99,7 +99,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [5399.2925211, 2039.2304845, 5399.2925212, 2131.37085]) +model.testResultsAreas(Extrusion_1, [5399.2925211, 2039.2304845, 5399.2925212, 2131.37085]) # offset "From" face ParamFrom.setValue(20) @@ -110,7 +110,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [6399.2925211, 2439.2304845, 6399.2925212, 2531.37085]) +model.testResultsAreas(Extrusion_1, [6399.2925211, 2439.2304845, 6399.2925212, 2531.37085]) ParamFrom.setValue(-20) model.do() @@ -120,7 +120,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [4399.2925211, 1639.2304845, 4399.2925212, 1731.37085]) +model.testResultsAreas(Extrusion_1, [4399.2925211, 1639.2304845, 4399.2925212, 1731.37085]) model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces15.py b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces15.py index 5383c9ac5..610674bab 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces15.py +++ b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces15.py @@ -82,7 +82,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1911.43203298, 1911.43203298, 4564.43663366]) +model.testResultsAreas(Extrusion_1, [1911.43203298, 1911.43203298, 4564.43663366]) # change radius of sphere and check failure ParamR.setValue(10) @@ -98,7 +98,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1034.989222291, 1034.989222291, 2276.43702246]) +model.testResultsAreas(Extrusion_1, [1034.989222291, 1034.989222291, 2276.43702246]) ParamR.setValue(40); model.do() @@ -108,7 +108,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1505.0174, 1505.0174, 3530.28837537636]) +model.testResultsAreas(Extrusion_1, [1505.0174, 1505.0174, 3530.28837537636]) # change size of the face ParamSize.setValue(10) @@ -119,7 +119,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1505.0174, 1505.0174, 3530.28837537636]) +model.testResultsAreas(Extrusion_1, [1505.0174, 1505.0174, 3530.28837537636]) # change offsetting "To" face and check failure ParamTo.setValue(-20) @@ -135,7 +135,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [2295.81450653, 2295.81450653, 5527.16645028]) +model.testResultsAreas(Extrusion_1, [2295.81450653, 2295.81450653, 5527.16645028]) # offset "From" face ParamFrom.setValue(20) @@ -146,7 +146,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1595.81450653, 1595.81450653, 3814.47306888]) +model.testResultsAreas(Extrusion_1, [1595.81450653, 1595.81450653, 3814.47306888]) ParamFrom.setValue(-20) model.do() @@ -156,7 +156,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [2995.81450653, 2995.81450653, 7239.85983168]) +model.testResultsAreas(Extrusion_1, [2995.81450653, 2995.81450653, 7239.85983168]) model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces16.py b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces16.py index 4cba579cb..d1da71150 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces16.py +++ b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces16.py @@ -101,7 +101,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1708.843326299, 1708.843325768, 1895.559443038]) +model.testResultsAreas(Extrusion_1, [1708.843326299, 1708.843325768, 1895.559443038]) # offset "From" face ParamFrom.setValue(20) @@ -112,7 +112,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [2915.069101129, 2915.069100598, 4138.27332218]) +model.testResultsAreas(Extrusion_1, [2915.069101129, 2915.069100598, 4138.27332218]) # check failure ParamFrom.setValue(-20) @@ -128,7 +128,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 8]) -model.testResultsVolumes(Extrusion_1, [1105.7304388842, 1105.730438353, 774.2025034671]) +model.testResultsAreas(Extrusion_1, [1105.7304388842, 1105.730438353, 774.2025034671]) model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces17.py b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces17.py index 1782b69ef..f09d1b560 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces17.py +++ b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces17.py @@ -51,7 +51,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Extrusion_1, [2178.8497332]) +model.testResultsAreas(Extrusion_1, [2178.8497332]) # change radius of sketch circle ParamRCir.setValue(17) @@ -62,7 +62,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [10]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [20]) -model.testResultsVolumes(Extrusion_1, [3960.00723]) +model.testResultsAreas(Extrusion_1, [3960.00723]) # change radius of sphere ParamRSph.setValue(10) @@ -73,7 +73,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [5]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [10]) -model.testResultsVolumes(Extrusion_1, [3658.7714]) +model.testResultsAreas(Extrusion_1, [3658.7714]) # change radius of sketch circle and check failure ParamRCir.setValue(10) @@ -89,7 +89,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Extrusion_1, [1398.72992867]) +model.testResultsAreas(Extrusion_1, [1398.72992867]) # change radius of cylinder ParamRCyl.setValue(10) @@ -100,7 +100,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [6]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [12]) -model.testResultsVolumes(Extrusion_1, [4194.25709]) +model.testResultsAreas(Extrusion_1, [4194.25709]) ParamRCyl.setValue(50) model.do() @@ -110,7 +110,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Extrusion_1, [1433.0518]) +model.testResultsAreas(Extrusion_1, [1433.0518]) # change offsetting "To" face ParamTo.setValue(-20) @@ -121,7 +121,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [10]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [20]) -model.testResultsVolumes(Extrusion_1, [5078.347278]) +model.testResultsAreas(Extrusion_1, [5078.347278]) # revert failure ParamTo.setValue(20) @@ -132,7 +132,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Extrusion_1, [1504.36096473]) +model.testResultsAreas(Extrusion_1, [1504.36096473]) # offset "From" face ParamFrom.setValue(20) @@ -143,7 +143,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Extrusion_1, [4336.142699]) +model.testResultsAreas(Extrusion_1, [4336.142699]) ParamFrom.setValue(-20) model.do() @@ -153,7 +153,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Extrusion_1, [1118.8887326]) +model.testResultsAreas(Extrusion_1, [1118.8887326]) model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces18.py b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces18.py index e25dd0dc7..9904f5f5a 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces18.py +++ b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces18.py @@ -62,7 +62,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 5]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 10]) -model.testResultsVolumes(Extrusion_1, [1309.42058662, 1016.82520496, 2589.5946928]) +model.testResultsAreas(Extrusion_1, [1309.42058662, 1016.82520496, 2589.5946928]) # change radius of sphere and check failure ParamR.setValue(10) @@ -78,7 +78,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 5]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 10]) -model.testResultsVolumes(Extrusion_1, [1081.93830116, 793.80218227, 2095.8021933]) +model.testResultsAreas(Extrusion_1, [1081.93830116, 793.80218227, 2095.8021933]) # change offsetting "To" face and check failure ParamTo.setValue(-20) @@ -94,7 +94,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4, 4, 5]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8, 8, 10]) -model.testResultsVolumes(Extrusion_1, [1314.8586588, 1022.169915122, 2601.32913399]) +model.testResultsAreas(Extrusion_1, [1314.8586588, 1022.169915122, 2601.32913399]) # offset "From" face ParamFrom.setValue(20) @@ -103,7 +103,7 @@ model.testNbResults(Extrusion_1, 3) model.testNbSubResults(Extrusion_1, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) -model.testResultsVolumes(Extrusion_1, [825.71966141, 533.030917699, 1551.6191757579]) +model.testResultsAreas(Extrusion_1, [825.71966141, 533.030917699, 1551.6191757579]) ParamFrom.setValue(-20) model.do() @@ -111,7 +111,7 @@ model.testNbResults(Extrusion_1, 3) model.testNbSubResults(Extrusion_1, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0, 0, 0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [1, 1, 1]) -model.testResultsVolumes(Extrusion_1, [1803.997656259, 1511.308912545, 3651.0390970659]) +model.testResultsAreas(Extrusion_1, [1803.997656259, 1511.308912545, 3651.0390970659]) model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces19.py b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces19.py index ee57d7af9..5c12d9cc6 100644 --- a/src/FeaturesPlugin/Test/TestExtrusion_ByFaces19.py +++ b/src/FeaturesPlugin/Test/TestExtrusion_ByFaces19.py @@ -61,7 +61,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [16]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [32]) -model.testResultsVolumes(Extrusion_1, [6470.575165134267]) +model.testResultsAreas(Extrusion_1, [6470.575165134267]) # change radius of cylinder ParamR.setValue(10) @@ -72,7 +72,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Extrusion_1, [314.159265359]) +model.testResultsAreas(Extrusion_1, [314.159265359]) ParamR.setValue(30) model.do() @@ -82,7 +82,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [3]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [10]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [20]) -model.testResultsVolumes(Extrusion_1, [2964.89877572]) +model.testResultsAreas(Extrusion_1, [2964.89877572]) # check the intersected boundaries are processed well ParamR.setValue(40); @@ -93,7 +93,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [16]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [32]) -model.testResultsVolumes(Extrusion_1, [4903.173668915]) +model.testResultsAreas(Extrusion_1, [4903.173668915]) # change offsetting "To" face ParamTo.setValue(-20) @@ -104,7 +104,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Extrusion_1, [1256.637061267]) +model.testResultsAreas(Extrusion_1, [1256.637061267]) ParamTo.setValue(20) model.do() @@ -114,7 +114,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [16]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [32]) -model.testResultsVolumes(Extrusion_1, [7969.186376787]) +model.testResultsAreas(Extrusion_1, [7969.186376787]) # offset "From" face ParamFrom.setValue(20) @@ -125,7 +125,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [16]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [32]) -model.testResultsVolumes(Extrusion_1, [5169.186376787]) +model.testResultsAreas(Extrusion_1, [5169.186376787]) ParamFrom.setValue(-20) model.do() @@ -135,7 +135,7 @@ model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.FACE, [4]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.EDGE, [16]) model.testNbSubShapes(Extrusion_1, GeomAPI_Shape.VERTEX, [32]) -model.testResultsVolumes(Extrusion_1, [10769.186376787]) +model.testResultsAreas(Extrusion_1, [10769.186376787]) model.testHaveNamingSubshapes(Extrusion_1, model, Part_1_doc) diff --git a/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v0_3.py b/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v0_3.py index 7442e963f..a18ca3736 100644 --- a/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v0_3.py +++ b/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v0_3.py @@ -88,6 +88,7 @@ model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.VERTEX, [COPIES]) model.testResultsVolumes(MultiRotation_1, [0]) +model.testResultsAreas(MultiRotation_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) @@ -102,6 +103,7 @@ model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.EDGE, [COPIES]) model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.VERTEX, [2 * COPIES]) model.testResultsVolumes(MultiRotation_2, [0]) +model.testResultsAreas(MultiRotation_2, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Edge_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setY(0) @@ -117,6 +119,7 @@ model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.EDGE, [2 * COPIES]) model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.VERTEX, [4 * COPIES]) model.testResultsVolumes(MultiRotation_3, [0]) +model.testResultsAreas(MultiRotation_3, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Wire_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setY(0) @@ -131,7 +134,8 @@ model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.FACE, [COPIES]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.EDGE, [4 * COPIES]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.VERTEX, [8 * COPIES]) -model.testResultsVolumes(MultiRotation_4, [109.154152964914914 * COPIES]) +model.testResultsVolumes(MultiRotation_4, [0]) +model.testResultsAreas(MultiRotation_4, [109.154152964914914 * COPIES]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) @@ -145,7 +149,8 @@ model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.FACE, [2 * COPIES]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.EDGE, [8 * COPIES]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.VERTEX, [16 * COPIES]) -model.testResultsVolumes(MultiRotation_5, [182.822012116 * COPIES]) +model.testResultsVolumes(MultiRotation_5, [0]) +model.testResultsAreas(MultiRotation_5, [182.822012116 * COPIES]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) diff --git a/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v0_4.py b/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v0_4.py index fb3623c8f..66b6b2cd7 100644 --- a/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v0_4.py +++ b/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v0_4.py @@ -90,6 +90,7 @@ model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.VERTEX, [COPIES]) model.testResultsVolumes(MultiRotation_1, [0]) +model.testResultsAreas(MultiRotation_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) @@ -105,6 +106,7 @@ model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.EDGE, [COPIES]) model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.VERTEX, [2 * COPIES]) model.testResultsVolumes(MultiRotation_2, [0]) +model.testResultsAreas(MultiRotation_2, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Edge_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setY(0) @@ -121,6 +123,7 @@ model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.EDGE, [2 * COPIES]) model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.VERTEX, [4 * COPIES]) model.testResultsVolumes(MultiRotation_3, [0]) +model.testResultsAreas(MultiRotation_3, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Wire_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setY(0) @@ -136,7 +139,8 @@ model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.FACE, [COPIES]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.EDGE, [4 * COPIES]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.VERTEX, [8 * COPIES]) -model.testResultsVolumes(MultiRotation_4, [109.154152964914914 * COPIES]) +model.testResultsVolumes(MultiRotation_4, [0]) +model.testResultsAreas(MultiRotation_4, [109.154152964914914 * COPIES]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) @@ -151,7 +155,8 @@ model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.FACE, [2 * COPIES]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.EDGE, [8 * COPIES]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.VERTEX, [16 * COPIES]) -model.testResultsVolumes(MultiRotation_5, [182.822012116 * COPIES]) +model.testResultsVolumes(MultiRotation_5, [0]) +model.testResultsAreas(MultiRotation_5, [182.822012116 * COPIES]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) diff --git a/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v95_3.py b/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v95_3.py index f416272c7..14de933f4 100644 --- a/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v95_3.py +++ b/src/FeaturesPlugin/Test/TestMultiRotation_MultiLevelCompound_v95_3.py @@ -88,6 +88,7 @@ model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(MultiRotation_1, GeomAPI_Shape.VERTEX, [COPIES]) model.testResultsVolumes(MultiRotation_1, [0]) +model.testResultsAreas(MultiRotation_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) @@ -102,6 +103,7 @@ model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.EDGE, [COPIES]) model.testNbSubShapes(MultiRotation_2, GeomAPI_Shape.VERTEX, [2 * COPIES]) model.testResultsVolumes(MultiRotation_2, [0]) +model.testResultsAreas(MultiRotation_2, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Edge_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setY(0) @@ -117,6 +119,7 @@ model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.EDGE, [2 * COPIES]) model.testNbSubShapes(MultiRotation_3, GeomAPI_Shape.VERTEX, [4 * COPIES]) model.testResultsVolumes(MultiRotation_3, [0]) +model.testResultsAreas(MultiRotation_3, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Wire_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setY(0) @@ -131,7 +134,8 @@ model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.FACE, [COPIES]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.EDGE, [4 * COPIES]) model.testNbSubShapes(MultiRotation_4, GeomAPI_Shape.VERTEX, [8 * COPIES]) -model.testResultsVolumes(MultiRotation_4, [109.154152964914914 * COPIES]) +model.testResultsVolumes(MultiRotation_4, [0]) +model.testResultsAreas(MultiRotation_4, [109.154152964914914 * COPIES]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) @@ -145,7 +149,8 @@ model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.FACE, [2 * COPIES]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.EDGE, [8 * COPIES]) model.testNbSubShapes(MultiRotation_5, GeomAPI_Shape.VERTEX, [16 * COPIES]) -model.testResultsVolumes(MultiRotation_5, [182.822012116 * COPIES]) +model.testResultsVolumes(MultiRotation_5, [0]) +model.testResultsAreas(MultiRotation_5, [182.822012116 * COPIES]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setY(0) refPoint.setZ(0) diff --git a/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v0_3.py b/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v0_3.py index 199af9d66..cdef8ba16 100644 --- a/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v0_3.py +++ b/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v0_3.py @@ -89,6 +89,7 @@ model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.VERTEX, [COPIES]) model.testResultsVolumes(MultiTranslation_1, [0]) +model.testResultsAreas(MultiTranslation_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_1.defaultResult().shape().middlePoint() @@ -102,6 +103,7 @@ model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.EDGE, [COPIES]) model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.VERTEX, [2 * COPIES]) model.testResultsVolumes(MultiTranslation_2, [0]) +model.testResultsAreas(MultiTranslation_2, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Edge_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) @@ -116,6 +118,7 @@ model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.EDGE, [2 * COPIES]) model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.VERTEX, [4 * COPIES]) model.testResultsVolumes(MultiTranslation_3, [0]) +model.testResultsAreas(MultiTranslation_3, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Wire_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) @@ -129,7 +132,8 @@ model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.FACE, [COPIES]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.EDGE, [4 * COPIES]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.VERTEX, [8 * COPIES]) -model.testResultsVolumes(MultiTranslation_4, [109.154152964914914 * COPIES]) +model.testResultsVolumes(MultiTranslation_4, [0]) +model.testResultsAreas(MultiTranslation_4, [109.154152964914914 * COPIES]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_4.defaultResult().shape().middlePoint() @@ -142,7 +146,8 @@ model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.FACE, [2 * COPIES]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.EDGE, [8 * COPIES]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.VERTEX, [16 * COPIES]) -model.testResultsVolumes(MultiTranslation_5, [182.822012116 * COPIES]) +model.testResultsVolumes(MultiTranslation_5, [0]) +model.testResultsAreas(MultiTranslation_5, [182.822012116 * COPIES]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_5.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v0_4.py b/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v0_4.py index 2c627b964..2f7a1eaa0 100644 --- a/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v0_4.py +++ b/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v0_4.py @@ -91,6 +91,7 @@ model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.VERTEX, [COPIES]) model.testResultsVolumes(MultiTranslation_1, [0]) +model.testResultsAreas(MultiTranslation_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_1.defaultResult().shape().middlePoint() @@ -105,6 +106,7 @@ model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.EDGE, [COPIES]) model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.VERTEX, [2 * COPIES]) model.testResultsVolumes(MultiTranslation_2, [0]) +model.testResultsAreas(MultiTranslation_2, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Edge_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) @@ -120,6 +122,7 @@ model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.EDGE, [2 * COPIES]) model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.VERTEX, [4 * COPIES]) model.testResultsVolumes(MultiTranslation_3, [0]) +model.testResultsAreas(MultiTranslation_3, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Wire_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) @@ -134,7 +137,8 @@ model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.FACE, [COPIES]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.EDGE, [4 * COPIES]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.VERTEX, [8 * COPIES]) -model.testResultsVolumes(MultiTranslation_4, [109.154152964914914 * COPIES]) +model.testResultsVolumes(MultiTranslation_4, [0]) +model.testResultsAreas(MultiTranslation_4, [109.154152964914914 * COPIES]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_4.defaultResult().shape().middlePoint() @@ -148,7 +152,8 @@ model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.FACE, [2 * COPIES]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.EDGE, [8 * COPIES]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.VERTEX, [16 * COPIES]) -model.testResultsVolumes(MultiTranslation_5, [182.822012116 * COPIES]) +model.testResultsVolumes(MultiTranslation_5, [0]) +model.testResultsAreas(MultiTranslation_5, [182.822012116 * COPIES]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_5.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v95_3.py b/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v95_3.py index 4b851506b..58bfab263 100644 --- a/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v95_3.py +++ b/src/FeaturesPlugin/Test/TestMultiTranslation_MultiLevelCompound_v95_3.py @@ -89,6 +89,7 @@ model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(MultiTranslation_1, GeomAPI_Shape.VERTEX, [COPIES]) model.testResultsVolumes(MultiTranslation_1, [0]) +model.testResultsAreas(MultiTranslation_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_1.defaultResult().shape().middlePoint() @@ -102,6 +103,7 @@ model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.EDGE, [COPIES]) model.testNbSubShapes(MultiTranslation_2, GeomAPI_Shape.VERTEX, [2 * COPIES]) model.testResultsVolumes(MultiTranslation_2, [0]) +model.testResultsAreas(MultiTranslation_2, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Edge_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) @@ -116,6 +118,7 @@ model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.EDGE, [2 * COPIES]) model.testNbSubShapes(MultiTranslation_3, GeomAPI_Shape.VERTEX, [4 * COPIES]) model.testResultsVolumes(MultiTranslation_3, [0]) +model.testResultsAreas(MultiTranslation_3, [0]) comp = GeomAlgoAPI_CompoundBuilder.compound([Wire_1.defaultResult().shape()]) refPoint = comp.middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) @@ -129,7 +132,8 @@ model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.FACE, [COPIES]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.EDGE, [4 * COPIES]) model.testNbSubShapes(MultiTranslation_4, GeomAPI_Shape.VERTEX, [8 * COPIES]) -model.testResultsVolumes(MultiTranslation_4, [109.154152964914914 * COPIES]) +model.testResultsVolumes(MultiTranslation_4, [0]) +model.testResultsAreas(MultiTranslation_4, [109.154152964914914 * COPIES]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_4.defaultResult().shape().middlePoint() @@ -142,7 +146,8 @@ model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.FACE, [2 * COPIES]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.EDGE, [8 * COPIES]) model.testNbSubShapes(MultiTranslation_5, GeomAPI_Shape.VERTEX, [16 * COPIES]) -model.testResultsVolumes(MultiTranslation_5, [182.822012116 * COPIES]) +model.testResultsVolumes(MultiTranslation_5, [0]) +model.testResultsAreas(MultiTranslation_5, [182.822012116 * COPIES]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE / 2 * (COPIES - 1)) midPoint = MultiTranslation_5.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestPipe_Edge.py b/src/FeaturesPlugin/Test/TestPipe_Edge.py index d0f1abaab..8701f0006 100644 --- a/src/FeaturesPlugin/Test/TestPipe_Edge.py +++ b/src/FeaturesPlugin/Test/TestPipe_Edge.py @@ -42,7 +42,7 @@ model.testNbSubShapes(Pipe_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Pipe_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Pipe_1, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Pipe_1, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Pipe_1, [3693.366575752712378744035959244]) +model.testResultsAreas(Pipe_1, [3693.366575752712378744035959244]) model.testNbResults(Pipe_2, 1) model.testNbSubResults(Pipe_2, [0]) @@ -50,4 +50,4 @@ model.testNbSubShapes(Pipe_2, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Pipe_2, [3543.018638942841789685189723969]) +model.testResultsAreas(Pipe_2, [3543.018638942841789685189723969]) diff --git a/src/FeaturesPlugin/Test/TestPipe_Wire.py b/src/FeaturesPlugin/Test/TestPipe_Wire.py index 8bc4bbd98..6e3c20a08 100644 --- a/src/FeaturesPlugin/Test/TestPipe_Wire.py +++ b/src/FeaturesPlugin/Test/TestPipe_Wire.py @@ -65,4 +65,4 @@ model.testNbSubShapes(Pipe_2, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.FACE, [3]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.EDGE, [12]) model.testNbSubShapes(Pipe_2, GeomAPI_Shape.VERTEX, [24]) -model.testResultsVolumes(Pipe_2, [6000]) +model.testResultsAreas(Pipe_2, [6000]) diff --git a/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v0_5.py b/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v0_5.py index c66e0407e..fc757724f 100644 --- a/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v0_5.py +++ b/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v0_5.py @@ -86,6 +86,7 @@ model.testNbSubShapes(Placement_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Placement_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Placement_1, [0]) +model.testResultsAreas(Placement_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_1.defaultResult().shape().middlePoint() @@ -99,6 +100,7 @@ model.testNbSubShapes(Placement_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Placement_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Placement_2, [0]) +model.testResultsAreas(Placement_2, [0]) refPoint = Edge_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_2.defaultResult().shape().middlePoint() @@ -112,6 +114,7 @@ model.testNbSubShapes(Placement_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Placement_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Placement_3, [0]) +model.testResultsAreas(Placement_3, [0]) refPoint = Wire_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_3.defaultResult().shape().middlePoint() @@ -124,7 +127,8 @@ model.testNbSubShapes(Placement_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Placement_4, [109.154152964914914]) +model.testResultsVolumes(Placement_4, [0]) +model.testResultsAreas(Placement_4, [109.154152964914914]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_4.defaultResult().shape().middlePoint() @@ -137,7 +141,8 @@ model.testNbSubShapes(Placement_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Placement_5, [182.822012116]) +model.testResultsVolumes(Placement_5, [0]) +model.testResultsAreas(Placement_5, [182.822012116]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_5.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v0_6.py b/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v0_6.py index eae3e70dd..d6cabdb1d 100644 --- a/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v0_6.py +++ b/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v0_6.py @@ -96,6 +96,7 @@ model.testNbSubShapes(Placement_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Placement_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Placement_1, [0]) +model.testResultsAreas(Placement_1, [0]) midPoint = Placement_1.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -109,6 +110,7 @@ model.testNbSubShapes(Placement_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Placement_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Placement_2, [0]) +model.testResultsAreas(Placement_2, [0]) midPoint = Placement_2.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -122,6 +124,7 @@ model.testNbSubShapes(Placement_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Placement_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Placement_3, [0]) +model.testResultsAreas(Placement_3, [0]) midPoint = Placement_3.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -134,7 +137,8 @@ model.testNbSubShapes(Placement_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Placement_4, [109.154152964914914]) +model.testResultsVolumes(Placement_4, [0]) +model.testResultsAreas(Placement_4, [109.154152964914914]) midPoint = Placement_4.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -147,7 +151,8 @@ model.testNbSubShapes(Placement_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Placement_5, [182.822012116]) +model.testResultsVolumes(Placement_5, [0]) +model.testResultsAreas(Placement_5, [182.822012116]) midPoint = Placement_5.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 diff --git a/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v95_5.py b/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v95_5.py index 86ec4d26a..1b25df154 100644 --- a/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v95_5.py +++ b/src/FeaturesPlugin/Test/TestPlacement_MultiLevelCompound_v95_5.py @@ -86,6 +86,7 @@ model.testNbSubShapes(Placement_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Placement_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Placement_1, [0]) +model.testResultsAreas(Placement_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_1.defaultResult().shape().middlePoint() @@ -99,6 +100,7 @@ model.testNbSubShapes(Placement_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Placement_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Placement_2, [0]) +model.testResultsAreas(Placement_2, [0]) refPoint = Edge_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_2.defaultResult().shape().middlePoint() @@ -112,6 +114,7 @@ model.testNbSubShapes(Placement_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Placement_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Placement_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Placement_3, [0]) +model.testResultsAreas(Placement_3, [0]) refPoint = Wire_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_3.defaultResult().shape().middlePoint() @@ -124,7 +127,8 @@ model.testNbSubShapes(Placement_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Placement_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Placement_4, [109.154152964914914]) +model.testResultsVolumes(Placement_4, [0]) +model.testResultsAreas(Placement_4, [109.154152964914914]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_4.defaultResult().shape().middlePoint() @@ -137,7 +141,8 @@ model.testNbSubShapes(Placement_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Placement_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Placement_5, [182.822012116]) +model.testResultsVolumes(Placement_5, [0]) +model.testResultsAreas(Placement_5, [182.822012116]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + Z_SHIFT) midPoint = Placement_5.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestRevolutionOfEdge.py b/src/FeaturesPlugin/Test/TestRevolutionOfEdge.py index 2e33b79ef..36cdbe00e 100644 --- a/src/FeaturesPlugin/Test/TestRevolutionOfEdge.py +++ b/src/FeaturesPlugin/Test/TestRevolutionOfEdge.py @@ -36,7 +36,7 @@ model.testNbSubShapes(Revolution_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Revolution_1, [666.43244]) +model.testResultsAreas(Revolution_1, [666.43244]) Revolution_1.setPlanesAndOffsets(model.selection("FACE", "PartSet/YOZ"), 0, model.selection("FACE", "PartSet/XOZ"), 0) @@ -46,7 +46,7 @@ model.testNbSubShapes(Revolution_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Revolution_1, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Revolution_1, [333.21622]) +model.testResultsAreas(Revolution_1, [333.21622]) model.end() diff --git a/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v0_3.py b/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v0_3.py index 663d60584..9f06f283a 100644 --- a/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v0_3.py +++ b/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v0_3.py @@ -88,6 +88,7 @@ model.testNbSubShapes(Rotation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Rotation_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Rotation_1, [0]) +model.testResultsAreas(Rotation_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_1.defaultResult().shape().middlePoint() @@ -101,6 +102,7 @@ model.testNbSubShapes(Rotation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Rotation_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Rotation_2, [0]) +model.testResultsAreas(Rotation_2, [0]) refPoint = Edge_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_2.defaultResult().shape().middlePoint() @@ -114,6 +116,7 @@ model.testNbSubShapes(Rotation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Rotation_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Rotation_3, [0]) +model.testResultsAreas(Rotation_3, [0]) refPoint = Wire_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_3.defaultResult().shape().middlePoint() @@ -126,7 +129,8 @@ model.testNbSubShapes(Rotation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Rotation_4, [109.154152964914914]) +model.testResultsVolumes(Rotation_4, [0]) +model.testResultsAreas(Rotation_4, [109.154152964914914]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_4.defaultResult().shape().middlePoint() @@ -139,7 +143,8 @@ model.testNbSubShapes(Rotation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Rotation_5, [182.822012116]) +model.testResultsVolumes(Rotation_5, [0]) +model.testResultsAreas(Rotation_5, [182.822012116]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_5.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v0_4.py b/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v0_4.py index b092bf01a..a5f256192 100644 --- a/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v0_4.py +++ b/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v0_4.py @@ -90,6 +90,7 @@ model.testNbSubShapes(Rotation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Rotation_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Rotation_1, [0]) +model.testResultsAreas(Rotation_1, [0]) refPoint = Compound_1.result().subResult(0).resultSubShapePair()[0].shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_1.defaultResult().shape().middlePoint() @@ -104,6 +105,7 @@ model.testNbSubShapes(Rotation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Rotation_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Rotation_2, [0]) +model.testResultsAreas(Rotation_2, [0]) refPoint = Compound_1.result().subResult(1).resultSubShapePair()[0].shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_2.defaultResult().shape().middlePoint() @@ -118,6 +120,7 @@ model.testNbSubShapes(Rotation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Rotation_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Rotation_3, [0]) +model.testResultsAreas(Rotation_3, [0]) refPoint = Compound_1.result().subResult(2).resultSubShapePair()[0].shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_3.defaultResult().shape().middlePoint() @@ -131,7 +134,8 @@ model.testNbSubShapes(Rotation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Rotation_4, [109.154152964914914]) +model.testResultsVolumes(Rotation_4, [0]) +model.testResultsAreas(Rotation_4, [109.154152964914914]) refPoint = Compound_1.result().subResult(3).resultSubShapePair()[0].shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_4.defaultResult().shape().middlePoint() @@ -145,7 +149,8 @@ model.testNbSubShapes(Rotation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Rotation_5, [182.822012116]) +model.testResultsVolumes(Rotation_5, [0]) +model.testResultsAreas(Rotation_5, [182.822012116]) refPoint = Compound_1.result().subResult(4).resultSubShapePair()[0].shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_5.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v95_3.py b/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v95_3.py index 45750ed6a..18a8137c1 100644 --- a/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v95_3.py +++ b/src/FeaturesPlugin/Test/TestRotation_MultiLevelCompound_v95_3.py @@ -88,6 +88,7 @@ model.testNbSubShapes(Rotation_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Rotation_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Rotation_1, [0]) +model.testResultsAreas(Rotation_1, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_1.defaultResult().shape().middlePoint() @@ -101,6 +102,7 @@ model.testNbSubShapes(Rotation_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Rotation_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Rotation_2, [0]) +model.testResultsAreas(Rotation_2, [0]) refPoint = Edge_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_2.defaultResult().shape().middlePoint() @@ -114,6 +116,7 @@ model.testNbSubShapes(Rotation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Rotation_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Rotation_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Rotation_3, [0]) +model.testResultsAreas(Rotation_3, [0]) refPoint = Wire_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_3.defaultResult().shape().middlePoint() @@ -126,7 +129,8 @@ model.testNbSubShapes(Rotation_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Rotation_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Rotation_4, [109.154152964914914]) +model.testResultsVolumes(Rotation_4, [0]) +model.testResultsAreas(Rotation_4, [109.154152964914914]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_4.defaultResult().shape().middlePoint() @@ -139,7 +143,8 @@ model.testNbSubShapes(Rotation_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Rotation_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Rotation_5, [182.822012116]) +model.testResultsVolumes(Rotation_5, [0]) +model.testResultsAreas(Rotation_5, [182.822012116]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.rotate(AXIS, ANGLE) midPoint = Rotation_5.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v0_3.py b/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v0_3.py index 4ac842d05..46ea3a16f 100644 --- a/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v0_3.py +++ b/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v0_3.py @@ -87,6 +87,7 @@ model.testNbSubShapes(Scale_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Scale_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Scale_1, [0]) +model.testResultsAreas(Scale_1, [0]) refPoint = GeomAPI_Pnt(Vertex_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_1.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -99,6 +100,7 @@ model.testNbSubShapes(Scale_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Scale_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Scale_2, [0]) +model.testResultsAreas(Scale_2, [0]) refPoint = GeomAPI_Pnt(Edge_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_2.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -111,6 +113,7 @@ model.testNbSubShapes(Scale_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Scale_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Scale_3, [0]) +model.testResultsAreas(Scale_3, [0]) refPoint = GeomAPI_Pnt(Wire_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_3.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -122,7 +125,8 @@ model.testNbSubShapes(Scale_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Scale_4, [109.154152964914914 * (SCALE**2)]) +model.testResultsVolumes(Scale_4, [0]) +model.testResultsAreas(Scale_4, [109.154152964914914 * (SCALE**2)]) refPoint = GeomAPI_Pnt(Face_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_4.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -134,7 +138,8 @@ model.testNbSubShapes(Scale_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Scale_5, [182.822012116 * (SCALE**2)]) +model.testResultsVolumes(Scale_5, [0]) +model.testResultsAreas(Scale_5, [182.822012116 * (SCALE**2)]) refPoint = GeomAPI_Pnt(Shell_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_5.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) diff --git a/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v0_4.py b/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v0_4.py index 23cf7c5c4..4b9d74420 100644 --- a/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v0_4.py +++ b/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v0_4.py @@ -89,6 +89,7 @@ model.testNbSubShapes(Scale_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Scale_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Scale_1, [0]) +model.testResultsAreas(Scale_1, [0]) refPoint = GeomAPI_Pnt(Compound_1.result().subResult(0).resultSubShapePair()[0].shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_1.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -102,6 +103,7 @@ model.testNbSubShapes(Scale_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Scale_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Scale_2, [0]) +model.testResultsAreas(Scale_2, [0]) refPoint = GeomAPI_Pnt(Compound_1.result().subResult(1).resultSubShapePair()[0].shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_2.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -115,6 +117,7 @@ model.testNbSubShapes(Scale_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Scale_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Scale_3, [0]) +model.testResultsAreas(Scale_3, [0]) refPoint = GeomAPI_Pnt(Compound_1.result().subResult(2).resultSubShapePair()[0].shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_3.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -127,7 +130,8 @@ model.testNbSubShapes(Scale_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Scale_4, [109.154152964914914 * (SCALE**2)]) +model.testResultsVolumes(Scale_4, [0]) +model.testResultsAreas(Scale_4, [109.154152964914914 * (SCALE**2)]) refPoint = GeomAPI_Pnt(Compound_1.result().subResult(3).resultSubShapePair()[0].shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_4.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -140,7 +144,8 @@ model.testNbSubShapes(Scale_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Scale_5, [182.822012116 * (SCALE**2)]) +model.testResultsVolumes(Scale_5, [0]) +model.testResultsAreas(Scale_5, [182.822012116 * (SCALE**2)]) refPoint = GeomAPI_Pnt(Compound_1.result().subResult(4).resultSubShapePair()[0].shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_5.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) diff --git a/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v95_3.py b/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v95_3.py index f87072313..43dd85f51 100644 --- a/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v95_3.py +++ b/src/FeaturesPlugin/Test/TestScale_MultiLevelCompound_v95_3.py @@ -87,6 +87,7 @@ model.testNbSubShapes(Scale_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Scale_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Scale_1, [0]) +model.testResultsAreas(Scale_1, [0]) refPoint = GeomAPI_Pnt(Vertex_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_1.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -99,6 +100,7 @@ model.testNbSubShapes(Scale_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Scale_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Scale_2, [0]) +model.testResultsAreas(Scale_2, [0]) refPoint = GeomAPI_Pnt(Edge_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_2.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -111,6 +113,7 @@ model.testNbSubShapes(Scale_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Scale_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Scale_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Scale_3, [0]) +model.testResultsAreas(Scale_3, [0]) refPoint = GeomAPI_Pnt(Wire_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_3.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -122,7 +125,8 @@ model.testNbSubShapes(Scale_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Scale_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Scale_4, [109.154152964914914 * (SCALE**2)]) +model.testResultsVolumes(Scale_4, [0]) +model.testResultsAreas(Scale_4, [109.154152964914914 * (SCALE**2)]) refPoint = GeomAPI_Pnt(Face_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_4.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -134,7 +138,8 @@ model.testNbSubShapes(Scale_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Scale_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Scale_5, [182.822012116 * (SCALE**2)]) +model.testResultsVolumes(Scale_5, [0]) +model.testResultsAreas(Scale_5, [182.822012116 * (SCALE**2)]) refPoint = GeomAPI_Pnt(Shell_1.defaultResult().shape().middlePoint().xyz().multiplied(SCALE)) midPoint = Scale_5.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) diff --git a/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v0_4.py b/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v0_4.py index a9027c2ce..001fffc04 100644 --- a/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v0_4.py +++ b/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v0_4.py @@ -89,6 +89,7 @@ model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Symmetry_1, [0]) +model.testResultsAreas(Symmetry_1, [0]) refPoint = symmetryOZ(Vertex_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_1.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -101,6 +102,7 @@ model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Symmetry_2, [0]) +model.testResultsAreas(Symmetry_2, [0]) refPoint = symmetryOZ(Edge_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_2.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -113,6 +115,7 @@ model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Symmetry_3, [0]) +model.testResultsAreas(Symmetry_3, [0]) refPoint = symmetryOZ(Wire_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_3.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -124,7 +127,8 @@ model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Symmetry_4, [109.154152964914914]) +model.testResultsVolumes(Symmetry_4, [0]) +model.testResultsAreas(Symmetry_4, [109.154152964914914]) refPoint = symmetryOZ(Face_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_4.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -136,7 +140,8 @@ model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Symmetry_5, [182.822012116]) +model.testResultsVolumes(Symmetry_5, [0]) +model.testResultsAreas(Symmetry_5, [182.822012116]) refPoint = symmetryOZ(Shell_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_5.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) diff --git a/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v0_5.py b/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v0_5.py index ff02dc40a..3a34d0501 100644 --- a/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v0_5.py +++ b/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v0_5.py @@ -96,6 +96,7 @@ model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Symmetry_1, [0]) +model.testResultsAreas(Symmetry_1, [0]) midPoint = Symmetry_1.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -109,6 +110,7 @@ model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Symmetry_2, [0]) +model.testResultsAreas(Symmetry_2, [0]) midPoint = Symmetry_2.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -122,6 +124,7 @@ model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Symmetry_3, [0]) +model.testResultsAreas(Symmetry_3, [0]) midPoint = Symmetry_3.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -134,7 +137,8 @@ model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Symmetry_4, [109.154152964914914]) +model.testResultsVolumes(Symmetry_4, [0]) +model.testResultsAreas(Symmetry_4, [109.154152964914914]) midPoint = Symmetry_4.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -147,7 +151,8 @@ model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Symmetry_5, [182.822012116]) +model.testResultsVolumes(Symmetry_5, [0]) +model.testResultsAreas(Symmetry_5, [182.822012116]) midPoint = Symmetry_5.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 diff --git a/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v95_4.py b/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v95_4.py index 68383bd04..77d5edfc1 100644 --- a/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v95_4.py +++ b/src/FeaturesPlugin/Test/TestSymmetry_MultiLevelCompound_v95_4.py @@ -89,6 +89,7 @@ model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Symmetry_1, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Symmetry_1, [0]) +model.testResultsAreas(Symmetry_1, [0]) refPoint = symmetryOZ(Vertex_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_1.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -101,6 +102,7 @@ model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Symmetry_2, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Symmetry_2, [0]) +model.testResultsAreas(Symmetry_2, [0]) refPoint = symmetryOZ(Edge_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_2.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -113,6 +115,7 @@ model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Symmetry_3, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Symmetry_3, [0]) +model.testResultsAreas(Symmetry_3, [0]) refPoint = symmetryOZ(Wire_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_3.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -124,7 +127,8 @@ model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Symmetry_4, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Symmetry_4, [109.154152964914914]) +model.testResultsVolumes(Symmetry_4, [0]) +model.testResultsAreas(Symmetry_4, [109.154152964914914]) refPoint = symmetryOZ(Face_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_4.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) @@ -136,7 +140,8 @@ model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Symmetry_5, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Symmetry_5, [182.822012116]) +model.testResultsVolumes(Symmetry_5, [0]) +model.testResultsAreas(Symmetry_5, [182.822012116]) refPoint = symmetryOZ(Shell_1.defaultResult().shape().middlePoint()) midPoint = Symmetry_5.defaultResult().shape().middlePoint() assert(midPoint.distance(refPoint) < TOLERANCE) diff --git a/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v0_4.py b/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v0_4.py index 61d29899d..f42b6f70b 100644 --- a/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v0_4.py +++ b/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v0_4.py @@ -86,6 +86,7 @@ model.testNbSubShapes(Translation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_3, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Translation_3, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Translation_3, [0]) +model.testResultsAreas(Translation_3, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_3.defaultResult().shape().middlePoint() @@ -99,6 +100,7 @@ model.testNbSubShapes(Translation_4, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Translation_4, [0]) +model.testResultsAreas(Translation_4, [0]) refPoint = Edge_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_4.defaultResult().shape().middlePoint() @@ -112,6 +114,7 @@ model.testNbSubShapes(Translation_5, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_5, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Translation_5, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Translation_5, [0]) +model.testResultsAreas(Translation_5, [0]) refPoint = Wire_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_5.defaultResult().shape().middlePoint() @@ -124,7 +127,8 @@ model.testNbSubShapes(Translation_6, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Translation_6, [109.154152964914914]) +model.testResultsVolumes(Translation_6, [0]) +model.testResultsAreas(Translation_6, [109.154152964914914]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_6.defaultResult().shape().middlePoint() @@ -137,7 +141,8 @@ model.testNbSubShapes(Translation_7, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Translation_7, [182.822012116]) +model.testResultsVolumes(Translation_7, [0]) +model.testResultsAreas(Translation_7, [182.822012116]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_7.defaultResult().shape().middlePoint() diff --git a/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v0_5.py b/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v0_5.py index 1b33ecb7a..702211726 100644 --- a/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v0_5.py +++ b/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v0_5.py @@ -96,6 +96,7 @@ model.testNbSubShapes(Translation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_3, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Translation_3, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Translation_3, [0]) +model.testResultsAreas(Translation_3, [0]) midPoint = Translation_3.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -109,6 +110,7 @@ model.testNbSubShapes(Translation_4, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Translation_4, [0]) +model.testResultsAreas(Translation_4, [0]) midPoint = Translation_4.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -122,6 +124,7 @@ model.testNbSubShapes(Translation_5, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_5, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Translation_5, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Translation_5, [0]) +model.testResultsAreas(Translation_5, [0]) midPoint = Translation_5.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -134,7 +137,8 @@ model.testNbSubShapes(Translation_6, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Translation_6, [109.154152964914914]) +model.testResultsVolumes(Translation_6, [0]) +model.testResultsAreas(Translation_6, [109.154152964914914]) midPoint = Translation_6.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 @@ -147,7 +151,8 @@ model.testNbSubShapes(Translation_7, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Translation_7, [182.822012116]) +model.testResultsVolumes(Translation_7, [0]) +model.testResultsAreas(Translation_7, [182.822012116]) midPoint = Translation_7.defaultResult().shape().middlePoint() assert(midPoint.distance(REFERENCE[index]) < TOLERANCE) index += 1 diff --git a/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v95_4.py b/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v95_4.py index 37a86e7a6..dd1586ea4 100644 --- a/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v95_4.py +++ b/src/FeaturesPlugin/Test/TestTranslation_MultiLevelCompound_v95_4.py @@ -86,6 +86,7 @@ model.testNbSubShapes(Translation_3, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_3, GeomAPI_Shape.EDGE, [0]) model.testNbSubShapes(Translation_3, GeomAPI_Shape.VERTEX, [1]) model.testResultsVolumes(Translation_3, [0]) +model.testResultsAreas(Translation_3, [0]) refPoint = Vertex_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_3.defaultResult().shape().middlePoint() @@ -99,6 +100,7 @@ model.testNbSubShapes(Translation_4, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.EDGE, [1]) model.testNbSubShapes(Translation_4, GeomAPI_Shape.VERTEX, [2]) model.testResultsVolumes(Translation_4, [0]) +model.testResultsAreas(Translation_4, [0]) refPoint = Edge_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_4.defaultResult().shape().middlePoint() @@ -112,6 +114,7 @@ model.testNbSubShapes(Translation_5, GeomAPI_Shape.FACE, [0]) model.testNbSubShapes(Translation_5, GeomAPI_Shape.EDGE, [2]) model.testNbSubShapes(Translation_5, GeomAPI_Shape.VERTEX, [4]) model.testResultsVolumes(Translation_5, [0]) +model.testResultsAreas(Translation_5, [0]) refPoint = Wire_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_5.defaultResult().shape().middlePoint() @@ -124,7 +127,8 @@ model.testNbSubShapes(Translation_6, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.EDGE, [4]) model.testNbSubShapes(Translation_6, GeomAPI_Shape.VERTEX, [8]) -model.testResultsVolumes(Translation_6, [109.154152964914914]) +model.testResultsVolumes(Translation_6, [0]) +model.testResultsAreas(Translation_6, [109.154152964914914]) refPoint = Face_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_6.defaultResult().shape().middlePoint() @@ -137,7 +141,8 @@ model.testNbSubShapes(Translation_7, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.FACE, [2]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.EDGE, [8]) model.testNbSubShapes(Translation_7, GeomAPI_Shape.VERTEX, [16]) -model.testResultsVolumes(Translation_7, [182.822012116]) +model.testResultsVolumes(Translation_7, [0]) +model.testResultsAreas(Translation_7, [182.822012116]) refPoint = Shell_1.defaultResult().shape().middlePoint() refPoint.setZ(refPoint.z() + DISTANCE) midPoint = Translation_7.defaultResult().shape().middlePoint() diff --git a/src/Locale/Test/TestUTF8.py b/src/Locale/Test/TestUTF8.py index 488bcd001..5afea6047 100644 --- a/src/Locale/Test/TestUTF8.py +++ b/src/Locale/Test/TestUTF8.py @@ -58,6 +58,7 @@ model.testNbSubShapes(Cut_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Cut_1, GeomAPI_Shape.FACE, [3]) model.testNbSubShapes(Cut_1, GeomAPI_Shape.EDGE, [9]) model.testNbSubShapes(Cut_1, GeomAPI_Shape.VERTEX, [18]) -model.testResultsVolumes(Cut_1, [64.38055098]) +model.testResultsVolumes(Cut_1, [0.0]) +model.testResultsAreas(Cut_1, [64.38055098]) assert(model.checkPythonDump()) diff --git a/src/ModelAPI/Test/Test19019_1.py b/src/ModelAPI/Test/Test19019_1.py index a04a4cb26..f9da723e2 100644 --- a/src/ModelAPI/Test/Test19019_1.py +++ b/src/ModelAPI/Test/Test19019_1.py @@ -48,6 +48,6 @@ model.testNbSubShapes(Part_1, GeomAPI_Shape.SOLID, [0]) model.testNbSubShapes(Part_1, GeomAPI_Shape.FACE, [1]) model.testNbSubShapes(Part_1, GeomAPI_Shape.EDGE, [3]) model.testNbSubShapes(Part_1, GeomAPI_Shape.VERTEX, [6]) -model.testResultsVolumes(Part_1, [3416.5596]) +model.testResultsAreas(Part_1, [3416.5596]) assert(model.checkPythonDump()) diff --git a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp index 58e32136f..ebfbfce05 100644 --- a/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp +++ b/src/ModelHighAPI/ModelHighAPI_FeatureStore.cpp @@ -423,6 +423,16 @@ std::string ModelHighAPI_FeatureStore::dumpShape(std::shared_ptr& aResult< 1.e-5) { + aResult << "Area: "; + // volumes of too huge shapes write in the scientific format + if (anArea >= 1.e5) + aResult << std::scientific << std::setprecision(7); + else + aResult << std::fixed << std::setprecision(3); + aResult << anArea << std::endl; + } std::shared_ptr aCenter = GeomAlgoAPI_ShapeTools::centreOfMass(theShape); aResult<<"Center of mass: "; double aCenterVals[3] = {aCenter->x(), aCenter->y(), aCenter->z()}; diff --git a/src/PythonAPI/model/tests/tests.py b/src/PythonAPI/model/tests/tests.py index 90fe18fa6..ac4d6af95 100644 --- a/src/PythonAPI/model/tests/tests.py +++ b/src/PythonAPI/model/tests/tests.py @@ -72,6 +72,13 @@ def generateTests(theFeature, theFeatureName, theTestsList = []): aResultsVolumes.append(GeomAlgoAPI_ShapeTools_volume(theFeature.results()[anIndex].resultSubShapePair()[0].shape())) print("model.testResultsVolumes({}, [{}])".format(theFeatureName, ", ".join("{:0.27f}".format(i) for i in aResultsVolumes))) + if "testResultsAreas" in theTestsList or len(theTestsList) == 0: + aNbResults = len(theFeature.results()) + aResultsAreas = [] + for anIndex in range(0, aNbResults): + aResultsAreas.append(GeomAlgoAPI_ShapeTools_area(theFeature.results()[anIndex].resultSubShapePair()[0].shape())) + print("model.testResultsAreas({}, [{}])".format(theFeatureName, ", ".join("{:0.27f}".format(i) for i in aResultsAreas))) + def testNbResults(theFeature, theExpectedNbResults): """ Tests number of feature results. @@ -132,6 +139,24 @@ def testResultsVolumes(theFeature, theExpectedResultsVolumes, theNbSignificantDi anExpectedResultVolumeStr = "{:0.27f}".format(anExpectedResultVolume).lstrip("0").lstrip(".").lstrip("0") assert math.fabs(aResultVolume - anExpectedResultVolume) <= aTolerance * math.fabs(anExpectedResultVolume), "Volume of result[{}]: {:0.27f}. Expected: {:0.27f}. The first {} significant digits not equal.".format(anIndex, aResultVolume, anExpectedResultVolume, theNbSignificantDigits) + +def testResultsAreas(theFeature, theExpectedResultsVolumes, theNbSignificantDigits = 7): + """ Tests results areas. + :param theFeature: feature to test. + :param theExpectedResultsAreas: list of results areas. Size of list should be equal to len(theFeature.results()). + """ + aTolerance = 10**(-theNbSignificantDigits) + aNbResults = len(theFeature.results()) + aListSize = len(theExpectedResultsVolumes) + assert (aNbResults == aListSize), "Number of results: {} not equal to list size: {}.".format(aNbResults, aListSize) + for anIndex in range(0, aNbResults): + aResultVolume = GeomAlgoAPI_ShapeTools_area(theFeature.results()[anIndex].resultSubShapePair()[0].shape()) + aResultVolumeStr = "{:0.27f}".format(aResultVolume).lstrip("0").lstrip(".").lstrip("0") + anExpectedResultVolume = theExpectedResultsVolumes[anIndex] + anExpectedResultVolumeStr = "{:0.27f}".format(anExpectedResultVolume).lstrip("0").lstrip(".").lstrip("0") + assert math.fabs(aResultVolume - anExpectedResultVolume) <= aTolerance * math.fabs(anExpectedResultVolume), "Area of result[{}]: {:0.27f}. Expected: {:0.27f}. The first {} significant digits not equal.".format(anIndex, aResultVolume, anExpectedResultVolume, theNbSignificantDigits) + + def testHaveNamingFaces(theFeature, theModel, thePartDoc) : """ Tests if all faces of result have a name :param theFeature: feature to test. -- 2.30.2