From c0e62209309f0d8168bb9c9095079993a6767e39 Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 23 Mar 2018 10:31:23 +0300 Subject: [PATCH] Porting: naming changes in OCCT that caused problems in unit-tests. --- src/BuildPlugin/Test/Test2398.py | 8 ++-- src/FeaturesPlugin/Test/Test2375.py | 6 +-- src/FeaturesPlugin/Test/Test2394.py | 14 +++---- src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp | 15 +++++-- src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp | 40 ++++++++++++------- .../GeomAlgoAPI_UnifySameDomain.cpp | 16 ++++---- src/Model/Model_BodyBuilder.cpp | 8 +++- src/PythonAPI/examples/Platine.py | 6 +-- .../Transformations/TestTranslation_2.py | 13 +++--- 9 files changed, 77 insertions(+), 49 deletions(-) diff --git a/src/BuildPlugin/Test/Test2398.py b/src/BuildPlugin/Test/Test2398.py index 2fb40778a..b6ca3f6a1 100644 --- a/src/BuildPlugin/Test/Test2398.py +++ b/src/BuildPlugin/Test/Test2398.py @@ -92,10 +92,10 @@ model.do() from GeomAPI import * # check fillings -REF_DATA = [(Filling_1, 718.953160474090168463590089232), - (Filling_2, 910.697240711571453175565693527), - (Filling_3, 718.950138772744594461983069777), - (Filling_4, 910.697500240109889091399963945)] +REF_DATA = [(Filling_1, 718.953888643813570524798706174), + (Filling_2, 910.698815675366518007649574429), + (Filling_3, 718.953684242875738164002541453), + (Filling_4, 910.697703817550063831731677055)] for ref in REF_DATA: model.testNbResults(ref[0], 1) model.testNbSubResults(ref[0], [0]) diff --git a/src/FeaturesPlugin/Test/Test2375.py b/src/FeaturesPlugin/Test/Test2375.py index fb13fde51..16cb0352a 100644 --- a/src/FeaturesPlugin/Test/Test2375.py +++ b/src/FeaturesPlugin/Test/Test2375.py @@ -209,12 +209,12 @@ Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_2/ Boolean_1 = model.addCommon(Part_1_doc, [model.selection("SOLID", "Extrusion_1_2"), model.selection("SOLID", "Extrusion_1_1")], [model.selection("SOLID", "Revolution_2_1")]) Boolean_2 = model.addCut(Part_1_doc, [model.selection("SOLID", "ExtrusionCut_3_1")], [model.selection("SOLID", "Boolean_1_1"), model.selection("SOLID", "Boolean_1_2")]) # skip 3 vertices, limitation -Group_1_objects = [model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Boolean_2_1/Modified_Face_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5033"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5031"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5043"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5069"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5082"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5024"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5022"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_8"), model.selection("VERTEX", "Extrusion_1_2/Lateral_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("VERTEX", "Boolean_2_1/Modified_Face_2&Boolean_1_1/Modified_Face_1"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5095"), model.selection("VERTEX", "ExtrusionCut_3_1/Lateral_5004"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("VERTEX", "Extrusion_1_1/Lateral_4"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5006"), model.selection("VERTEX", "Boolean_2_1/Modified_Face_1&Boolean_1_2/Modified_Face_1"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_12"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5108"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5015"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5013"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_10"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3")] +Group_1_objects = [model.selection("VERTEX", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("VERTEX", "Revolution_1_1/Generated_Face_2&Boolean_2_1/Modified_Face_1"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5095"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("VERTEX", "ExtrusionCut_3_1/Lateral_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("VERTEX", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5108"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5082"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5069"), model.selection("VERTEX", "ExtrusionCut_1_1/Lateral_5043"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5024"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5006"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5015"), model.selection("VERTEX", "Extrusion_1_1/Lateral_4"), model.selection("VERTEX", "Extrusion_1_2/Lateral_4"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5033"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5031"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5022"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5004"), model.selection("VERTEX", "ExtrusionCut_2_1/Vertex_5013"), model.selection("VERTEX", "Boolean_1_2/Modified_Face_2&Boolean_1_2/Modified_Face_1"), model.selection("VERTEX", "Boolean_1_1/Modified_Face_2&Boolean_1_1/Modified_Face_1")] Group_1 = model.addGroup(Part_1_doc, Group_1_objects) # skip 3 edges, limitation -Group_2_objects = [model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_10&ExtrusionCut_2_1/Modfied_11"), model.selection("EDGE", "Boolean_2_1/Modified_Face_3&ExtrusionCut_2_1/Modfied_11"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_10"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5011"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3&Boolean_2_1/Modified_Face_3"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&Boolean_1_2/Modified_Face_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_3&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "Boolean_1_2/Modified_Edge_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_12"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_12&ExtrusionCut_2_1/Modfied_13"), model.selection("EDGE", "Boolean_2_1/Modified_Face_3&ExtrusionCut_2_1/Modfied_13"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5002"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Boolean_1_1/Modified_Edge_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_2&Boolean_1_1/Modified_Face_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_3&ExtrusionCut_2_1/Modfied_9"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "Boolean_2_1/Modified_Face_3&Boolean_2_1/Modified_Face_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_8&ExtrusionCut_2_1/Modfied_9"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4&Boolean_2_1/Modified_Face_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Boolean_2_1/Modified_Face_3"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3&Boolean_2_1/Modified_Face_3"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5&Boolean_2_1/Modified_Face_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6&Boolean_2_1/Modified_Face_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_6&ExtrusionCut_2_1/Modfied_7"), model.selection("EDGE", "Boolean_2_1/Modified_Face_3&ExtrusionCut_2_1/Modfied_7"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5029"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8&Boolean_2_1/Modified_Face_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5020")] +Group_2_objects = [model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_3&ExtrusionCut_2_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5011"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "Boolean_1_2/Modified_Face_2&Boolean_1_2/Modified_Face_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&Boolean_1_2/Modified_Face_2"), model.selection("EDGE", "Boolean_1_2/Modified_Edge_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_3"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_4&ExtrusionCut_2_1/Modfied_9"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_9&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5002"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Boolean_1_1/Modified_Edge_1"), model.selection("EDGE", "Boolean_1_1/Modified_Face_2&Boolean_1_1/Modified_Face_1"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&Boolean_1_1/Modified_Face_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4&ExtrusionCut_3_1/Modfied_2"), model.selection("EDGE", "Revolution_1_1/Generated_Face_5&Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2&ExtrusionCut_2_1/Modfied_7"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_4"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_3&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_5&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_6&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "Revolution_1_1/Generated_Face_4"), model.selection("EDGE", "Boolean_2_1/Modified_Face_1&ExtrusionCut_2_1/Generated_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5&ExtrusionCut_2_1/Modfied_6"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_5"), model.selection("EDGE", "Revolution_1_1/Generated_Face_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5029"), model.selection("EDGE", "ExtrusionCut_3_1/Modfied_2&ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8"), model.selection("EDGE", "ExtrusionCut_1_1/Modfied_8&Boolean_2_1/Modified_Face_1"), model.selection("EDGE", "ExtrusionCut_2_1/Modfied_2"), model.selection("EDGE", "ExtrusionCut_2_1/Lateral_5020")] Group_2 = model.addGroup(Part_1_doc, Group_2_objects) -Group_3_objects = [model.selection("FACE", "ExtrusionCut_2_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_11"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_10"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_3"), model.selection("FACE", "Boolean_1_2/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_12"), model.selection("FACE", "Boolean_1_1/Modified_Face_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_9"), model.selection("FACE", "Boolean_2_1/Modified_Face_3"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_2"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_8"), model.selection("FACE", "Boolean_2_1/Modified_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_13"), model.selection("FACE", "Boolean_2_1/Modified_Face_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_7"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_8")] +Group_3_objects = [model.selection("FACE", "ExtrusionCut_2_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_8"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_3"), model.selection("FACE", "Boolean_1_2/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_4"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_9"), model.selection("FACE", "Boolean_1_1/Modified_Face_1"), model.selection("FACE", "Revolution_1_1/Generated_Face_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Boolean_2_1/Modified_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_2"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_7"), model.selection("FACE", "Boolean_1_1/Modified_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_4"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "Boolean_1_2/Modified_Face_2"), model.selection("FACE", "Revolution_1_1/Generated_Face_2"), model.selection("FACE", "ExtrusionCut_3_1/Modfied_3"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_5"), model.selection("FACE", "ExtrusionCut_2_1/Generated_Face_1"), model.selection("FACE", "ExtrusionCut_2_1/Modfied_6"), model.selection("FACE", "ExtrusionCut_1_1/Modfied_8")] Group_3 = model.addGroup(Part_1_doc, Group_3_objects) model.end() diff --git a/src/FeaturesPlugin/Test/Test2394.py b/src/FeaturesPlugin/Test/Test2394.py index fae2d1a1e..e5e950d46 100644 --- a/src/FeaturesPlugin/Test/Test2394.py +++ b/src/FeaturesPlugin/Test/Test2394.py @@ -88,13 +88,13 @@ Extrusion_1.setNestedSketch(Sketch_2) Boolean_1 = model.addFill(Part_1_doc, [model.selection("SOLID", "Revolution_1_1")], [model.selection("SOLID", "Extrusion_1_1")]) Point_2 = model.addPoint(Part_1_doc, "x", "y", "-z") -Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Boolean_1_1_2/Modified_Face_1&Boolean_1_1_2/Modified_Face_3&Boolean_1_1_2/Modified_Face_4")) +Axis_4 = model.addAxis(Part_1_doc, model.selection("VERTEX", "Point_1"), model.selection("VERTEX", "Boolean_1_1_2/Modified_Face_3&Boolean_1_1_2/Modified_Face_2&Boolean_1_1_2/Modified_Face_1")) Plane_4 = model.addPlane(Part_1_doc, model.selection("EDGE", "Axis_1"), model.selection("VERTEX", "Point_1"), True) Plane_5 = model.addPlane(Part_1_doc, model.selection("FACE", "Plane_1"), "haut_ext_tuyau", True) Plane_5.result().setName("Plane_2 arrivee tuyau") -Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Boolean_1_1_2/Modified_Face_5"), model.selection("EDGE", "Boolean_1_1_2/Modified_Face_5&Boolean_1_1_2/Modified_Face_2"), 45) -Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Boolean_1_1_2/Modified_Face_6"), model.selection("EDGE", "Boolean_1_1_2/Modified_Face_6&Boolean_1_1_2/Modified_Face_2"), 45) -Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Boolean_1_1_2/Modified_Face_6"), model.selection("EDGE", "Boolean_1_1_2/Modified_Face_6&Boolean_1_1_2/Modified_Face_5"), "90+45") +Plane_6 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_3"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1"), 45) +Plane_7 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1"), 45) +Plane_8 = model.addPlane(Part_1_doc, model.selection("FACE", "Extrusion_1_1/Generated_Face_4"), model.selection("EDGE", "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_4"), "90+45") Boolean_2 = model.addFill(Part_1_doc, [model.selection("SOLID", "Boolean_1_1_1")], [model.selection("FACE", "Plane_5")]) Boolean_3 = model.addFill(Part_1_doc, [model.selection("SOLID", "Boolean_2_1_2")], [model.selection("FACE", "Plane_3")]) @@ -171,7 +171,7 @@ model.do() Revolution_2 = model.addRevolution(Part_1_doc, [model.selection("FACE", "Sketch_4/Face-SketchArc_2_2f-SketchLine_18r")], model.selection("EDGE", "Sketch_4/Edge-SketchLine_18"), 0, 180) Boolean_5 = model.addCut(Part_1_doc, [model.selection("SOLID", "Revolution_2_1")], [model.selection("SOLID", "Extrusion_3_1")]) -Boolean_5.result().setName("demi-sphère") +Boolean_5.result().setName("demi-sphere") Plane_9 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/From_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_10&Extrusion_2_1/Generated_Face_1&Extrusion_2_1/To_Face_4"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_2&Extrusion_2_1/Generated_Face_10&Extrusion_2_1/To_Face_4")) Plane_10 = model.addPlane(Part_1_doc, model.selection("VERTEX", "Extrusion_2_1/Generated_Face_12&Extrusion_2_1/Generated_Face_11&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/To_Face_1"), model.selection("VERTEX", "Extrusion_2_1/Generated_Face_13&Extrusion_2_1/Generated_Face_12&Extrusion_2_1/From_Face_1")) @@ -186,7 +186,7 @@ Plane_15 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape Plane_16 = model.addPlane(Part_1_doc, model.selection("FACE", "Recover_1_1/Shape6"), model.selection("EDGE", "Recover_1_1/Shape3&Recover_1_1/Shape6"), 45) Boolean_6_objects_2 = [model.selection("FACE", "Plane_6"), model.selection("FACE", "Plane_7"), model.selection("FACE", "Plane_8"), model.selection("FACE", "Plane_9"), model.selection("FACE", "Plane_10"), model.selection("FACE", "Plane_11"), model.selection("FACE", "Plane_12"), model.selection("FACE", "Plane_13")] -Boolean_6 = model.addFill(Part_1_doc, [model.selection("SOLID", "demi-sphère")], Boolean_6_objects_2) +Boolean_6 = model.addFill(Part_1_doc, [model.selection("SOLID", "demi-sphere")], Boolean_6_objects_2) Union_2_objects = [model.selection("SOLID", "Boolean_6_1_16"), model.selection("SOLID", "Boolean_6_1_13"), model.selection("SOLID", "Boolean_6_1_14")] Union_2 = model.addUnion(Part_1_doc, Union_2_objects) @@ -205,7 +205,7 @@ Union_6.result().subResult(2).setColor(102, 51, 102) Union_6.result().subResult(3).setColor(76, 76, 153) Union_6.result().subResult(4).setColor(0, 0, 254) -Partition_1_objects = [model.selection("SOLID", "Recover_1_1"), model.selection("COMPSOLID", "Union_1_1"), model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "demi-sphère")] +Partition_1_objects = [model.selection("SOLID", "Recover_1_1"), model.selection("COMPSOLID", "Union_1_1"), model.selection("COMPSOLID", "Extrusion_2_1"), model.selection("COMPSOLID", "demi-sphere")] Partition_1 = model.addPartition(Part_1_doc, Partition_1_objects) Partition_1.result().setColor(102, 0, 0) Partition_1.result().subResult(0).setColor(255, 255, 0) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp index 7cf3b3fb4..1c615ced3 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShapeList.cpp @@ -126,13 +126,18 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr theS for(NCollection_Map::Iterator aShapeIt(anAlgoShapes); aShapeIt.More(); aShapeIt.Next()) { bool hasResults = false; + bool anArgumentIsInResult = false; std::shared_ptr aShape(new GeomAPI_Shape); aShape->setImpl(new TopoDS_Shape(aShapeIt.Value())); ListOfShape aGeneratedShapes; aMakeShape->generated(aShape, aGeneratedShapes); - for(ListOfShape::const_iterator - anIt = aGeneratedShapes.cbegin(); anIt != aGeneratedShapes.cend(); anIt++) { + for (ListOfShape::const_iterator + anIt = aGeneratedShapes.cbegin(); anIt != aGeneratedShapes.cend(); anIt++) { const TopoDS_Shape& anItShape = (*anIt)->impl(); + if (anItShape.IsSame(aShapeIt.Value())) { + anArgumentIsInResult = true; + continue; + } aTempShapes.Add(anItShape); if(aResultShapesMap.Add(anItShape) == Standard_True) { aResultShapesList.Append(anItShape); @@ -144,13 +149,17 @@ void GeomAlgoAPI_MakeShapeList::result(const std::shared_ptr theS for(ListOfShape::const_iterator anIt = aModifiedShapes.cbegin(); anIt != aModifiedShapes.cend(); anIt++) { const TopoDS_Shape& anItShape = (*anIt)->impl(); + if (anItShape.IsSame(aShapeIt.Value())) { + anArgumentIsInResult = true; + continue; + } aTempShapes.Add(anItShape); if(aResultShapesMap.Add(anItShape) == Standard_True) { aResultShapesList.Append(anItShape); } hasResults = true; } - if(hasResults) { + if(hasResults && !anArgumentIsInResult) { const TopoDS_Shape& aTopoDSShape = aShapeIt.Value(); if(aResultShapesMap.Remove(aTopoDSShape) == Standard_True) { for(NCollection_List::Iterator diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp index fb1699226..ce3f7c82e 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.cpp @@ -114,7 +114,7 @@ bool isFirst(const TopoDS_Shape& theFirst, const TopoDS_Shape& theSecond, if (!theAreaToIndex.IsBound(aShape)) { // fill the list of curve indices NCollection_List aNewList; TopExp_Explorer anEdgesExp(aShape, TopAbs_EDGE); - for(; anEdgesExp.More(); anEdgesExp.Next()) { + for (; anEdgesExp.More(); anEdgesExp.Next()) { double aFirst, aLast; Handle(Geom_Curve) aCurve = BRep_Tool::Curve( TopoDS::Edge(anEdgesExp.Current()), aFirst, aLast); @@ -124,24 +124,34 @@ bool isFirst(const TopoDS_Shape& theFirst, const TopoDS_Shape& theSecond, aNewList.Append(theCurveToIndex.Find(aCurve)); } } - NCollection_Array1 aNewArray(1, aNewList.Extent()); - NCollection_List::Iterator aListIter(aNewList); - for(int anIndex = 1; aListIter.More(); aListIter.Next(), anIndex++) { - aNewArray.SetValue(anIndex, aListIter.Value()); + if (aNewList.Extent()) { + NCollection_Array1 aNewArray(1, aNewList.Extent()); + NCollection_List::Iterator aListIter(aNewList); + for (int anIndex = 1; aListIter.More(); aListIter.Next(), anIndex++) { + aNewArray.SetValue(anIndex, aListIter.Value()); + } + std::sort(aNewArray.begin(), aNewArray.end()); + theAreaToIndex.Bind(aShape, aNewArray); } - std::sort(aNewArray.begin(), aNewArray.end()); - theAreaToIndex.Bind(aShape, aNewArray); } } - // compare lists of indices one by one to find chich list indices are lower - NCollection_Array1::Iterator aFirstList(theAreaToIndex.ChangeFind(theFirst)); - NCollection_Array1::Iterator aSecondList(theAreaToIndex.ChangeFind(theSecond)); - for(; aFirstList.More() && aSecondList.More(); aFirstList.Next(), aSecondList.Next()) { - if (aFirstList.Value() < aSecondList.Value()) return true; - if (aFirstList.Value() > aSecondList.Value()) return false; + bool isFirst; + bool aGeomCompare = !theAreaToIndex.IsBound(theFirst) || !theAreaToIndex.IsBound(theSecond); + if (!aGeomCompare) { + // compare lists of indices one by one to find chich list indices are lower + NCollection_Array1::Iterator aFirstList(theAreaToIndex.ChangeFind(theFirst)); + NCollection_Array1::Iterator aSecondList(theAreaToIndex.ChangeFind(theSecond)); + for (; aFirstList.More() && aSecondList.More(); aFirstList.Next(), aSecondList.Next()) { + if (aFirstList.Value() < aSecondList.Value()) return true; + if (aFirstList.Value() > aSecondList.Value()) return false; + } + aGeomCompare = !aFirstList.More() && !aSecondList.More(); + isFirst = !aFirstList.More(); + } else { + isFirst = !theAreaToIndex.IsBound(theFirst); } // if faces are identical by curves names (circle splitted by line in seam-point), use parameters - if (!aFirstList.More() && !aSecondList.More()) { + if (aGeomCompare) { GProp_GProps aGProps; BRepGProp::SurfaceProperties(theFirst, aGProps); gp_Pnt aCentre1 = aGProps.CentreOfMass(); @@ -150,7 +160,7 @@ bool isFirst(const TopoDS_Shape& theFirst, const TopoDS_Shape& theSecond, return aCentre1.X() + aCentre1.Y() + aCentre1.Z() < aCentre2.X() + aCentre2.Y() + aCentre2.Z(); } // if in first list there is no elements left, it is the first - return !aFirstList.More(); + return isFirst; } // sorts faces (in theAreas list) to make persistent order: by initial shapes edges diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp index 290d5bd52..1671f382c 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_UnifySameDomain.cpp @@ -95,13 +95,15 @@ void GeomAlgoAPI_UnifySameDomain::modified(const std::shared_ptr const TopoDS_Shape& aShape = theShape->impl(); const ShapeUpgrade_UnifySameDomain& aUnifyAlgo = this->impl(); - const TopTools_ListOfShape& aMList = aUnifyAlgo.History()->Generated(aShape); - for(TopTools_ListIteratorOfListOfShape aModified(aMList); aModified.More(); aModified.Next()) { - - for(TopExp_Explorer anExp(aModified.Value(), aShape.ShapeType()); anExp.More(); anExp.Next()) { - GeomShapePtr aGeomShape(new GeomAPI_Shape()); - aGeomShape->setImpl(new TopoDS_Shape(anExp.Current())); - theHistory.push_back(aGeomShape); + for (int aIsModified = 0; aIsModified <= 1; aIsModified++) { + const TopTools_ListOfShape& aMList = aIsModified ? + aUnifyAlgo.History()->Modified(aShape) : aUnifyAlgo.History()->Generated(aShape); + for (TopTools_ListIteratorOfListOfShape aModified(aMList); aModified.More(); aModified.Next()) { + for (TopExp_Explorer anExp(aModified.Value(), aShape.ShapeType()); anExp.More(); anExp.Next()) { + GeomShapePtr aGeomShape(new GeomAPI_Shape()); + aGeomShape->setImpl(new TopoDS_Shape(anExp.Current())); + theHistory.push_back(aGeomShape); + } } } } diff --git a/src/Model/Model_BodyBuilder.cpp b/src/Model/Model_BodyBuilder.cpp index 963382601..6155c3923 100755 --- a/src/Model/Model_BodyBuilder.cpp +++ b/src/Model/Model_BodyBuilder.cpp @@ -360,13 +360,19 @@ void Model_BodyBuilder::loadDeletedShapes (GeomAlgoAPI_MakeShape* theMS, TopoDS_Shape aShapeIn = theShapeIn->impl(); TopTools_MapOfShape aView; TopExp_Explorer ShapeExplorer (aShapeIn, (TopAbs_ShapeEnum)theKindOfShape); + GeomShapePtr aResultShape = shape(); for (; ShapeExplorer.More(); ShapeExplorer.Next ()) { const TopoDS_Shape& aRoot = ShapeExplorer.Current (); if (!aView.Add(aRoot)) continue; std::shared_ptr aRShape(new GeomAPI_Shape()); aRShape->setImpl((new TopoDS_Shape(aRoot))); if (theMS->isDeleted (aRShape)) { - builder(theTag)->Delete(aRoot); + if (!aResultShape->isSubShape(aRShape, false)) { + ListOfShape aHist; + theMS->modified(aRShape, aHist); + if (aHist.size() == 0 || (aHist.size() == 1 && aHist.front()->isSame(aRShape))) + builder(theTag)->Delete(aRoot); + } } } } diff --git a/src/PythonAPI/examples/Platine.py b/src/PythonAPI/examples/Platine.py index aad9beb92..25e45babf 100644 --- a/src/PythonAPI/examples/Platine.py +++ b/src/PythonAPI/examples/Platine.py @@ -170,7 +170,7 @@ def body_3(): sketch.setRadius(arc, r) # Binding - bottom_e = sketch.addLine("Boolean_1_1/Modified_Face_8&Boolean_1_1/Modified_Face_5") + bottom_e = sketch.addLine("Boolean_1_1/Modified_Face_7&Extrusion_2_1/To_Face_1") sketch.setCoincident(bottom_e, bottom.startPoint()) sketch.setCoincident(bottom_e.startPoint(), bottom.endPoint()) @@ -192,11 +192,11 @@ def body_4(): left, diagonal, bottom = model.addPolygon(sketch, *geom_points) # Binding - bottom_e = sketch.addLine("Boolean_2_1/Modified_Face_3&Boolean_2_1/Modified_Face_4") + bottom_e = sketch.addLine("Boolean_2_1/Modified_Face_2&Boolean_2_1/Modified_Face_4") sketch.setCoincident(bottom_e.endPoint(), bottom.startPoint()) sketch.setCoincident(bottom_e.startPoint(), left.startPoint()) - left_e = sketch.addLine("Boolean_2_1/Modified_Face_6&Boolean_2_1/Modified_Face_7") + left_e = sketch.addLine("Boolean_2_1/Modified_Face_5&Extrusion_3_1/Generated_Face_2") sketch.setCoincident(left_e.startPoint(), left.endPoint()) model.do() #!!! diff --git a/test.API/SHAPER/Transformations/TestTranslation_2.py b/test.API/SHAPER/Transformations/TestTranslation_2.py index 0f3e3e9e2..a78c57eb1 100644 --- a/test.API/SHAPER/Transformations/TestTranslation_2.py +++ b/test.API/SHAPER/Transformations/TestTranslation_2.py @@ -289,12 +289,13 @@ model.testNbSubShapes(Translation_42, GeomAPI_Shape.FACE, [18]) model.testHaveNamingFaces(Translation_42, model, Part_1_doc) # Translation 43 -model.testNbResults(Translation_43, 1) -model.testNbSubResults(Translation_43, [3]) -model.testNbSubShapes(Translation_43, GeomAPI_Shape.COMPSOLID, [1]) -model.testNbSubShapes(Translation_43, GeomAPI_Shape.SOLID, [3]) -model.testNbSubShapes(Translation_43, GeomAPI_Shape.FACE, [18]) -model.testHaveNamingFaces(Translation_43, model, Part_1_doc) +# It is concealed by Partition_9 +#model.testNbResults(Translation_43, 1) +#model.testNbSubResults(Translation_43, [3]) +#model.testNbSubShapes(Translation_43, GeomAPI_Shape.COMPSOLID, [1]) +#model.testNbSubShapes(Translation_43, GeomAPI_Shape.SOLID, [3]) +#model.testNbSubShapes(Translation_43, GeomAPI_Shape.FACE, [18]) +#model.testHaveNamingFaces(Translation_43, model, Part_1_doc) # Translation 44 model.testNbResults(Translation_44, 1) -- 2.39.2