--- /dev/null
+
+ .. tui_create_extrusion:
+
+Create Extrusion by sizes
+=========================
+
+.. literalinclude:: examples/extrusion.py
+ :linenos:
+ :language: python
+
+:download:`Download this script <examples/extrusion.py>`
+
-.. _featureCommon:
-
Common
======
The feature Common implements a boolean operation for extraction of a common part from a set of selected shapes.
-To perform a boolean opration Common in the active part:
+To perform a boolean operation Common in the active part:
#. select in the Main Menu *Features - > Common* item or
#. click **Common** button in the toolbar
-.. image:: images/common_btn.png
+.. image:: images/bool_common.png
:align: center
.. centered::
**Common** button
-The following property panel will be opened:
-
-.. image:: images/Common.png
- :align: center
+There are 2 options for creation of a Common:
+
+.. image:: images/bool_common_simple.png
+ :align: left
+**Simple** common part between all selected objects.
+
+.. image:: images/bool_common_advanced.png
+ :align: left
+**Advanced** common part for each object between this object and all tools.
+
+
+Simple
+------
+
+.. image:: images/boolean_common_simple_property_panel.png
+ :align: center
.. centered::
- **Common operation**
+ **Simple**
-- **Main Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be common with tool objects.
-- **Tool Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be common with main objects.
+- **Objects** contains a list of objects selected in the Object Browser or in the Viewer.
+ In case if subshape from compsolid/compound was selected then other shapes from this compsolid/compound will be ignored.
- **See preview** button shows a result of the operation.
-**TUI Command**: *model.addCommon(Part_doc, mainObjects, toolObjects)*
+**TUI Command**: *model.addCommon(Part_doc, objects)*
-**Arguments**: Part + list of main objects + list of tool objects.
+**Arguments**: Part + list of objects.
Result
""""""
**Common created**
**See Also** a sample TUI Script of a :ref:`tui_create_common` operation.
+
+Advanced
+--------
+
+.. image:: images/boolean_common_advanced_property_panel.png
+ :align: center
+
+.. centered::
+ **Advanced**
+
+- **Objects** contains a list of objects selected in the Object Browser or in the Viewer.
+ In case if subshape from compsolid/compound was selected then other shapes from this compsolid/compound will be cut from
+ other objects (to avoid self intersection) and added to the result.
+- **Tools** contains a list of objects selected in the Object Browser or in the Viewer, which will be fused with tool objects.
+ In case if subshape from compsolid/compound was selected then other shapes from this compsolid/compound will be ignored.
+- **See preview** button shows a result of the operation.
+
+**TUI Command**: *model.addCommon(Part_doc, objects, tools)*
+
+**Arguments**: Part + list of objects + list of tools.
+
+Result
+""""""
+
+For each selected object result will be produced, which are common part between this object and all tools:
+
+.. image:: images/boolean_common_result.png
+ :align: center
+
+.. centered::
+ **Common created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_common` operation.
The feature Cut implements a boolean operation to cut tool objects from a main objects.
-To perform a boolean opration Cut in the active part:
+To perform a boolean operation Cut in the active part:
#. select in the Main Menu *Features - > Cut* item or
#. click **Cut** button in the toolbar
The following property panel will be opened:
-.. image:: images/Cut.png
+.. image:: images/boolean_cut_property_panel.png
:align: center
.. centered::
**Cut operation**
- **Main Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be cut by tool objects.
-- **Tool Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be cut main objects.
-- **See preview** button shows a result of the operation.
+ Any kind of shape can be selected. Also allows selection of compsolids/compound subshapes.
+ In this case only selected subshapes will be cut, other will stay untoched (as much as possible).
+- **Tool Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be cut main objects.
+ Any kind of shape can be selected. Also allows selection of compsolids/compounds subshapes.
+ Non-selected subshapes from compsolids/compounds will be ignored.
+- **See preview** button shows a result of the operation.
**TUI Command**: *model.addCut(Part_doc, mainObjects, toolObjects)*
Result
""""""
-The Result of the operation will be a shape which is a cut of tool objects from main objects:
+For each selected object will be produced a result shape which is a cut of tool objects from main object:
.. image:: images/CreatedCut.png
- :align: center
+ :align: center
.. centered::
**Cut created**
+In case if subsolid (yellow wireframe) of compsolid was selected:
+
+.. image:: images/boolean_cut_subsolids_arguments.png
+ :align: center
+
+.. centered::
+ **Cut arguments**
+
+then it will be cut in result and not selected subsolids will be added to it:
+
+.. image:: images/boolean_cut_subsolids_result.png
+ :align: center
+
+.. centered::
+ **Cut subsolid result**
+
+
**See Also** a sample TUI Script of a :ref:`tui_create_cut` operation.
--- /dev/null
+# -*- coding: utf-8 -*-
+
+from salome.shaper import model
+
+model.begin()
+partSet = model.moduleDocument()
+Part_1 = model.addPart(partSet)
+Part_1_doc = Part_1.document()
+Sketch_1 = model.addSketch(Part_1_doc, model.standardPlane("XOY"))
+SketchProjection_1 = Sketch_1.addProjection(model.selection("VERTEX", "PartSet/Origin"), False)
+SketchPoint_1 = SketchProjection_1.createdFeature()
+SketchCircle_1 = Sketch_1.addCircle(0, 0, 27.26724996788554)
+SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
+model.do()
+Extrusion_1 = model.addExtrusion(Part_1_doc, [model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f")], model.selection(), 50, 0)
+model.do()
+model.end()
Extrusion
=========
+Extrusion feature extrudes selected objects along their normals or selected axis.
+
+To perform Extrusion in the active part:
+
+#. select in the Main Menu *Features - > Extrusion* item or
+#. click **Extrusion** button in the toolbar
+
+.. image:: images/extrusion_btn.png
+ :align: center
+
+.. centered::
+ **Extrusion** button
+
+The following property panel will be opened:
.. image:: images/StartSketch.png
:align: center
.. centered::
Start sketch
+After selecting one of the options property panel for Extrusion will be opened with two variants:
+
+.. image:: images/extrusion_by_sizes.png
+ :align: left
+**By Sizes** extrudes objects by specifying sizes.
+
+.. image:: images/extrusion_by_bounding_planes.png
+ :align: left
+**By Bounding Planes** extrudes objects by specifying bounding planes and offsets.
+
+
+Simple
+------
.. image:: images/Extrusion1.png
:align: center
.. centered::
Extrusion: definition by sizes
+- **Base objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be extruded.
+- **Axis** if selected then it will be direction of extrusion, otherwise objects normals will be used.
+- **To size** size for extrusion along direction.
+- **From size** size for extrusion in opposite direction.
+
+**TUI Command**: *model.addExtrusion(part, objects, size);*
+
+**Arguments**: Part + list of objects + size.
+
+**TUI Command**: *model.addExtrusion(part, objects, direction, size);*
+
+**Arguments**: Part + list of objects + direction + size.
+
+**TUI Command**: *model.addExtrusion(part, objects, toSize, fromSize);*
+
+**Arguments**: Part + list of objects + to size + from size.
+
+**TUI Command**: *model.addExtrusion(part, objects, direction, toSize, fromSize);*
+
+**Arguments**: Part + list of objects + direction + to size + from size.
+
+Result
+""""""
+
+The Result of the operation will be an extruded shape:
+
+.. image:: images/extrusion_result.png
+ :align: center
+
+.. centered::
+ **Extrusion created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_extrusion` operation.
+
+
+
.. image:: images/Extrusion2.png
:align: center
Fuse
====
-The feature Fuse implements a boolean operation for fision of a set of main objects with a set of tool objects.
+The feature Fuse implements a boolean operation for fusion of a set of main objects with a set of tool objects.
-To perform a boolean opration Fuse in the active part:
+To perform a boolean operation Fuse in the active part:
#. select in the Main Menu *Features - > Fuse* item or
#. click **Fuse** button in the toolbar
.. centered::
**Fuse** button
-The following property panel will be opened:
+There are 2 options for creation of a Fuse:
-.. image:: images/Fuse.png
- :align: center
+.. image:: images/bool_fuse_simple.png
+ :align: left
+**Simple** simply fuses selected objects.
+
+.. image:: images/bool_fuse_advanced.png
+ :align: left
+**Advanced** fuse with additional functionality for subshapes of compsolids/compounds.
+
+
+Simple
+------
+
+.. image:: images/boolean_fuse_simple_property_panel.png
+ :align: center
.. centered::
- **Fuse operation**
+ **Simple**
-- **Main Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be fused with tool objects.
-- **Tool Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will fused with main objects.
+- **Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be fused with tool objects.
+ In case if subshape from compsolid/compound was selected then other shapes from this compsolid/compound will be ignored.
+- **Remove intersection edges** if enabled edges that lie on the same surface will be removed.
- **See preview** button shows a result of the operation.
-**TUI Command**: *model.addFuse(Part_doc, mainObjects, toolObjects)*
+**TUI Command**: *model.addFuse(Part_doc, objects, isRemoveEdges)*
-**Arguments**: Part + list of main objects + list of tool objects.
+**Arguments**: Part + list of objects + remove edges flag (optional).
Result
""""""
-The Result of the operation will be a shape which is a fuse of tool objects with main objects:
+The Result of the operation will be a single shape which is a fuse of selected objects:
.. image:: images/CreatedFuse.png
:align: center
**Fuse created**
**See Also** a sample TUI Script of a :ref:`tui_create_fuse` operation.
+
+Advanced
+--------
+
+.. image:: images/boolean_fuse_advanced_property_panel.png
+ :align: center
+
+.. centered::
+ **Advanced**
+
+- **Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be fused with tool objects.
+ In case if subshape from compsolid/compound was selected then other shapes from this compsolid/compound will be cut from
+ other objects (to avoid self intersection) and added to the result.
+- **Tools** contains a list of objects selected in the Object Browser or in the Viewer, which will be fused with tool objects.
+ In case if subshape from compsolid/compound was selected then other shapes from this compsolid/compound will be ignored.
+- **Remove intersection edges** if enabled edges that lie on the same surface will be removed.
+- **See preview** button shows a result of the operation.
+
+**TUI Command**: *model.addFuse(Part_doc, objects, tools, isRemoveEdges)*
+
+**Arguments**: Part + list of objects + list of tools + remove edges flag (optional).
+
+Result
+""""""
+
+The Result of the operation will be a single shape which is a fuse of selected objects and tools:
+
+.. image:: images/boolean_fuse_result.png
+ :align: center
+
+.. centered::
+ **Fuse created**
+
+**See Also** a sample TUI Script of a :ref:`tui_create_fuse` operation.
The feature Intersection implements a boolean operation for intersection of a set of main objects with a set of tool objects.
-To perform a boolean opration Intersection in the active part:
+To perform a boolean operation Intersection in the active part:
#. select in the Main Menu *Features - > Intersection* item or
#. click **Intersection** button in the toolbar
The following property panel will be opened:
-.. image:: images/Intersection.png
+.. image:: images/intersection_property_panel.png
:align: center
.. centered::
**Intersection operation**
-**Base Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be intersected.
+**Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be intersected.
**TUI Command**: *model.addIntersection(Part_doc, Objects)*
The feature Partition implements a boolean operation for partitioning of a set of selected objects.
-To perform a boolean opration Partition in the active part:
+To perform a boolean operation Partition in the active part:
#. select in the Main Menu *Features - > Partition* item or
#. click **Partition** button in the toolbar
The feature Smash implements a boolean operation for smashing a set of main objects by a set of tool objects.
-To a create boolean opration Smash in the active part:
+To a create boolean operation Smash in the active part:
#. select in the Main Menu *Features - > Smash* item or
#. click **Smash** button in the toolbar
.. centered::
**Smash operation**
-Here it is necessary to select main objects and tool objects.
-
-**Apply** button creates the smash shape.
-
-**Cancel** button cancels operation.
+- **Main Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be smashed by tool objects.
+ In case if subshape from compsolid was selected then other shapes from this compsolid/compound will be cut from
+ other objects (to avoid self intersection) and added to the result.
+- **Tool Objects** contains a list of objects selected in the Object Browser or in the Viewer, which will be smashed into main objects.
+ In case if subshape from compsolid/compound was selected then other shapes from this compsolid/compound will be ignored.
+- **See preview** button shows a result of the operation.
**TUI Command**: *model.addSmash(Part_doc, mainObjects, toolObjects)*