"addPoint", "addAxis", "addPlane",
"addImport", "exportToFile",
"addAddition", "addSubtraction", "addIntersection",
- "addExtrusion", "addExtrusionCut", "addExtrusionFuse", "addExtrusionSketch",
- "addRevolution", "addRevolutionCut", "addRevolutionFuse", "addRevolutionSketch",
+ "addExtrusion",
+ # "addExtrusionCut", "addExtrusionFuse",
+ "addRevolution",
+ # "addRevolutionCut", "addRevolutionFuse",
"addPlacement", "addRotation", "addTranslation",
"addGroup",
"addParameter",
model.features.boolean.Boolean(self.part.addFeature("Boolean"))
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_boolean.ExtrusionBoolean(self.part.addFeature("ExtrusionCut"))
+ # model.features.extrusion_boolean.ExtrusionBoolean(self.part.addFeature("ExtrusionFuse"))
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_boolean.RevolutionBoolean(self.part.addFeature("RevolutionCut"))
+ # model.features.revolution_boolean.RevolutionBoolean(self.part.addFeature("RevolutionFuse"))
model.features.placement.Placement(self.part.addFeature("Placement"))
model.features.rotation.Rotation(self.part.addFeature("Rotation"))
model.features.translation.Translation(self.part.addFeature("Translation"))
+++ /dev/null
-"""ExtrusionSketch Interfaces
-Author: Sergey Pokhodenko
-Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-"""
-
-from .roots import CompositeSketch
-
-
-def addExtrusionSketch(part, *args):
- """Add an ExtrusionSketch feature to the Part.
-
- .. function:: addExtrusionSketch(part, sketch, sketch_selection, to_size, from_size)
-
- Args:
- part (ModelAPI_Document): part document
- sketch (ModelAPI_Object): sketch feature
- sketch_selection (Selection): sketch objects
- to_size (double): upper size of the extrusion
- from_size (double): lower size of the extrusion
-
- .. function:: addExtrusionSketch(part, sketch, sketch_selection, to_object, to_offset, from_object, from_offset)
-
- Args:
- part (ModelAPI_Document): part document
- sketch (ModelAPI_Object): sketch feature
- sketch_selection (Selection): sketch objects
- to_object (Selection): upper plane
- to_offset (double): offset from upper plane
- from_object (Selection): lower plane
- from_offset (double): offset from lower plane
-
- Returns:
- ExtrusionSketch: extrusion sketch object
- """
- assert(args)
- feature = part.addFeature("ExtrusionSketch")
- return ExtrusionSketch(feature, *args)
-
-
-class ExtrusionSketch(CompositeSketch):
- """Interface class for ExtrusionSketch feature.
-
- .. function:: ExtrusionSketch(feature)
-
- Create interface for the feature without initialization.
-
- .. function:: ExtrusionSketch(feature, sketch, sketch_selection, to_size, from_size)
-
- Create interface for the feature and initialize the feature with arguments.
-
- .. function:: ExtrusionSketch(feature, sketch, sketch_selection, to_object, to_offset, from_object, from_offset)
-
- Create interface for the feature and initialize the feature with arguments.
- """
- def __init__(self, feature, *args):
- """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
- CompositeSketch.__init__(self, feature, *args[:2])
- args = args[2:]
-
- self._CreationMethod = self._feature.string("CreationMethod")
- self._to_size = self._feature.data().real("to_size")
- self._from_size = self._feature.data().real("from_size")
- self._to_object = self._feature.data().selection("to_object")
- self._to_offset = self._feature.data().real("to_offset")
- self._from_object = self._feature.data().selection("from_object")
- self._from_offset = self._feature.data().real("from_offset")
-
- assert(self._CreationMethod)
- assert(self._to_size)
- assert(self._from_size)
- assert(self._to_object)
- assert(self._to_offset)
- assert(self._from_object)
- assert(self._from_offset)
-
- if not args:
- return
-
- assert(len(args) in (2, 4))
- if len(args) == 4:
- self.setPlanesAndOffsets(*args)
- elif len(args) == 2:
- self.setSizes(*args)
-
- self.execute()
- pass
-
- def __clear(self):
- self._CreationMethod.setValue("BySizes")
- self._fillAttribute(self._to_size, 0)
- self._fillAttribute(self._from_size, 0)
- self._fillAttribute(self._to_object, None)
- self._fillAttribute(self._to_offset, 0)
- self._fillAttribute(self._from_object, None)
- self._fillAttribute(self._from_offset, 0)
- pass
-
- def setSizes(self, to_size, from_size):
- """Modify the to_size, from_size attributes of the feature.
-
- See __init__.
- """
- self.__clear()
- self._CreationMethod.setValue("BySizes")
- self._fillAttribute(self._to_size, to_size)
- self._fillAttribute(self._from_size, from_size)
- pass
-
- def setPlanesAndOffsets(self, to_object, to_offset,
- from_object, from_offset):
- """Modify planes and offsets attributes of the feature.
-
- See __init__.
- """
- self.__clear()
- self._CreationMethod.setValue("ByPlanesAndOffsets")
- self._fillAttribute(self._to_object, to_object)
- self._fillAttribute(self._to_offset, to_offset)
- self._fillAttribute(self._from_object, from_object)
- self._fillAttribute(self._from_offset, from_offset)
- pass
-
+++ /dev/null
-"""RevolutionSketch Interface
-Author: Sergey Pokhodenko
-Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-"""
-
-from .roots import CompositeSketch
-
-
-def addRevolutionSketch(part, *args):
- """Add a RevolutionSketch feature to the Part.
-
- .. function:: addRevolutionSketch(part, sketch, sketch_selection, axis_object, to_angle, from_angle)
-
- Args:
- part (ModelAPI_Document): part document
- sketch (ModelAPI_Object): sketch feature
- sketch_selection (Selection): sketch objects
- axis_object (Selection): axis object
- to_size (double): upper size of the extrusion
- from_size (double): lower size of the extrusion
-
- .. function:: addRevolutionSketch(part, sketch, sketch_selection, axis_object, to_object, to_offset, from_object, from_offset)
-
- Args:
- part (ModelAPI_Document): part document
- sketch (ModelAPI_Object): sketch feature
- sketch_selection (Selection): sketch objects
- axis_object (Selection): axis object
- to_object (Selection): upper plane
- to_offset (double): offset from upper plane
- from_object (Selection): lower plane
- from_offset (double): offset from lower plane
-
- Returns:
- RevolutionSketch: revolution sketch object
- """
- assert(args)
- feature = part.addFeature("RevolutionSketch")
- return RevolutionSketch(feature, *args)
-
-
-class RevolutionSketch(CompositeSketch):
- """Interface class for RevolutionSketch features.
-
- .. function:: RevolutionSketch(feature)
-
- Create interface for the feature without initialization.
-
- .. function:: RevolutionSketch(feature, sketch, sketch_selection, to_size, from_size)
-
- Create interface for the feature and initialize the feature with arguments.
-
- .. function:: RevolutionSketch(feature, sketch, sketch_selection, to_object, to_offset, from_object, from_offset)
-
- Create interface for the feature and initialize the feature with arguments.
- """
-
- def __init__(self, feature, *args):
- """x.__init__(...) initializes x; see x.__class__.__doc__ for signature"""
- CompositeSketch.__init__(self, feature, *args[:2])
- args = args[2:]
-
- self._axis_object = self._feature.data().selection("axis_object")
- self._CreationMethod = self._feature.string("CreationMethod")
- self._to_angle = self._feature.data().real("to_angle")
- self._from_angle = self._feature.data().real("from_angle")
- self._to_object = self._feature.data().selection("to_object")
- self._to_offset = self._feature.data().real("to_offset")
- self._from_object = self._feature.data().selection("from_object")
- self._from_offset = self._feature.data().real("from_offset")
-
- assert(self._axis_object)
- assert(self._CreationMethod)
- assert(self._to_angle)
- assert(self._from_angle)
- assert(self._to_object)
- assert(self._to_offset)
- assert(self._from_object)
- assert(self._from_offset)
-
- if not args:
- return
-
- assert(len(args) in (3, 5))
- axis_object = args[0]
- args = args[1:]
-
- self.setAxisObject(axis_object)
-
- if len(args) == 4:
- self.setPlanesAndOffsets(*args)
- elif len(args) == 2:
- self.setAngles(*args)
-
- self.execute()
- pass
-
- def __clear(self):
- self._CreationMethod.setValue("ByAngles")
- self._fillAttribute(self._to_angle, 0)
- self._fillAttribute(self._from_angle, 0)
- self._fillAttribute(self._to_object, None)
- self._fillAttribute(self._to_offset, 0)
- self._fillAttribute(self._from_object, None)
- self._fillAttribute(self._from_offset, 0)
- pass
-
- def setAxisObject(self, axis_object):
- """Modify axis_object attribute of the feature.
-
- See __init__.
- """
- self._fillAttribute(self._axis_object, axis_object)
- pass
-
- def setAngles(self, to_angle, from_angle):
- """Modify the to_angle, from_angle attributes of the feature.
-
- See __init__.
- """
- self.__clear()
- self._CreationMethod.setValue("ByAngles")
- self._fillAttribute(self._to_angle, to_angle)
- self._fillAttribute(self._from_angle, from_angle)
- pass
-
- def setPlanesAndOffsets(self, to_object, to_offset,
- from_object, from_offset):
- """Modify planes and offsets attributes of the feature.
-
- See __init__.
- """
- self.__clear()
- self._CreationMethod.setValue("ByPlanesAndOffsets")
- self._fillAttribute(self._to_object, to_object)
- self._fillAttribute(self._to_offset, to_offset)
- self._fillAttribute(self._from_object, from_object)
- self._fillAttribute(self._from_offset, from_offset)
- pass
-