]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Test fixes
authordbv <dbv@opencascade.com>
Fri, 8 Apr 2016 14:41:38 +0000 (17:41 +0300)
committerdbv <dbv@opencascade.com>
Fri, 8 Apr 2016 14:41:50 +0000 (17:41 +0300)
14 files changed:
src/ConstructionPlugin/Test/TestAxisCreation.py
src/FeaturesPlugin/Test/TestCompositeFeaturesOnCompSolids.py
src/FeaturesPlugin/Test/TestExtrusion.py
src/FeaturesPlugin/Test/TestExtrusionCut.py
src/FeaturesPlugin/Test/TestExtrusionFuse.py
src/FeaturesPlugin/Test/TestGroup.py
src/FeaturesPlugin/Test/TestPlacement.py
src/FeaturesPlugin/Test/TestRevolutionCut.py
src/FeaturesPlugin/Test/TestRevolutionFuse.py
src/ModelAPI/Test/Test1064.py
src/PythonAPI/Test/TestFeatures.py
src/PythonAPI/examples/MakeBrick1.py
src/PythonAPI/examples/MakeBrick2.py
src/PythonAPI/examples/Platine.py

index 22040ad599a8bd68813705c14c0a713c205291a5..34039691e7eeabd4403339a8da507f73ae871ffd 100644 (file)
@@ -125,7 +125,7 @@ anAxisFeature = aPart.addFeature("Axis")
 anAxisFeatureData = anAxisFeature.data()
 assert(anAxisFeatureData is not None)
 anAxisFeatureData.string("CreationMethod").setValue("AxisByCylindricalFaceCase")
-anAxisFeatureData.selection("CylindricalFace").selectSubShape("face", "Extrusion_1_1/LateralFace_1")
+anAxisFeatureData.selection("CylindricalFace").selectSubShape("face", "Extrusion_1_1/Generated_Face_1")
 anAxisFeature.execute()
 aSession.finishOperation()
 
index 627423ffd34a861066d73a0fea20dcbfb0f9af97..ba38dd2f2033996dc59fd1627faf5d70cd9585b3 100644 (file)
@@ -113,14 +113,18 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
 aCircleRadius = aSketchCircle.real("CircleRadius")
 anCircleCentr.setValue(0, 0)
 aCircleRadius.setValue(10)
 aSession.finishOperation()
+aSession.finishOperation()
 aSession.startOperation()
+aCircleSketchFeature.execute() # execute for sketch should be called here, because it is not set as current feature, so it is disabled.
+anExtrusionCutFt.selectionList("base").append(aCircleSketchFeature.firstResult(), None)
 anExtrusionCutFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
 anExtrusionCutFt.real("to_size").setValue(0)
 anExtrusionCutFt.real("from_size").setValue(0)
@@ -132,8 +136,7 @@ aFromResult = aFromPlaneFeature.firstResult()
 aFromShape = modelAPI_ResultConstruction(aFromResult).shape()
 anExtrusionCutFt.selection("from_object").setValue(aFromResult, aFromShape)
 anExtrusionCutFt.real("from_offset").setValue(0)
-anExtrusionCutFt.selectionList("boolean_objects").append(modelAPI_ResultCompSolid(anExtrusionResult).subResult(1), None)
-anExtrusionCutFt.execute()
+anExtrusionCutFt.selectionList("main_objects").append(modelAPI_ResultCompSolid(anExtrusionResult).subResult(1), None)
 aSession.finishOperation()
 aSession.finishOperation()
 
@@ -187,14 +190,18 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
 aCircleRadius = aSketchCircle.real("CircleRadius")
 anCircleCentr.setValue(0, 0)
 aCircleRadius.setValue(10)
 aSession.finishOperation()
+aSession.finishOperation()
 aSession.startOperation()
+aCircleSketchFeature.execute() # execute for sketch should be called here, because it is not set as current feature, so it is disabled.
+anRevolutionFuseFt.selectionList("base").append(aCircleSketchFeature.firstResult(), None)
 anRevolutionFuseFt.selection("axis_object").setValue(aLineSketchResult, aLineEdge)
 anRevolutionFuseFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
 anRevolutionFuseFt.real("from_angle").setValue(0) #TODO: remove
@@ -203,8 +210,7 @@ anRevolutionFuseFt.selection("to_object").setValue(aToResult, None)
 anRevolutionFuseFt.real("to_offset").setValue(0)
 anRevolutionFuseFt.selection("from_object").setValue(None, None)
 anRevolutionFuseFt.real("from_offset").setValue(0)
-anRevolutionFuseFt.selectionList("boolean_objects").append(modelAPI_ResultCompSolid(anExtrusionResult).subResult(1), None)
-anRevolutionFuseFt.execute()
+anRevolutionFuseFt.selectionList("main_objects").append(modelAPI_ResultCompSolid(anExtrusionResult).subResult(1), None)
 aSession.finishOperation()
 aSession.finishOperation()
 
@@ -216,4 +222,3 @@ assert (aFactory.validate(anRevolutionFuseFt))
 assert (len(anRevolutionFuseFt.results()) > 0)
 aCurrentResult = modelAPI_ResultBody(anRevolutionFuseFt.firstResult())
 assert (aCurrentResult is not None)
-
index b6122f30a498db5b9f2022b2126d54e838c5081a..da1d1f953323261304a5efe51a583ecce7ad5477 100644 (file)
@@ -1,7 +1,7 @@
 """
       TestExtrusion.py
       Unit test of FeaturesPlugin_Extrusion class
-      
+
       class FeaturesPlugin_Extrusion : public ModelAPI_Feature
         static const std::string MY_EXTRUSION_ID("Extrusion");
         static const std::string LIST_ID("base");
@@ -228,9 +228,9 @@ anExtrusionFt.selectionList("base").append(
 anExtrusionFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
 anExtrusionFt.real("to_size").setValue(0) #TODO: remove
 anExtrusionFt.real("from_size").setValue(0) #TODO: remove
-anExtrusionFt.selection("to_object").selectSubShape("face", "Extrusion_3_1/LateralFace_2")
+anExtrusionFt.selection("to_object").selectSubShape("face", "Extrusion_3_1/Generated_Face_2")
 anExtrusionFt.real("to_offset").setValue(0)
-anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3_1/LateralFace_1")
+anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3_1/Generated_Face_1")
 anExtrusionFt.real("from_offset").setValue(0)
 anExtrusionFt.execute()
 aSession.finishOperation()
index 5a4d6ca53601d03cc64f70f64406efeecc8a5bea..e880babc7ae0175483d4715cdde64d6658fc44ef 100644 (file)
@@ -1,29 +1,3 @@
-"""
-      TestExtrusionCut.py
-      Unit test of FeaturesPlugin_ExtrusionCut class
-      
-      class FeaturesPlugin_ExtrusionCut : public FeaturesPlugin_ExtrusionBoolean
-               static const std::string MY_EXTRUSION_ID("ExtrusionCut");
-        static const std::string MY_SKETCH_OBJECT_ID("sketch");
-        static const std::string METHOD_ATTR("CreationMethod");
-        static const std::string MY_TO_SIZE_ID("to_size");
-        static const std::string MY_FROM_SIZE_ID("from_size");
-        static const std::string MY_TO_OBJECT_ID("to_object");
-        static const std::string MY_TO_OFFSET_ID("to_offset");
-        static const std::string MY_FROM_OBJECT_ID("from_object");
-        static const std::string MY_FROM_OFFSET_ID("from_offset");
-        static const std::string MY_BOOLEAN_OBJECTS_ID("boolean_objects");
-
-        data()->addAttribute(SKETCH_OBJECT_ID(), ModelAPI_AttributeReference::typeId());
-        data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId());
-        data()->addAttribute(TO_SIZE_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(FROM_SIZE_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(TO_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(TO_OFFSET_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(FROM_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(FROM_OFFSET_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(BOOLEAN_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
-"""
 #=========================================================================
 # Initialization of the test
 #=========================================================================
@@ -114,21 +88,24 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
 aCircleRadius = aSketchCircle.real("CircleRadius")
 anCircleCentr.setValue(0, 0)
 aCircleRadius.setValue(10)
 aSession.finishOperation()
+aSession.finishOperation()
 aSession.startOperation()
+aCircleSketchFeature.execute() # execute for sketch should be called here, because it is not set as current feature, so it is disabled.
+anExtrusionCutFt.selectionList("base").append(aCircleSketchFeature.firstResult(), None)
 anExtrusionCutFt.string("CreationMethod").setValue("BySizes")
 anExtrusionCutFt.real("to_size").setValue(10)
 anExtrusionCutFt.real("from_size").setValue(10)
 anExtrusionCutFt.real("to_offset").setValue(0) #TODO: remove
 anExtrusionCutFt.real("from_offset").setValue(0) #TODO: remove
-anExtrusionCutFt.selectionList("boolean_objects").append(anExtrusionResult, anExtrusionResult.shape())
-anExtrusionCutFt.execute()
+anExtrusionCutFt.selectionList("main_objects").append(anExtrusionResult, anExtrusionResult.shape())
 aSession.finishOperation()
 aSession.finishOperation()
 
index a926bb863df6e5c6c323a5e0e617fda318e357a7..5832c3baa7881838e224a7da6512d333703ac009 100644 (file)
@@ -1,29 +1,3 @@
-"""
-      TestExtrusionFuse.py
-      Unit test of FeaturesPlugin_ExtrusionFuse class
-      
-      class FeaturesPlugin_ExtrusionFuse : public FeaturesPlugin_ExtrusionBoolean
-               static const std::string MY_EXTRUSION_ID("ExtrusionFuse");
-        static const std::string MY_SKETCH_OBJECT_ID("sketch");
-        static const std::string METHOD_ATTR("CreationMethod");
-        static const std::string MY_TO_SIZE_ID("to_size");
-        static const std::string MY_FROM_SIZE_ID("from_size");
-        static const std::string MY_TO_OBJECT_ID("to_object");
-        static const std::string MY_TO_OFFSET_ID("to_offset");
-        static const std::string MY_FROM_OBJECT_ID("from_object");
-        static const std::string MY_FROM_OFFSET_ID("from_offset");
-        static const std::string MY_BOOLEAN_OBJECTS_ID("boolean_objects");
-
-        data()->addAttribute(SKETCH_OBJECT_ID(), ModelAPI_AttributeReference::typeId());
-        data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId());
-        data()->addAttribute(TO_SIZE_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(FROM_SIZE_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(TO_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(TO_OFFSET_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(FROM_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(FROM_OFFSET_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(BOOLEAN_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
-"""
 #=========================================================================
 # Initialization of the test
 #=========================================================================
@@ -114,21 +88,24 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
 aCircleRadius = aSketchCircle.real("CircleRadius")
 anCircleCentr.setValue(0, 0)
 aCircleRadius.setValue(10)
 aSession.finishOperation()
+aSession.finishOperation()
 aSession.startOperation()
+aCircleSketchFeature.execute() # execute for sketch should be called here, because it is not set as current feature, so it is disabled.
+anExtrusionFuseFt.selectionList("base").append(aCircleSketchFeature.firstResult(), None)
 anExtrusionFuseFt.string("CreationMethod").setValue("BySizes")
 anExtrusionFuseFt.real("to_size").setValue(10)
 anExtrusionFuseFt.real("from_size").setValue(10)
 anExtrusionFuseFt.real("to_offset").setValue(0) #TODO: remove
 anExtrusionFuseFt.real("from_offset").setValue(0) #TODO: remove
-anExtrusionFuseFt.selectionList("boolean_objects").append(anExtrusionResult, anExtrusionResult.shape())
-anExtrusionFuseFt.execute()
+anExtrusionFuseFt.selectionList("main_objects").append(anExtrusionResult, anExtrusionResult.shape())
 aSession.finishOperation()
 aSession.finishOperation()
 
index 34adc5240ca8e7a211c8899509a3c8144f81fcdf..382c0241661560c7ab17f5abe7f3ff0d935d75f4 100644 (file)
@@ -78,12 +78,12 @@ aSession.startOperation()
 aGroupFeature = aSession.activeDocument().addFeature("Group")
 aSelectionListAttr = aGroupFeature.selectionList("group_list")
 aSelectionListAttr.setSelectionType("vertex")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_3&Extrusion_1_1/LateralFace_1&Extrusion_1_1/ToFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_3&Extrusion_1_1/LateralFace_2&Extrusion_1_1/ToFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_2&Extrusion_1_1/LateralFace_1&Extrusion_1_1/ToFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_3&Extrusion_1_1/LateralFace_1&Extrusion_1_1/FromFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_3&Extrusion_1_1/LateralFace_2&Extrusion_1_1/FromFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_2&Extrusion_1_1/LateralFace_1&Extrusion_1_1/FromFace_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
 aSession.finishOperation()
 #=========================================================================
 # Check results
@@ -98,15 +98,15 @@ aSession.startOperation()
 aGroupFeature = aSession.activeDocument().addFeature("Group")
 aSelectionListAttr = aGroupFeature.selectionList("group_list")
 aSelectionListAttr.setSelectionType("edge")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_2&Extrusion_1_1/LateralFace_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_3&Extrusion_1_1/LateralFace_2")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_3&Extrusion_1_1/LateralFace_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_3&Extrusion_1_1/FromFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_1&Extrusion_1_1/ToFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_1&Extrusion_1_1/FromFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_2&Extrusion_1_1/ToFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_2&Extrusion_1_1/FromFace_1_1")
-aSelectionListAttr.append("Extrusion_1_1/LateralFace_3&Extrusion_1_1/ToFace_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_1&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_1&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_2&Extrusion_1_1/From_Face_1_1")
+aSelectionListAttr.append("Extrusion_1_1/Generated_Face_3&Extrusion_1_1/To_Face_1_1")
 aSession.finishOperation()
 #=========================================================================
 # Check results
@@ -155,7 +155,7 @@ aSession.startOperation()
 aGroupFeature = aSession.activeDocument().addFeature("Group")
 aSelectionListAttr = aGroupFeature.selectionList("group_list")
 aSelectionListAttr.setSelectionType("face")
-aSelectionListAttr.append("Extrusion_1_1/ToFace_1_1")
+aSelectionListAttr.append("Extrusion_1_1/To_Face_1_1")
 aSession.finishOperation()
 #=========================================================================
 # Check results
index 47790a2cbf18b1f7041915657e6792855b325a9a..58e328fa95c3fadd3a42f9a6036bac49ebce5865 100644 (file)
@@ -111,8 +111,8 @@ assert (anExtrusionResult is not None)
 aSession.startOperation()
 aPlacementFt = aPart.addFeature("Placement")
 aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/LateralFace_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("face", "Extrusion_1_2/LateralFace_3")
+aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face_1")
+aPlacementFt.selection("placement_end_shape").selectSubShape("face", "Extrusion_1_2/Generated_Face_3")
 aPlacementFt.boolean("placement_reverse_direction").setValue(False)
 aPlacementFt.boolean("placement_centering").setValue(True)
 aPlacementFt.execute()
@@ -130,8 +130,8 @@ aSession.undo()
 aSession.startOperation()
 aPlacementFt = aPart.addFeature("Placement")
 aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/LateralFace_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("edge", "Extrusion_1_2/ToFace_1_1&Extrusion_1_2/LateralFace_3")
+aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face_1")
+aPlacementFt.selection("placement_end_shape").selectSubShape("edge", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3")
 aPlacementFt.boolean("placement_reverse_direction").setValue(False)
 aPlacementFt.boolean("placement_centering").setValue(True)
 aPlacementFt.execute()
@@ -149,8 +149,8 @@ aSession.undo()
 aSession.startOperation()
 aPlacementFt = aPart.addFeature("Placement")
 aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/LateralFace_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/ToFace_1_1&Extrusion_1_2/LateralFace_3&Extrusion_1_2/LateralFace_2")
+aPlacementFt.selection("placement_start_shape").selectSubShape("face", "Extrusion_1_1/Generated_Face_1")
+aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3&Extrusion_1_2/Generated_Face_2")
 aPlacementFt.boolean("placement_reverse_direction").setValue(False)
 aPlacementFt.boolean("placement_centering").setValue(True)
 aPlacementFt.execute()
@@ -168,8 +168,8 @@ aSession.undo()
 aSession.startOperation()
 aPlacementFt = aPart.addFeature("Placement")
 aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("edge", "Extrusion_1_1/ToFace_1_1&Extrusion_1_1/LateralFace_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("edge", "Extrusion_1_2/ToFace_1_1&Extrusion_1_2/LateralFace_3")
+aPlacementFt.selection("placement_start_shape").selectSubShape("edge", "Extrusion_1_1/To_Face_1_1&Extrusion_1_1/Generated_Face_1")
+aPlacementFt.selection("placement_end_shape").selectSubShape("edge", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3")
 aPlacementFt.boolean("placement_reverse_direction").setValue(False)
 aPlacementFt.boolean("placement_centering").setValue(True)
 aPlacementFt.execute()
@@ -187,8 +187,8 @@ aSession.undo()
 aSession.startOperation()
 aPlacementFt = aPart.addFeature("Placement")
 aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("edge", "Extrusion_1_1/ToFace_1_1&Extrusion_1_1/LateralFace_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/ToFace_1_1&Extrusion_1_2/LateralFace_3&Extrusion_1_2/LateralFace_2")
+aPlacementFt.selection("placement_start_shape").selectSubShape("edge", "Extrusion_1_1/To_Face_1_1&Extrusion_1_1/Generated_Face_1")
+aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3&Extrusion_1_2/Generated_Face_2")
 aPlacementFt.boolean("placement_reverse_direction").setValue(False)
 aPlacementFt.boolean("placement_centering").setValue(True)
 aPlacementFt.execute()
@@ -206,8 +206,8 @@ aSession.undo()
 aSession.startOperation()
 aPlacementFt = aPart.addFeature("Placement")
 aPlacementFt.selectionList("placement_objects_list").append(anExtrusionResult, anExtrusionResult.shape())
-aPlacementFt.selection("placement_start_shape").selectSubShape("vertex", "Extrusion_1_1/LateralFace_4&Extrusion_1_1/FromFace_1_1&Extrusion_1_1/LateralFace_1")
-aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/ToFace_1_1&Extrusion_1_2/LateralFace_3&Extrusion_1_2/LateralFace_2")
+aPlacementFt.selection("placement_start_shape").selectSubShape("vertex", "Extrusion_1_1/Generated_Face_4&Extrusion_1_1/From_Face_1_1&Extrusion_1_1/Generated_Face_1")
+aPlacementFt.selection("placement_end_shape").selectSubShape("vertex", "Extrusion_1_2/To_Face_1_1&Extrusion_1_2/Generated_Face_3&Extrusion_1_2/Generated_Face_2")
 aPlacementFt.boolean("placement_reverse_direction").setValue(False)
 aPlacementFt.boolean("placement_centering").setValue(True)
 aPlacementFt.execute()
index bbbdd2123edf25f8f5139116d34cca812f14a68b..ca8f2b57b57010d2d1eb2f2b65bb350ecdf4080b 100644 (file)
@@ -1,31 +1,3 @@
-"""
-      TestRevolutionCut.py
-      Unit test of FeaturesPlugin_RevolutionCut class
-      
-      class FeaturesPlugin_RevolutionCut : public FeaturesPlugin_RevolutionBoolean
-               static const std::string MY_REVOLUTION_ID("RevolutionCut");
-        static const std::string MY_SKETCH_OBJECT_ID("sketch");
-        static const std::string MY_AXIS_ID("axis_object");
-        static const std::string METHOD_ATTR("CreationMethod");
-        static const std::string MY_TO_ANGLE_ID("to_angle");
-        static const std::string MY_FROM_ANGLE_ID("from_angle");
-        static const std::string MY_TO_OBJECT_ID("to_object");
-        static const std::string MY_TO_OFFSET_ID("to_offset");
-        static const std::string MY_FROM_OBJECT_ID("from_object");
-        static const std::string MY_FROM_OFFSET_ID("from_offset");
-        static const std::string MY_BOOLEAN_OBJECTS_ID("boolean_objects");
-
-        data()->addAttribute(SKETCH_OBJECT_ID(), ModelAPI_AttributeReference::typeId());
-        data()->addAttribute(AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-               data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId());
-        data()->addAttribute(TO_ANGLE_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(FROM_ANGLE_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(TO_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(TO_OFFSET_ID(), ModelAPI_AttributeDouble::typeId());
-        data()->addAttribute(FROM_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(FROM_OFFSET_ID(), ModelAPI_AttributeSelection::typeId());
-        data()->addAttribute(BOOLEAN_OBJECTS_ID(), ModelAPI_AttributeSelectionList::typeId());
-"""
 #=========================================================================
 # Initialization of the test
 #=========================================================================
@@ -142,22 +114,25 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
 aCircleRadius = aSketchCircle.real("CircleRadius")
 anCircleCentr.setValue(0, 0)
 aCircleRadius.setValue(10)
 aSession.finishOperation()
+aSession.finishOperation()
 aSession.startOperation()
+aCircleSketchFeature.execute() # execute for sketch should be called here, because it is not set as current feature, so it is disabled.
+anRevolutionCutFt.selectionList("base").append(aCircleSketchFeature.firstResult(), None)
 anRevolutionCutFt.selection("axis_object").setValue(aLineSketchResult, aLineEdge)
 anRevolutionCutFt.string("CreationMethod").setValue("ByAngles")
 anRevolutionCutFt.real("to_angle").setValue(50)
 anRevolutionCutFt.real("from_angle").setValue(50)
 anRevolutionCutFt.real("to_offset").setValue(0) #TODO: remove
 anRevolutionCutFt.real("from_offset").setValue(0) #TODO: remove
-anRevolutionCutFt.selectionList("boolean_objects").append(anExtrusionResult, anExtrusionResult.shape())
-anRevolutionCutFt.execute()
+anRevolutionCutFt.selectionList("main_objects").append(anExtrusionResult, anExtrusionResult.shape())
 aSession.finishOperation()
 aSession.finishOperation()
 
index 3a9e3e72857a743bed1db0d3e97b51f8bf9b07d4..369c413a0b8accb156e5a4e24730f1c8a20f944c 100644 (file)
@@ -1,7 +1,7 @@
 """
       TestRevolutionFuse.py
       Unit test of FeaturesPlugin_RevolutionFuse class
-      
+
       class FeaturesPlugin_RevolutionFuse : public FeaturesPlugin_RevolutionBoolean
                static const std::string MY_REVOLUTION_ID("RevolutionFuse");
         static const std::string MY_SKETCH_OBJECT_ID("sketch");
@@ -142,22 +142,25 @@ dirx = geomDataAPI_Dir(aCircleSketchFeature.attribute("DirX"))
 dirx.setValue(1, 0, 0)
 norm = geomDataAPI_Dir(aCircleSketchFeature.attribute("Norm"))
 norm.setValue(0, 0, 1)
-aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/TopFace_1")
+aCircleSketchFeature.selection("External").selectSubShape("face", "Extrusion_1/To_Face_1")
+aSession.startOperation()
 aSketchCircle = aCircleSketchFeature.addFeature("SketchCircle")
 anCircleCentr = geomDataAPI_Point2D(aSketchCircle.attribute("CircleCenter"))
 aCircleRadius = aSketchCircle.real("CircleRadius")
 anCircleCentr.setValue(0, 0)
 aCircleRadius.setValue(10)
 aSession.finishOperation()
+aSession.finishOperation()
 aSession.startOperation()
+aCircleSketchFeature.execute() # execute for sketch should be called here, because it is not set as current feature, so it is disabled.
+anRevolutionFuseFt.selectionList("base").append(aCircleSketchFeature.firstResult(), None)
 anRevolutionFuseFt.selection("axis_object").setValue(aLineSketchResult, aLineEdge)
 anRevolutionFuseFt.string("CreationMethod").setValue("ByAngles")
 anRevolutionFuseFt.real("to_angle").setValue(50)
 anRevolutionFuseFt.real("from_angle").setValue(50)
 anRevolutionFuseFt.real("to_offset").setValue(0) #TODO: remove
 anRevolutionFuseFt.real("from_offset").setValue(0) #TODO: remove
-anRevolutionFuseFt.selectionList("boolean_objects").append(anExtrusionResult, anExtrusionResult.shape())
-anRevolutionFuseFt.execute()
+anRevolutionFuseFt.selectionList("main_objects").append(anExtrusionResult, anExtrusionResult.shape())
 aSession.finishOperation()
 aSession.finishOperation()
 
index 2ee908ba80d15f25856594626e4d844c9d1600a2..934a0779c50c9da4a5a56d620f3d2549901004fc 100644 (file)
@@ -1,7 +1,7 @@
 """
       Test1064.py
       Unit test for testing the Part sub-shapes naming, described in the issue 1064
-      
+
 """
 #=========================================================================
 # Initialization of the test
@@ -73,7 +73,7 @@ aSession.setActiveDocument(aPartSet)
 aPlane = aPartSet.addFeature("Plane")
 aPlane.string("CreationMethod").setValue("PlaneByFaceAndDistance")
 aPlane.real("distance").setValue(0)
-aPlane.selection("planeFace").selectSubShape("face", "Part_1/Extrusion_1_1/LateralFace_3")
+aPlane.selection("planeFace").selectSubShape("face", "Part_1/Extrusion_1_1/Generated_Face_3")
 aSession.finishOperation()
 
 #=========================================================================
index e043fe9dade760cea0b8b1080b7994ec9e6381ad..edd7d86b5c135e2bef52875b89cfc9f712089c83 100644 (file)
@@ -55,11 +55,9 @@ class FeaturesTestCase(FeaturesFixture):
         model.features.extrusion.Extrusion(self.part.addFeature("Extrusion"))
         model.features.extrusion_boolean.ExtrusionBoolean(self.part.addFeature("ExtrusionCut"))
         model.features.extrusion_boolean.ExtrusionBoolean(self.part.addFeature("ExtrusionFuse"))
-        model.features.extrusion_sketch.ExtrusionSketch(self.part.addFeature("ExtrusionSketch"))
         model.features.revolution.Revolution(self.part.addFeature("Revolution"))
         model.features.revolution_boolean.RevolutionBoolean(self.part.addFeature("RevolutionCut"))
         model.features.revolution_boolean.RevolutionBoolean(self.part.addFeature("RevolutionFuse"))
-        model.features.revolution_sketch.RevolutionSketch(self.part.addFeature("RevolutionSketch"))
         model.features.placement.Placement(self.part.addFeature("Placement"))
         model.features.rotation.Rotation(self.part.addFeature("Rotation"))
         model.features.translation.Translation(self.part.addFeature("Translation"))
index b698f0a50105571c9f2a4056357f4b1e32103a68..ba828e87fd1b48a89407481a7497651726b36a4a 100644 (file)
@@ -44,11 +44,11 @@ mybox = model.addExtrusion(mypart, mybase.selectFace(), 50)
 
 # Creating a cylinder on a face of the box
 
-thisface = "Extrusion_1_1/LateralFace_2"
-thisxmin = "Extrusion_1_1/LateralFace_3&Extrusion_1_1/LateralFace_2"
-thisxmax = "Extrusion_1_1/LateralFace_2&Extrusion_1_1/LateralFace_1"
+thisface = "Extrusion_1_1/Generated_Face_2"
+thisxmin = "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2"
+thisxmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/Generated_Face_1"
 thiszmin = "Sketch_1/Edge5_1"
-thiszmax = "Extrusion_1_1/LateralFace_2&Extrusion_1_1/ToFace_1_1"
+thiszmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1"
 
 mystand = model.addSketch(mypart, thisface)
 
index 03c07c4eeb7ff410b7601e7699fd5150623bf01d..279509caeab36568086c090696806e01f26a268c 100644 (file)
@@ -43,9 +43,9 @@ mybox = model.addExtrusion(mypart, mybase.selectFace(), 50)
 
 # Creating a cylinder on a face of the box
 
-thisface = "Extrusion_1_1/LateralFace_2"
-thisxmin = "Extrusion_1_1/LateralFace_3&Extrusion_1_1/LateralFace_2"
-thiszmax = "Extrusion_1_1/LateralFace_2&Extrusion_1_1/ToFace_1_1"
+thisface = "Extrusion_1_1/Generated_Face_2"
+thisxmin = "Extrusion_1_1/Generated_Face_3&Extrusion_1_1/Generated_Face_2"
+thiszmax = "Extrusion_1_1/Generated_Face_2&Extrusion_1_1/To_Face_1_1"
 
 mystand = model.addSketch(mypart, thisface)
 circle = mystand.addCircle(0, 25, 5)
index 47d7bf30d5f444f8a39872ef426d4da79608e396..edec616e0560e5028dda4fffb34526cdbd10bb72 100644 (file)
@@ -54,7 +54,7 @@ def vertical_body():
 
 def bottom_body():
     # Create XOY sketch
-    sketch = model.addSketch(part, "Extrusion_1_1/LateralFace_4")
+    sketch = model.addSketch(part, "Extrusion_1_1/Generated_Face_4")
 
     # Create base polygon
     points = [(0, 0), (0, L), (P, L), (P, 16 + 16), (P - 20, 16 + 16), (P - 20, 16), (P, 16), (P, 0)]
@@ -87,7 +87,7 @@ def bottom_body():
     sketch.setCoincident(arc.endPoint(), h1.startPoint())
 
     # Binding
-    left_e = sketch.addLine("Extrusion_1_1/LateralFace_4&Extrusion_1_1/ToFace_1_1")
+    left_e = sketch.addLine("Extrusion_1_1/Generated_Face_4&Extrusion_1_1/To_Face_1_1")
     sketch.setCoincident(left_e.startPoint(), left.endPoint())
     sketch.setCoincident(left_e.endPoint(), left.startPoint())