From 8e1b6aa1930d46fcb341b61886370385fe02e117 Mon Sep 17 00:00:00 2001 From: Artem Zhidkov Date: Sat, 5 Dec 2020 17:20:59 +0300 Subject: [PATCH] Add new method to get the list of rotated/translated entities of MultiRotation/MultiTranslation to keep the compatibility of old scripts. Revert changes in unit tests. Use new methods in models tests. --- src/BuildPlugin/Test/Test19056.py | 2 +- src/FeaturesPlugin/Test/Test2495.py | 4 ++-- src/FeaturesPlugin/Test/Test2724.py | 2 +- src/FiltersPlugin/Test/Test2946.py | 2 +- src/FiltersPlugin/Test/Test3241.py | 2 +- src/ModelAPI/Test/TestBlockRecalculation.py | 2 +- src/SketchAPI/SketchAPI_Rotation.cpp | 19 +++++++++++++++++-- src/SketchAPI/SketchAPI_Rotation.h | 7 ++++++- src/SketchAPI/SketchAPI_Translation.cpp | 19 +++++++++++++++++-- src/SketchAPI/SketchAPI_Translation.h | 7 ++++++- src/SketchPlugin/Test/Test20274_1.py | 2 +- src/SketchPlugin/Test/Test20274_2.py | 2 +- src/SketchPlugin/Test/Test2393.py | 2 +- src/SketchPlugin/Test/Test3240.py | 2 +- test.compatibility/bobine_film_reel.py | 2 +- test.compatibility/ecran.py | 2 +- test.models/bobine_film_reel.py | 2 +- test.models/ecran.py | 2 +- 18 files changed, 61 insertions(+), 21 deletions(-) diff --git a/src/BuildPlugin/Test/Test19056.py b/src/BuildPlugin/Test/Test19056.py index 868a08fe5..6807f3bf3 100644 --- a/src/BuildPlugin/Test/Test19056.py +++ b/src/BuildPlugin/Test/Test19056.py @@ -50,7 +50,7 @@ SketchConstraintCoincidence_5 = Sketch_1.setCoincident(SketchArc_3.startPoint(), SketchConstraintCoincidence_6 = Sketch_1.setCoincident(SketchArc_1.startPoint(), SketchArc_3.startPoint()) SketchMultiRotation_1_objects = [SketchArc_1.results()[1], SketchLine_2.result(), SketchLine_4.result(), SketchArc_2.results()[1]] SketchMultiRotation_1 = Sketch_1.addRotation(SketchMultiRotation_1_objects, SketchAPI_Line(SketchLine_1).startPoint(), 360, "nb", True) -[SketchArc_4, SketchArc_5, SketchArc_6, SketchArc_7, SketchArc_8, SketchArc_9, SketchArc_10, SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchArc_11, SketchArc_12, SketchArc_13, SketchArc_14, SketchArc_15, SketchArc_16, SketchArc_17] = SketchMultiRotation_1.rotated() +[SketchArc_4, SketchArc_5, SketchArc_6, SketchArc_7, SketchArc_8, SketchArc_9, SketchArc_10, SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_4, SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchArc_2, SketchArc_11, SketchArc_12, SketchArc_13, SketchArc_14, SketchArc_15, SketchArc_16, SketchArc_17] = SketchMultiRotation_1.rotated() SketchArc_13.setName("SketchArc_9") SketchArc_13.result().setName("SketchArc_9") SketchArc_13.results()[1].setName("SketchArc_9_2") diff --git a/src/FeaturesPlugin/Test/Test2495.py b/src/FeaturesPlugin/Test/Test2495.py index 0a401813a..7e246a1b3 100644 --- a/src/FeaturesPlugin/Test/Test2495.py +++ b/src/FeaturesPlugin/Test/Test2495.py @@ -124,7 +124,7 @@ SketchConstraintCoincidence_17.setName("SketchConstraintCoincidence_20") SketchConstraintDistance_3 = Sketch_1.setDistance(SketchPoint_5.coordinates(), SketchLine_6.result(), 21, True) SketchMultiTranslation_2_objects = [SketchArc_1.results()[1], SketchLine_7.result(), SketchLine_8.result(), SketchArc_2.results()[1], SketchLine_10.result(), SketchArc_5.results()[1], SketchLine_12.result(), SketchArc_3.results()[1], SketchArc_4.results()[1], SketchLine_13.result(), SketchLine_11.result(), SketchArc_6.results()[1]] SketchMultiTranslation_2 = Sketch_1.addTranslation(SketchMultiTranslation_2_objects, SketchPoint_3.coordinates(), SketchPoint_5.coordinates(), 2) -[SketchArc_7, SketchLine_14, SketchLine_15, SketchArc_8, SketchLine_16, SketchArc_9, SketchLine_17, SketchArc_10, SketchArc_11, SketchLine_18, SketchLine_19, SketchArc_12] = SketchMultiTranslation_2.translated() +[SketchArc_7, SketchLine_14, SketchLine_15, SketchArc_8, SketchLine_10, SketchLine_16, SketchArc_5, SketchArc_9, SketchLine_12, SketchLine_17, SketchArc_3, SketchArc_10, SketchArc_4, SketchArc_11, SketchLine_13, SketchLine_18, SketchLine_11, SketchLine_19, SketchArc_6, SketchArc_12] = SketchMultiTranslation_2.translated() SketchLine_19.setName("SketchLine_20") SketchLine_19.result().setName("SketchLine_20") SketchLine_18.setName("SketchLine_19") @@ -295,7 +295,7 @@ SketchConstraintCoincidence_35.setName("SketchConstraintCoincidence_46") SketchConstraintDistance_7 = Sketch_1.setDistance(SketchPoint_7.coordinates(), SketchLine_6.result(), 5.3, True) SketchMultiTranslation_4_objects = [SketchLine_20.result(), SketchArc_21.results()[1], SketchLine_22.result(), SketchArc_16.results()[1], SketchLine_41.result(), SketchLine_37.result(), SketchLine_38.result(), SketchArc_33.results()[1], SketchLine_43.result(), SketchLine_24.result(), SketchLine_42.result(), SketchArc_13.results()[1], SketchArc_31.results()[1], SketchLine_36.result(), SketchLine_28.result(), SketchArc_19.results()[1], SketchLine_21.result(), SketchArc_36.results()[1], SketchArc_14.results()[1], SketchArc_24.results()[1], SketchLine_31.result(), SketchArc_32.results()[1], SketchArc_20.results()[1], SketchLine_27.result(), SketchLine_34.result(), SketchArc_30.results()[1], SketchLine_39.result(), SketchArc_25.results()[1], SketchArc_34.results()[1], SketchArc_18.results()[1], SketchLine_40.result(), SketchLine_35.result(), SketchArc_35.results()[1], SketchArc_28.results()[1], SketchLine_32.result(), SketchArc_22.results()[1], SketchArc_26.results()[1], SketchLine_26.result(), SketchLine_30.result(), SketchArc_15.results()[1], SketchLine_33.result(), SketchLine_29.result(), SketchLine_23.result(), SketchLine_25.result(), SketchArc_29.results()[1], SketchArc_23.results()[1], SketchArc_27.results()[1], SketchArc_17.results()[1]] SketchMultiTranslation_4 = Sketch_1.addTranslation(SketchMultiTranslation_4_objects, SketchArc_15.center(), SketchPoint_7.coordinates(), 2) -[SketchLine_44, SketchArc_37, SketchLine_45, SketchArc_38, SketchLine_46, SketchLine_47, SketchLine_48, SketchArc_39, SketchLine_49, SketchLine_50, SketchLine_51, SketchArc_40, SketchArc_41, SketchLine_52, SketchLine_53, SketchArc_42, SketchLine_54, SketchArc_43, SketchArc_44, SketchArc_45, SketchLine_55, SketchArc_46, SketchArc_47, SketchLine_56, SketchLine_57, SketchArc_48, SketchLine_58, SketchArc_49, SketchArc_50, SketchArc_51, SketchLine_59, SketchLine_60, SketchArc_52, SketchArc_53, SketchLine_61, SketchArc_54, SketchArc_55, SketchLine_62, SketchLine_63, SketchArc_56, SketchLine_64, SketchLine_65, SketchLine_66, SketchLine_67, SketchArc_57, SketchArc_58, SketchArc_59, SketchArc_60] = SketchMultiTranslation_4.translated() +[SketchLine_44, SketchArc_21, SketchArc_37, SketchLine_45, SketchArc_38, SketchLine_41, SketchLine_46, SketchLine_37, SketchLine_47, SketchLine_38, SketchLine_48, SketchArc_33, SketchArc_39, SketchLine_43, SketchLine_49, SketchLine_24, SketchLine_50, SketchLine_42, SketchLine_51, SketchArc_40, SketchArc_31, SketchArc_41, SketchLine_36, SketchLine_52, SketchLine_28, SketchLine_53, SketchArc_19, SketchArc_42, SketchLine_54, SketchArc_36, SketchArc_43, SketchArc_44, SketchArc_24, SketchArc_45, SketchLine_31, SketchLine_55, SketchArc_32, SketchArc_46, SketchArc_20, SketchArc_47, SketchLine_27, SketchLine_56, SketchLine_34, SketchLine_57, SketchArc_30, SketchArc_48, SketchLine_39, SketchLine_58, SketchArc_25, SketchArc_49, SketchArc_34, SketchArc_50, SketchArc_18, SketchArc_51, SketchLine_40, SketchLine_59, SketchLine_35, SketchLine_60, SketchArc_35, SketchArc_52, SketchArc_28, SketchArc_53, SketchLine_32, SketchLine_61, SketchArc_22, SketchArc_54, SketchArc_26, SketchArc_55, SketchLine_26, SketchLine_62, SketchLine_30, SketchLine_63, SketchArc_56, SketchLine_33, SketchLine_64, SketchLine_29, SketchLine_65, SketchLine_66, SketchLine_25, SketchLine_67, SketchArc_29, SketchArc_57, SketchArc_23, SketchArc_58, SketchArc_27, SketchArc_59, SketchArc_17, SketchArc_60] = SketchMultiTranslation_4.translated() SketchLine_67.setName("SketchLine_68") SketchLine_67.result().setName("SketchLine_68") SketchLine_66.setName("SketchLine_67") diff --git a/src/FeaturesPlugin/Test/Test2724.py b/src/FeaturesPlugin/Test/Test2724.py index ec0fb61ed..40a0dc7bf 100644 --- a/src/FeaturesPlugin/Test/Test2724.py +++ b/src/FeaturesPlugin/Test/Test2724.py @@ -49,7 +49,7 @@ SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_3.result(), SketchConst [SketchLine_5, SketchLine_6, SketchLine_7] = SketchConstraintMirror_1.mirrored() SketchMultiTranslation_1_objects = [SketchLine_1.result(), SketchLine_4.result(), SketchLine_3.result(), SketchLine_5.result(), SketchLine_6.result()] SketchMultiTranslation_1 = Sketch_1.addTranslation(SketchMultiTranslation_1_objects, SketchLine_2.endPoint(), SketchLine_4.startPoint(), 4) -[SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19, SketchLine_20, SketchLine_21, SketchLine_22] = SketchMultiTranslation_1.translated() +[SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_5, SketchLine_17, SketchLine_18, SketchLine_19, SketchLine_6, SketchLine_20, SketchLine_21, SketchLine_22] = SketchMultiTranslation_1.translated() model.do() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() diff --git a/src/FiltersPlugin/Test/Test2946.py b/src/FiltersPlugin/Test/Test2946.py index 401e75ebf..0cb89d013 100644 --- a/src/FiltersPlugin/Test/Test2946.py +++ b/src/FiltersPlugin/Test/Test2946.py @@ -39,7 +39,7 @@ SketchConstraintAngle_1 = Sketch_1.setAngle(SketchLine_2.result(), SketchLine_1. SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_2.result(), [SketchLine_1.result()]) [SketchLine_3] = SketchConstraintMirror_1.mirrored() SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_1.result(), SketchLine_3.result()], SketchAPI_Line(SketchLine_2).startPoint(), 360, 4, True) -[SketchLine_4, SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9] = SketchMultiRotation_1.rotated() +[SketchLine_4, SketchLine_5, SketchLine_6, SketchLine_3, SketchLine_7, SketchLine_8, SketchLine_9] = SketchMultiRotation_1.rotated() SketchArc_1 = Sketch_1.addArc(0, 0, 10.35276180410083, 38.63703305156273, -10.35276180410083, 38.63703305156273, False) SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchCircle_1.center(), SketchArc_1.center()) SketchConstraintRadius_3 = Sketch_1.setRadius(SketchArc_1.results()[1], 40) diff --git a/src/FiltersPlugin/Test/Test3241.py b/src/FiltersPlugin/Test/Test3241.py index ad6380c41..ea375c2bb 100644 --- a/src/FiltersPlugin/Test/Test3241.py +++ b/src/FiltersPlugin/Test/Test3241.py @@ -57,7 +57,7 @@ SketchPoint_4 = SketchProjection_4.createdFeature() SketchProjection_5 = Sketch_4.addProjection(model.selection("EDGE", "PartSet/OX"), True) SketchLine_1 = SketchProjection_5.createdFeature() SketchMultiRotation_1 = Sketch_4.addRotation([SketchLine_1.result()], SketchAPI_Point(SketchPoint_4).coordinates(), 360, 12, True) -[SketchLine_2, SketchLine_3, SketchLine_4, SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12] = SketchMultiRotation_1.rotated() +[SketchLine_1, SketchLine_2, SketchLine_3, SketchLine_4, SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12] = SketchMultiRotation_1.rotated() model.do() Edge_1 = model.addEdge(Part_1_doc, [model.selection("COMPOUND", "Sketch_4")], False) Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("COMPOUND", "all-in-Edge_1")], model.selection(), model.selection("FACE", "Plane_2"), 0, model.selection(), 0) diff --git a/src/ModelAPI/Test/TestBlockRecalculation.py b/src/ModelAPI/Test/TestBlockRecalculation.py index fc808f1de..a01f01328 100644 --- a/src/ModelAPI/Test/TestBlockRecalculation.py +++ b/src/ModelAPI/Test/TestBlockRecalculation.py @@ -65,7 +65,7 @@ SketchConstraintMirror_1 = Sketch_1.addMirror(SketchLine_6.result(), SketchConst [SketchLine_7, SketchArc_2, SketchLine_8, SketchLine_9, SketchLine_10] = SketchConstraintMirror_1.mirrored() SketchMultiRotation_1_objects = [SketchLine_10.result(), SketchLine_9.result(), SketchLine_8.result(), SketchArc_2.results()[1], SketchLine_7.result(), SketchLine_1.result(), SketchArc_1.results()[1], SketchLine_2.result(), SketchLine_3.result(), SketchLine_4.result()] SketchMultiRotation_1 = Sketch_1.addRotation(SketchMultiRotation_1_objects, SketchAPI_Line(SketchLine_6).startPoint(), 360, 4, True) -[SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19, SketchArc_3, SketchArc_4, SketchArc_5, SketchLine_20, SketchLine_21, SketchLine_22, SketchLine_23, SketchLine_24, SketchLine_25, SketchArc_6, SketchArc_7, SketchArc_8, SketchLine_26, SketchLine_27, SketchLine_28, SketchLine_29, SketchLine_30, SketchLine_31, SketchLine_32, SketchLine_33, SketchLine_34] = SketchMultiRotation_1.rotated() +[SketchLine_10, SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_9, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_8, SketchLine_17, SketchLine_18, SketchLine_19, SketchArc_2, SketchArc_3, SketchArc_4, SketchArc_5, SketchLine_7, SketchLine_20, SketchLine_21, SketchLine_22, SketchLine_23, SketchLine_24, SketchLine_25, SketchArc_6, SketchArc_7, SketchArc_8, SketchLine_26, SketchLine_27, SketchLine_28, SketchLine_29, SketchLine_30, SketchLine_31, SketchLine_32, SketchLine_33, SketchLine_34] = SketchMultiRotation_1.rotated() model.do() Part_1 = model.addPart(partSet) Part_1_doc = Part_1.document() diff --git a/src/SketchAPI/SketchAPI_Rotation.cpp b/src/SketchAPI/SketchAPI_Rotation.cpp index 7b5ec3831..4a83244ce 100644 --- a/src/SketchAPI/SketchAPI_Rotation.cpp +++ b/src/SketchAPI/SketchAPI_Rotation.cpp @@ -66,6 +66,21 @@ void SketchAPI_Rotation::setRotationList( } std::list > SketchAPI_Rotation::rotated() const +{ + std::list aList = rotatedObjects()->list(); + // remove all initial features + std::list anIntermediate; + std::list::const_iterator anIt = aList.begin(); + for (; anIt != aList.end(); ++anIt) { + FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt); + AttributeBooleanPtr isCopy = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID()); + if (isCopy.get() && isCopy->value()) + anIntermediate.push_back(aFeature); + } + return SketchAPI_SketchEntity::wrap(anIntermediate); +} + +std::list > SketchAPI_Rotation::rotatedList() const { std::list aList = rotationList()->list(); std::set anOriginalObjects; @@ -137,7 +152,7 @@ void SketchAPI_Rotation::dump(ModelHighAPI_Dumper& theDumper) const // Dump variables for a list of rotated features theDumper << "["; - std::list > aList = rotated(); + std::list > aList = rotatedList(); std::list >::const_iterator anIt = aList.begin(); for (size_t anIndex = 0; anIndex < aFirstNotDumped; ++anIndex) for (int i = 1; i < aNbCopies->value() && anIt != aList.end(); ++i, ++anIt) { @@ -145,7 +160,7 @@ void SketchAPI_Rotation::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", "; theDumper << (*anIt)->feature(); } - theDumper << "] = " << theDumper.name(aBase) << ".rotated()" << std::endl; + theDumper << "] = " << theDumper.name(aBase) << ".rotatedList()" << std::endl; if (theDumper.isDumped(aRotObjects)) { aNbDumpedArguments.erase(aBase); diff --git a/src/SketchAPI/SketchAPI_Rotation.h b/src/SketchAPI/SketchAPI_Rotation.h index e9899d001..beff1d64d 100644 --- a/src/SketchAPI/SketchAPI_Rotation.h +++ b/src/SketchAPI/SketchAPI_Rotation.h @@ -82,10 +82,15 @@ public: SKETCHAPI_EXPORT void setRotationList(const std::list >& theObjects); - /// List of rotated objects + /// List of rotated objects. + /// [DEPRECATED]: use rotatedList() instead. SKETCHAPI_EXPORT std::list > rotated() const; + /// List of rotated objects. + SKETCHAPI_EXPORT + std::list > rotatedList() const; + /// Dump wrapped feature virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; diff --git a/src/SketchAPI/SketchAPI_Translation.cpp b/src/SketchAPI/SketchAPI_Translation.cpp index ff32e3fa2..60b88fbf6 100644 --- a/src/SketchAPI/SketchAPI_Translation.cpp +++ b/src/SketchAPI/SketchAPI_Translation.cpp @@ -63,6 +63,21 @@ void SketchAPI_Translation::setTranslationList( } std::list > SketchAPI_Translation::translated() const +{ + std::list aList = translatedObjects()->list(); + // remove all initial features + std::list anIntermediate; + std::list::const_iterator anIt = aList.begin(); + for (; anIt != aList.end(); ++anIt) { + FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt); + AttributeBooleanPtr isCopy = aFeature->boolean(SketchPlugin_SketchEntity::COPY_ID()); + if (isCopy.get() && isCopy->value()) + anIntermediate.push_back(aFeature); + } + return SketchAPI_SketchEntity::wrap(anIntermediate); +} + +std::list > SketchAPI_Translation::translatedList() const { std::list aList = translationList()->list(); std::set anOriginalObjects; @@ -129,7 +144,7 @@ void SketchAPI_Translation::dump(ModelHighAPI_Dumper& theDumper) const // Dump variables for a list of translated features theDumper << "["; - std::list > aList = translated(); + std::list > aList = translatedList(); std::list >::const_iterator anIt = aList.begin(); for (size_t anIndex = 0; anIndex < aFirstNotDumped; ++anIndex) for (int i = 1; i < aNbCopies->value() && anIt != aList.end(); ++i, ++anIt) { @@ -137,7 +152,7 @@ void SketchAPI_Translation::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", "; theDumper << (*anIt)->feature(); } - theDumper << "] = " << theDumper.name(aBase) << ".translated()" << std::endl; + theDumper << "] = " << theDumper.name(aBase) << ".translatedList()" << std::endl; if (theDumper.isDumped(aTransObjects)) { aNbDumpedArguments.erase(aBase); diff --git a/src/SketchAPI/SketchAPI_Translation.h b/src/SketchAPI/SketchAPI_Translation.h index 32119218e..d0ed7840f 100644 --- a/src/SketchAPI/SketchAPI_Translation.h +++ b/src/SketchAPI/SketchAPI_Translation.h @@ -78,10 +78,15 @@ public: SKETCHAPI_EXPORT void setTranslationList(const std::list >& theObjects); - /// List of translated objects + /// List of translated objects. + /// [DEPRECATED]: use translatedList() instead. SKETCHAPI_EXPORT std::list > translated() const; + /// List of translated objects. + SKETCHAPI_EXPORT + std::list > translatedList() const; + /// Dump wrapped feature virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; diff --git a/src/SketchPlugin/Test/Test20274_1.py b/src/SketchPlugin/Test/Test20274_1.py index 353241aa7..e083254cd 100644 --- a/src/SketchPlugin/Test/Test20274_1.py +++ b/src/SketchPlugin/Test/Test20274_1.py @@ -70,7 +70,7 @@ Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_5.result()) ### Create SketchMultiRotation SketchMultiRotation_1_objects = [SketchLine_1.result(), SketchLine_3.result(), SketchLine_5.result()] SketchMultiRotation_1 = Sketch_1.addRotation(SketchMultiRotation_1_objects, SketchCircle_1.center(), 360, 4, True) -[SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_14] = SketchMultiRotation_1.rotated() +[SketchLine_6, SketchLine_7, SketchLine_8, SketchLine_9, SketchLine_10, SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_14] = SketchMultiRotation_1.rotatedList() model.do() ### Create Extrusion diff --git a/src/SketchPlugin/Test/Test20274_2.py b/src/SketchPlugin/Test/Test20274_2.py index e239d3b76..b67809398 100644 --- a/src/SketchPlugin/Test/Test20274_2.py +++ b/src/SketchPlugin/Test/Test20274_2.py @@ -70,7 +70,7 @@ Sketch_1.setCoincident(SketchCircle_1.center(), SketchLine_5.result()) ### Create SketchMultiTranslation SketchMultiTranslation_1_objects = [SketchLine_1.result(), SketchLine_3.result(), SketchLine_5.result()] SketchMultiTranslation_1 = Sketch_1.addTranslation(SketchMultiTranslation_1_objects, SketchAPI_Line(SketchLine_4).startPoint(), SketchLine_5.endPoint(), 2) -[SketchLine_7, SketchLine_8, SketchLine_9] = SketchMultiTranslation_1.translated() +[SketchLine_7, SketchLine_8, SketchLine_9] = SketchMultiTranslation_1.translatedList() model.do() ### Create Extrusion diff --git a/src/SketchPlugin/Test/Test2393.py b/src/SketchPlugin/Test/Test2393.py index df93682c8..804c68428 100644 --- a/src/SketchPlugin/Test/Test2393.py +++ b/src/SketchPlugin/Test/Test2393.py @@ -40,7 +40,7 @@ SketchPoint_1 = SketchProjection_1.createdFeature() SketchProjection_2 = Sketch_1.addProjection(model.selection("EDGE", "[Box_1_1/Front][Box_1_1/Top]"), True) SketchLine_1 = SketchProjection_2.createdFeature() SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_1.result()], SketchAPI_Point(SketchPoint_1).coordinates(), 90, 3) -[SketchLine_2, SketchLine_3] = SketchMultiRotation_1.rotated() +[SketchLine_1, SketchLine_2, SketchLine_3] = SketchMultiRotation_1.rotated() model.do() model.checkSketch(Sketch_1, 0) diff --git a/src/SketchPlugin/Test/Test3240.py b/src/SketchPlugin/Test/Test3240.py index 3380e5643..c6b0a2971 100644 --- a/src/SketchPlugin/Test/Test3240.py +++ b/src/SketchPlugin/Test/Test3240.py @@ -32,7 +32,7 @@ Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY")) SketchProjection_1 = Sketch_1.addProjection(model.selection("EDGE", "OX"), True) SketchLine_1 = SketchProjection_1.createdFeature() SketchMultiRotation_1 = Sketch_1.addRotation([SketchLine_1.result()], SketchAPI_Line(SketchLine_1).startPoint(), 360, NB_COPIES, True) -[SketchLine_2, SketchLine_3, SketchLine_4, SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8] = SketchMultiRotation_1.rotated() +[SketchLine_1, SketchLine_2, SketchLine_3, SketchLine_4, SketchLine_5, SketchLine_6, SketchLine_7, SketchLine_8] = SketchMultiRotation_1.rotated() model.do() model.end() diff --git a/test.compatibility/bobine_film_reel.py b/test.compatibility/bobine_film_reel.py index 78dd04332..2556838cf 100644 --- a/test.compatibility/bobine_film_reel.py +++ b/test.compatibility/bobine_film_reel.py @@ -111,7 +111,7 @@ SketchConstraintDistance_2 = Sketch_8.setDistance(SketchLine_9.startPoint(), Ske SketchConstraintDistance_3 = Sketch_8.setDistance(SketchLine_8.endPoint(), SketchLine_9.startPoint(), 30) SketchMultiRotation_2_objects = [SketchLine_11.result(), SketchLine_10.result(), SketchLine_8.result(), SketchLine_7.result()] SketchMultiRotation_2 = Sketch_8.addRotation(SketchMultiRotation_2_objects, SketchLine_9.startPoint(), 120, 3) -[SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19] = SketchMultiRotation_2.rotated() +[SketchLine_11, SketchLine_12, SketchLine_13, SketchLine_10, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19] = SketchMultiRotation_2.rotated() SketchLine_18.setName("SketchLine_15") SketchLine_18.result().setName("SketchLine_15") SketchLine_17.setName("SketchLine_18") diff --git a/test.compatibility/ecran.py b/test.compatibility/ecran.py index a80f2f637..94209ecb1 100644 --- a/test.compatibility/ecran.py +++ b/test.compatibility/ecran.py @@ -721,7 +721,7 @@ SketchConstraintCoincidence_112.setName("SketchConstraintCoincidence_119") SketchConstraintDistance_16 = Sketch_6.setDistance(SketchPoint_9.coordinates(), SketchLine_81.result(), "10+5.3+5.7") SketchMultiTranslation_3_objects = [SketchArc_13.results()[1], SketchArc_34.results()[1], SketchArc_14.results()[1], SketchArc_33.results()[1], SketchArc_12.results()[1], SketchArc_11.results()[1], SketchArc_30.results()[1], SketchArc_29.results()[1], SketchArc_15.results()[1], SketchArc_16.results()[1], SketchArc_26.results()[1], SketchArc_25.results()[1], SketchArc_17.results()[1], SketchArc_18.results()[1], SketchArc_24.results()[1], SketchArc_23.results()[1], SketchArc_20.results()[1], SketchArc_22.results()[1], SketchArc_28.results()[1], SketchArc_27.results()[1], SketchArc_19.results()[1], SketchArc_21.results()[1], SketchArc_32.results()[1], SketchArc_31.results()[1], SketchLine_82.result(), SketchLine_77.result(), SketchLine_97.result(), SketchLine_94.result(), SketchLine_101.result(), SketchLine_99.result(), SketchLine_83.result(), SketchLine_88.result(), SketchLine_89.result(), SketchLine_86.result(), SketchLine_85.result(), SketchLine_100.result(), SketchLine_79.result(), SketchLine_92.result(), SketchLine_87.result(), SketchLine_91.result(), SketchLine_84.result(), SketchLine_96.result(), SketchLine_95.result(), SketchLine_93.result(), SketchLine_78.result(), SketchLine_98.result(), SketchLine_76.result(), SketchLine_90.result()] SketchMultiTranslation_3 = Sketch_6.addTranslation(SketchMultiTranslation_3_objects, SketchPoint_6.coordinates(), SketchPoint_9.coordinates(), 2) -[SketchArc_35, SketchArc_36, SketchArc_37, SketchArc_38, SketchArc_39, SketchArc_40, SketchArc_41, SketchArc_42, SketchArc_43, SketchArc_44, SketchArc_45, SketchArc_46, SketchArc_47, SketchArc_48, SketchArc_49, SketchArc_50, SketchArc_51, SketchArc_52, SketchArc_53, SketchArc_54, SketchArc_55, SketchArc_56, SketchArc_57, SketchArc_58, SketchLine_102, SketchLine_103, SketchLine_104, SketchLine_105, SketchLine_106, SketchLine_107, SketchLine_108, SketchLine_109, SketchLine_110, SketchLine_111, SketchLine_112, SketchLine_113, SketchLine_114, SketchLine_115, SketchLine_116, SketchLine_117, SketchLine_118, SketchLine_119, SketchLine_120, SketchLine_121, SketchLine_122, SketchLine_123, SketchLine_124, SketchLine_125] = SketchMultiTranslation_3.translated() +[SketchArc_35, SketchArc_34, SketchArc_36, SketchArc_37, SketchArc_33, SketchArc_38, SketchArc_39, SketchArc_40, SketchArc_30, SketchArc_41, SketchArc_29, SketchArc_42, SketchArc_15, SketchArc_43, SketchArc_16, SketchArc_44, SketchArc_26, SketchArc_45, SketchArc_25, SketchArc_46, SketchArc_17, SketchArc_47, SketchArc_18, SketchArc_48, SketchArc_24, SketchArc_49, SketchArc_23, SketchArc_50, SketchArc_20, SketchArc_51, SketchArc_22, SketchArc_52, SketchArc_28, SketchArc_53, SketchArc_27, SketchArc_54, SketchArc_19, SketchArc_55, SketchArc_21, SketchArc_56, SketchArc_32, SketchArc_57, SketchArc_31, SketchArc_58, SketchLine_82, SketchLine_102, SketchLine_103, SketchLine_97, SketchLine_104, SketchLine_94, SketchLine_105, SketchLine_101, SketchLine_106, SketchLine_99, SketchLine_107, SketchLine_83, SketchLine_108, SketchLine_88, SketchLine_109, SketchLine_89, SketchLine_110, SketchLine_86, SketchLine_111, SketchLine_85, SketchLine_112, SketchLine_100, SketchLine_113, SketchLine_114, SketchLine_92, SketchLine_115, SketchLine_87, SketchLine_116, SketchLine_91, SketchLine_117, SketchLine_84, SketchLine_118, SketchLine_96, SketchLine_119, SketchLine_95, SketchLine_120, SketchLine_93, SketchLine_121, SketchLine_122, SketchLine_98, SketchLine_123, SketchLine_124, SketchLine_90, SketchLine_125] = SketchMultiTranslation_3.translated() SketchLine_125.setName("SketchLine_130") SketchLine_125.result().setName("SketchLine_130") SketchLine_124.setName("SketchLine_129") diff --git a/test.models/bobine_film_reel.py b/test.models/bobine_film_reel.py index 8d6a66010..766cca10f 100644 --- a/test.models/bobine_film_reel.py +++ b/test.models/bobine_film_reel.py @@ -111,7 +111,7 @@ SketchConstraintDistance_2 = Sketch_8.setDistance(SketchLine_9.startPoint(), Ske SketchConstraintDistance_3 = Sketch_8.setDistance(SketchLine_8.endPoint(), SketchLine_9.startPoint(), 30) SketchMultiRotation_2_objects = [SketchLine_11.result(), SketchLine_10.result(), SketchLine_8.result(), SketchLine_7.result()] SketchMultiRotation_2 = Sketch_8.addRotation(SketchMultiRotation_2_objects, SketchLine_9.startPoint(), 120, 3) -[SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19] = SketchMultiRotation_2.rotated() +[SketchLine_12, SketchLine_13, SketchLine_14, SketchLine_15, SketchLine_16, SketchLine_17, SketchLine_18, SketchLine_19] = SketchMultiRotation_2.rotatedList() SketchLine_18.setName("SketchLine_15") SketchLine_18.result().setName("SketchLine_15") SketchLine_17.setName("SketchLine_18") diff --git a/test.models/ecran.py b/test.models/ecran.py index 0166f9aeb..e97f7d7ec 100644 --- a/test.models/ecran.py +++ b/test.models/ecran.py @@ -721,7 +721,7 @@ SketchConstraintCoincidence_112.setName("SketchConstraintCoincidence_119") SketchConstraintDistance_16 = Sketch_6.setDistance(SketchPoint_9.coordinates(), SketchLine_81.result(), "10+5.3+5.7") SketchMultiTranslation_3_objects = [SketchArc_13.results()[1], SketchArc_34.results()[1], SketchArc_14.results()[1], SketchArc_33.results()[1], SketchArc_12.results()[1], SketchArc_11.results()[1], SketchArc_30.results()[1], SketchArc_29.results()[1], SketchArc_15.results()[1], SketchArc_16.results()[1], SketchArc_26.results()[1], SketchArc_25.results()[1], SketchArc_17.results()[1], SketchArc_18.results()[1], SketchArc_24.results()[1], SketchArc_23.results()[1], SketchArc_20.results()[1], SketchArc_22.results()[1], SketchArc_28.results()[1], SketchArc_27.results()[1], SketchArc_19.results()[1], SketchArc_21.results()[1], SketchArc_32.results()[1], SketchArc_31.results()[1], SketchLine_82.result(), SketchLine_77.result(), SketchLine_97.result(), SketchLine_94.result(), SketchLine_101.result(), SketchLine_99.result(), SketchLine_83.result(), SketchLine_88.result(), SketchLine_89.result(), SketchLine_86.result(), SketchLine_85.result(), SketchLine_100.result(), SketchLine_79.result(), SketchLine_92.result(), SketchLine_87.result(), SketchLine_91.result(), SketchLine_84.result(), SketchLine_96.result(), SketchLine_95.result(), SketchLine_93.result(), SketchLine_78.result(), SketchLine_98.result(), SketchLine_76.result(), SketchLine_90.result()] SketchMultiTranslation_3 = Sketch_6.addTranslation(SketchMultiTranslation_3_objects, SketchPoint_6.coordinates(), SketchPoint_9.coordinates(), 2) -[SketchArc_35, SketchArc_36, SketchArc_37, SketchArc_38, SketchArc_39, SketchArc_40, SketchArc_41, SketchArc_42, SketchArc_43, SketchArc_44, SketchArc_45, SketchArc_46, SketchArc_47, SketchArc_48, SketchArc_49, SketchArc_50, SketchArc_51, SketchArc_52, SketchArc_53, SketchArc_54, SketchArc_55, SketchArc_56, SketchArc_57, SketchArc_58, SketchLine_102, SketchLine_103, SketchLine_104, SketchLine_105, SketchLine_106, SketchLine_107, SketchLine_108, SketchLine_109, SketchLine_110, SketchLine_111, SketchLine_112, SketchLine_113, SketchLine_114, SketchLine_115, SketchLine_116, SketchLine_117, SketchLine_118, SketchLine_119, SketchLine_120, SketchLine_121, SketchLine_122, SketchLine_123, SketchLine_124, SketchLine_125] = SketchMultiTranslation_3.translated() +[SketchArc_35, SketchArc_36, SketchArc_37, SketchArc_38, SketchArc_39, SketchArc_40, SketchArc_41, SketchArc_42, SketchArc_43, SketchArc_44, SketchArc_45, SketchArc_46, SketchArc_47, SketchArc_48, SketchArc_49, SketchArc_50, SketchArc_51, SketchArc_52, SketchArc_53, SketchArc_54, SketchArc_55, SketchArc_56, SketchArc_57, SketchArc_58, SketchLine_102, SketchLine_103, SketchLine_104, SketchLine_105, SketchLine_106, SketchLine_107, SketchLine_108, SketchLine_109, SketchLine_110, SketchLine_111, SketchLine_112, SketchLine_113, SketchLine_114, SketchLine_115, SketchLine_116, SketchLine_117, SketchLine_118, SketchLine_119, SketchLine_120, SketchLine_121, SketchLine_122, SketchLine_123, SketchLine_124, SketchLine_125] = SketchMultiTranslation_3.translatedList() SketchLine_125.setName("SketchLine_130") SketchLine_125.result().setName("SketchLine_130") SketchLine_124.setName("SketchLine_129") -- 2.39.2