Difference between revisions of "Part SliceApart"

From FreeCAD Documentation
Jump to: navigation, search
(Created page with "<languages/> <translate> {{GuiCommand|Name=Part SliceApart |MenuLocation=Part > Split > Slice Apart |Version=0.18.15506 |Workbenches=Part|SeeAlso=Part Slice...")
 
(Marked this version for translation)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<languages/>
 
<languages/>
 
<translate>
 
<translate>
 +
<!--T:9-->
 +
{{Docnav|[[Part_BooleanFragments|Boolean Fragments]]|[[Part_Slice|Slice]]|[[Part_Module|Part]]|IconL=Part_BooleanFragments.svg|IconC=Workbench_Part.svg|IconR=Part_Slice.svg}}
  
 +
<!--T:1-->
 
{{GuiCommand|Name=Part SliceApart
 
{{GuiCommand|Name=Part SliceApart
|MenuLocation=Part > Split > Slice Apart
+
|MenuLocation=Part Split Slice Apart
 
|Version=0.18.15506
 
|Version=0.18.15506
 
|Workbenches=[[Part Module|Part]]|SeeAlso=[[Part Slice|Part Slice to compound]], [[Part_ExplodeCompound|Part Explode Compound]]
 
|Workbenches=[[Part Module|Part]]|SeeAlso=[[Part Slice|Part Slice to compound]], [[Part_ExplodeCompound|Part Explode Compound]]
 
}}
 
}}
  
==Description==  
+
==Description== <!--T:2-->
 +
 
 +
<!--T:3-->
 
Tool to split shapes by intersection with other shapes. For example, for a box and a plane, two solids are created.
 
Tool to split shapes by intersection with other shapes. For example, for a box and a plane, two solids are created.
 +
</translate>
 +
[[image:Part_Slice_Demo.png|600px]]
 +
<translate>
 +
 +
<!--T:4-->
 +
On the picture above, the pieces were moved apart manually afterwards, to reveal the slicing.
 +
 +
<!--T:5-->
 +
[[Part SliceApart|Slice apart]] is the same as [[Part Slice|Part Slice]] followed by [[Part_ExplodeCompound|Part Explode Compound]]. While "Slice to compound" is fully-parametric, and causes no trouble as the number of pieces changes, "Slice apart" will not update the number of objects as the number of pieces changes.
 +
They both create Slice parametric feature, that puts the sliced pieces into a compound, but "Slice apart" explodes the resulting compound into separate objects.
 +
 +
<!--T:33-->
 +
The output shape occupies the same space as the original. But it is split where it intersects with other shapes. The split pieces are individual pieces.
 +
 +
 +
<!--T:6-->
 +
Please visit [[Part Slice|Part Slice]] page for more info.
 +
 +
===Tree structure of Slice Apart=== <!--T:30-->
 +
The Slice Apart command creates more than only the sliced object. In the following example a cube is sliced by a face.
 +
 +
<!--T:31-->
 +
The slice is created and for each piece of it there is a [[Part CompoundFilter]] created, thus the same slice occurs multiple times below each CompundFilter. All these CompoundFilters are united in a Compound.
 +
 +
<!--T:32-->
 +
[[Image:Part_SliceApartTree.png]]
 +
 +
 +
==Example: making puzzle== <!--T:14-->
 +
See  [[Part Slice|Part Slice]]  Example Steps 1 to 6
 +
 +
 +
==Scripting== <!--T:15-->
 +
 +
<!--T:16-->
 +
The tool can by used in [[macros]] and from the python console by using the following function:
 +
</translate>
 +
'''BOPTools.SplitFeatures.makeSlice(name)'''
 +
<translate>
 +
 +
<!--T:34-->
 +
Set mode to '''split''' for slice apart
 +
 +
<!--T:17-->
 +
* Creates an empty Slice feature. The 'Base' and 'Tools' properties must be assigned explicitly, afterwards.
 +
* Returns the newly created object.
 +
 +
<!--T:18-->
 +
Slice can also be applied to plain shapes, without the need to have a document object, via:
 +
</translate>
 +
'''BOPTools.SplitAPI.slice(base_shape, tool_shapes, mode, tolerance = 0.0)'''
 +
<translate>
 +
<!--T:19-->
 +
This can be useful for making custom Python scripted features.
  
[[image:Part_Slice_Demo.png|600px]]
 
  
(on the picture above, the pieces were moved apart manually afterwards, to reveal the slicing)
+
<!--T:20-->
 +
Example:
 +
</translate>
 +
{{code|code=
 +
import BOPTools.SplitFeatures
 +
j = BOPTools.SplitFeatures.makeSlice(name= 'Slice')
 +
j.Base = FreeCADGui.Selection.getSelection()[0]
 +
j.Tools = FreeCADGui.Selection.getSelection()[1:]
 +
}}
 +
<translate>
  
[[Part SliceApart|Slice apart]] is the same as [[Part Slice]] followed by [[Part_ExplodeCompound|Part Explode Compound]]. While "Slice to compound" is fully-parametric, and causes no trouble as the number of pieces changes, "Slice apart" will not update the number of objects as the number of pieces changes.
+
<!--T:21-->
 +
The tool itself is implemented in Python, see /Mod/Part/BOPTools/SplitFeatures.py under where FreeCAD is installed.
  
Please visit [[Part Slice]] page for more info.
+
==Version== <!--T:7-->
  
==Version==
+
<!--T:8-->
 
Slice Apart was introduced in FreeCAD v0.18.15506. FreeCAD needs to be compiled with OCC 6.9.0 or later; otherwise, the tool is unavailable.
 
Slice Apart was introduced in FreeCAD v0.18.15506. FreeCAD needs to be compiled with OCC 6.9.0 or later; otherwise, the tool is unavailable.
 +
 +
<!--T:10-->
 +
{{Docnav|[[Part_BooleanFragments|Boolean Fragments]]|[[Part_Slice|Slice]]|[[Part_Module|Part]]|IconL=Part_BooleanFragments.svg|IconC=Workbench_Part.svg|IconR=Part_Slice.svg}}
 +
 +
<!--T:11-->
 +
{{Part Tools navi}}
 +
 +
 +
 +
 +
 +
<!--T:12-->
 +
{{Userdocnavi}}
  
 
</translate>
 
</translate>
 
{{clear}}
 
{{clear}}

Latest revision as of 18:19, 12 March 2019

Other languages:
Deutsch • ‎English • ‎français • ‎italiano
Arrow-left.svg Previous: Part BooleanFragments.svg Boolean Fragments
Next: Slice Part Slice.svg Arrow-right.svg

Part SliceApart.svg Part SliceApart

Menu location
Part → Split → Slice Apart
Workbenches
Part
Default shortcut
None
Introduced in version
0.18.15506
See also
Part Slice to compound, Part Explode Compound


Description

Tool to split shapes by intersection with other shapes. For example, for a box and a plane, two solids are created. Part Slice Demo.png

On the picture above, the pieces were moved apart manually afterwards, to reveal the slicing.

Slice apart is the same as Part Slice followed by Part Explode Compound. While "Slice to compound" is fully-parametric, and causes no trouble as the number of pieces changes, "Slice apart" will not update the number of objects as the number of pieces changes. They both create Slice parametric feature, that puts the sliced pieces into a compound, but "Slice apart" explodes the resulting compound into separate objects.

The output shape occupies the same space as the original. But it is split where it intersects with other shapes. The split pieces are individual pieces.


Please visit Part Slice page for more info.

Tree structure of Slice Apart

The Slice Apart command creates more than only the sliced object. In the following example a cube is sliced by a face.

The slice is created and for each piece of it there is a Part CompoundFilter created, thus the same slice occurs multiple times below each CompundFilter. All these CompoundFilters are united in a Compound.

Part SliceApartTree.png


Example: making puzzle

See Part Slice Example Steps 1 to 6


Scripting

The tool can by used in macros and from the python console by using the following function:

BOPTools.SplitFeatures.makeSlice(name)

Set mode to split for slice apart

  • Creates an empty Slice feature. The 'Base' and 'Tools' properties must be assigned explicitly, afterwards.
  • Returns the newly created object.

Slice can also be applied to plain shapes, without the need to have a document object, via:

BOPTools.SplitAPI.slice(base_shape, tool_shapes, mode, tolerance = 0.0)

This can be useful for making custom Python scripted features.


Example:

import BOPTools.SplitFeatures
j = BOPTools.SplitFeatures.makeSlice(name= 'Slice')
j.Base = FreeCADGui.Selection.getSelection()[0]
j.Tools = FreeCADGui.Selection.getSelection()[1:]

The tool itself is implemented in Python, see /Mod/Part/BOPTools/SplitFeatures.py under where FreeCAD is installed.

Version

Slice Apart was introduced in FreeCAD v0.18.15506. FreeCAD needs to be compiled with OCC 6.9.0 or later; otherwise, the tool is unavailable.

Arrow-left.svg Previous: Part BooleanFragments.svg Boolean Fragments
Next: Slice Part Slice.svg Arrow-right.svg