class FeaturesPlugin_Extrusion : public ModelAPI_Feature
static const std::string MY_EXTRUSION_ID("Extrusion");
static const std::string LIST_ID("base");
+ 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");
- data()->addAttribute(FeaturesPlugin_Extrusion::LIST_ID(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(FeaturesPlugin_Extrusion::FROM_SIZE_ID(), ModelAPI_AttributeDouble::typeId());
- data()->addAttribute(FeaturesPlugin_Extrusion::TO_SIZE_ID(), ModelAPI_AttributeDouble::typeId());
- data()->addAttribute(FeaturesPlugin_Extrusion::FROM_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(FeaturesPlugin_Extrusion::TO_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
+ data()->addAttribute(LIST_ID(), ModelAPI_AttributeSelection::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());
"""
#=========================================================================
# Initialization of the test
# selection type FACE=4
anExtrusionFt.selectionList("base").append(
aCircleSketchResult, aCircleSketchFaces[0])
-anExtrusionFt.real("from_size").setValue(0)
+anExtrusionFt.string("CreationMethod").setValue("BySizes")
anExtrusionFt.real("to_size").setValue(50)
+anExtrusionFt.real("from_size").setValue(0)
+anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
anExtrusionFt.execute()
aSession.finishOperation()
assert (anExtrusionFt.real("to_size").value() == 50.0)
# selection type FACE=4
anExtrusionFt.selectionList("base").append(
aCircleSketchResult, aCircleSketchFaces[0])
-aFromResult = aFromPlaneFeature.firstResult()
-aFromShape = modelAPI_ResultConstruction(aFromResult).shape()
-anExtrusionFt.selection("from_object").setValue(aFromResult, aFromShape)
-anExtrusionFt.real("from_size").setValue(10)
+anExtrusionFt.string("CreationMethod").setValue("ByPlanesAndOffsets")
+anExtrusionFt.real("to_size").setValue(0) #TODO: remove
+anExtrusionFt.real("from_size").setValue(0) #TODO: remove
aToResult = aToPlaneFeature.firstResult()
aToShape = modelAPI_ResultConstruction(aToResult).shape()
anExtrusionFt.selection("to_object").setValue(aToResult, aToShape)
-anExtrusionFt.real("to_size").setValue(10)
+anExtrusionFt.real("to_offset").setValue(10)
+aFromResult = aFromPlaneFeature.firstResult()
+aFromShape = modelAPI_ResultConstruction(aFromResult).shape()
+anExtrusionFt.selection("from_object").setValue(aFromResult, aFromShape)
+anExtrusionFt.real("from_offset").setValue(10)
anExtrusionFt.execute()
aSession.finishOperation()
# selection type FACE=4
aClampExtrusionFt.selectionList("base").append(
aClampSketchResult, aClampSketchFaces[0])
-aClampExtrusionFt.real("from_size").setValue(0)
+aClampExtrusionFt.string("CreationMethod").setValue("BySizes")
aClampExtrusionFt.real("to_size").setValue(70)
+aClampExtrusionFt.real("from_size").setValue(0)
+aClampExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+aClampExtrusionFt.real("from_offset").setValue(0) #TODO: remove
aClampExtrusionFt.execute()
aSession.finishOperation()
# selection type FACE=4
anExtrusionFt.selectionList("base").append(
aCircleSketchResult, aCircleSketchFaces[0])
-aClampResult = aClampExtrusionFt.firstResult()
-anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3/LateralFace_1")
-anExtrusionFt.real("from_size").setValue(0)
+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/LateralFace_2")
-anExtrusionFt.real("to_size").setValue(0)
+anExtrusionFt.real("to_offset").setValue(0)
+anExtrusionFt.selection("from_object").selectSubShape("face", "Extrusion_3/LateralFace_1")
+anExtrusionFt.real("from_offset").setValue(0)
anExtrusionFt.execute()
aSession.finishOperation()
anExtrusionFt.selectionList("base").append(
aSketchResult, aSketchFaces[0])
+ anExtrusionFt.string("CreationMethod").setValue("BySizes")
anExtrusionFt.real("from_size").setValue(0)
anExtrusionFt.real("to_size").setValue(10)
+ anExtrusionFt.real("to_offset").setValue(0) #TODO: remove
+ anExtrusionFt.real("from_offset").setValue(0) #TODO: remove
# v1.0.2 from master
# anExtrusionFt.selection("extrusion_face").setValue(
# aSketchResult, aSketchFaces[0])
aBox = aPart.addFeature("Extrusion")
aBox.selectionList("base").append(
aSketchResult, aSketchFaces[0])
+aBox.string("CreationMethod").setValue("BySizes")
aBox.real("from_size").setValue(0)
aBox.real("to_size").setValue(10)
+aBox.real("to_offset").setValue(0) #TODO: remove
+aBox.real("from_offset").setValue(0) #TODO: remove
# v 1.0.2 from master
# aBox.selection("extrusion_face").setValue(
# aSketchResult, aSketchFaces[0])
aBooleanFt.integer("bool_type").setValue(kBooleanTypeCut)
aBooleanFt.execute()
aCurrentResult = modelAPI_ResultBody(aBooleanFt.firstResult())
+ assert (len(aBooleanFt.results()) > 0)
aSession.finishOperation()
#=========================================================================
static const std::string MY_REVOLUTION_ID("Revolution");
static const std::string MY_GROUP_LIST_ID("base");
static const std::string MY_TO_OBJECT_ID("axis_object");
- static const std::string MY_TO_ANGLE_ID("to_angle");
+ 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");
- data()->addAttribute(FeaturesPlugin_Revolution::LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
- data()->addAttribute(FeaturesPlugin_Revolution::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(FeaturesPlugin_Revolution::FROM_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(FeaturesPlugin_Revolution::FROM_ANGLE_ID(), ModelAPI_AttributeDouble::typeId());
- data()->addAttribute(FeaturesPlugin_Revolution::TO_OBJECT_ID(), ModelAPI_AttributeSelection::typeId());
- data()->addAttribute(FeaturesPlugin_Revolution::TO_ANGLE_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(LIST_ID(), ModelAPI_AttributeSelectionList::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_AttributeDouble::typeId());
"""
#=========================================================================
# Initialization of the test
aRevolFt.selectionList("base").append(
aCircleSketchResult, aCircleSketchFaces[0])
aRevolFt.selection("axis_object").setValue(aLineSketchResult, aLineEdge)
+aRevolFt.string("CreationMethod").setValue("ByAngles")
aRevolFt.real("from_angle").setValue(10)
aRevolFt.real("to_angle").setValue(10)
+aRevolFt.real("to_offset").setValue(0) #TODO: remove
+aRevolFt.real("from_offset").setValue(0) #TODO: remove
aRevolFt.execute()
aSession.finishOperation()
assert (aRevolFt.real("from_angle").value() == 10.0)