Part JoinCutout: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
No edit summary
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
<!--T:19-->
<!--T:19-->
{{Docnav
{{Docnav
|[[Part_JoinEmbed|Embed]]
|[[Part_JoinEmbed|JoinEmbed]]
|[[Part_CompSplittingTools|CompSplittingTools]]
|[[Part_CompSplittingTools|CompSplittingTools]]
|[[Part_Module|Part]]
|[[Part_Module|Part]]
|IconL=Part_JoinEmbed.svg
|IconL=Part_JoinEmbed.svg
|IconC=Workbench_Part.svg
|IconR=Part_CompSplittingTools.png
|IconR=Part_CompSplittingTools.png
|IconC=Workbench_Part.svg
}}
}}


Line 15: Line 15:
|Name=Part JoinCutout
|Name=Part JoinCutout
|MenuLocation=Part → Join → Cutout for Object
|MenuLocation=Part → Join → Cutout for Object
|Workbenches=[[Part Module|Part]]
|Workbenches=[[Part_Module|Part]]
|Version=0.16.5069
|Version=0.16
|SeeAlso=[[Part_JoinConnect|Connect]], [[Part_JoinEmbed|Embed]], [[Part_JoinCutout|Cutout]], [[Part Boolean|Part Boolean]], [[Part Thickness|Part Thickness]]
|SeeAlso=[[Part_JoinConnect|Part JoinConnect]], [[Part_JoinEmbed|Part JoinEmbed]], [[Part_Boolean|Part Boolean]], [[Part_Thickness|Part Thickness]]
}}
}}


Line 23: Line 23:


<!--T:23-->
<!--T:23-->
The [[Image:Part_JoinCutout.svg|24px]] [[Part JoinCutout|Part JoinCutout]] tool creates a cutout in a walled object (e.g., a pipe) to fit another walled object.
The [[Image:Part_JoinCutout.svg|24px]] [[Part_JoinCutout|Part JoinCutout]] tool creates a cutout in a walled object (e.g., a pipe) to fit another walled object.




Line 35: Line 35:
# Select the base object first, then the object to define the cutout. <br /> The order of selection is important. It is enough to select one sub-shape of each object (e.g., faces).
# Select the base object first, then the object to define the cutout. <br /> The order of selection is important. It is enough to select one sub-shape of each object (e.g., faces).
# Invoke the Part JoinCutout command several ways:
# Invoke the Part JoinCutout command several ways:
#* Pressing on the [[Image:Part_JoinCutout.svg|24px|link=Part_JoinCutout]] [[Part JoinCutout]] button in the Part toolbar
#* Pressing on the [[Image:Part_JoinCutout.svg|24px|link=Part_JoinCutout]] [[Part_JoinCutout|Part JoinCutout]] button in the Part toolbar
#* Using the {{MenuCommand|Part → Join → Cutout for Object}} entry in the Part menu
#* Using the {{MenuCommand|Part → Join → Cutout for Object}} entry in the Part menu


<!--T:5-->
<!--T:5-->
A Part JoinFeature object is created, with Mode set to 'Cutout'. Original objects are hidden, and the result of cutting is shown in [[3D view]].
A Part JoinFeature object is created, with Mode set to 'Cutout'. Original objects are hidden, and the result of cutting is shown in [[3D_view|3D view]].


==Properties== <!--T:25-->
==Properties== <!--T:25-->
Line 48: Line 48:
* {{PropertyData|Tool}}: Reference to tool object (the object that is to fit into the cutout). The object can be a single solid, or a [[Part_Compound|valid compound]] of solids.
* {{PropertyData|Tool}}: Reference to tool object (the object that is to fit into the cutout). The object can be a single solid, or a [[Part_Compound|valid compound]] of solids.
* {{PropertyData|Mode}}: The mode of operation, equals 'Cutout' (Changing that will transform the tool into another Part_JoinXXX). The value of 'bypass' can be used to temporarily disable the long computations (a compound of Base and Tool will be created, which is a fast operation).
* {{PropertyData|Mode}}: The mode of operation, equals 'Cutout' (Changing that will transform the tool into another Part_JoinXXX). The value of 'bypass' can be used to temporarily disable the long computations (a compound of Base and Tool will be created, which is a fast operation).
* {{PropertyData|Refine}}: Sets whether to apply [[Part RefineShape|Refine]] operation or not, to the final shape. The default value is determined by a 'Automatically refine shape after boolean operation' checkbox in PartDesign preferences. When Mode property is 'bypass', Refine is ignored (never applied).
* {{PropertyData|Refine}}: Sets whether to apply [[Part_RefineShape|Refine]] operation or not, to the final shape. The default value is determined by a 'Automatically refine shape after boolean operation' checkbox in PartDesign preferences. When Mode property is 'bypass', Refine is ignored (never applied).


==Example== <!--T:26-->
==Example== <!--T:26-->
Line 63: Line 63:


<!--T:9-->
<!--T:9-->
1. Base object is [[Part Cut|boolean-cut]] with Tool object. The resulting shape is a set ([[Part_Compound|compound]]) of non-intersecting solids (typically, two).
1. Base object is [[Part_Cut|boolean-cut]] with Tool object. The resulting shape is a set ([[Part_Compound|compound]]) of non-intersecting solids (typically, two).


<!--T:10-->
<!--T:10-->
Line 69: Line 69:


<!--T:11-->
<!--T:11-->
3. If Refine property is true, the resulting shape is [[Part RefineShape|refined]].
3. If Refine property is true, the resulting shape is [[Part_RefineShape|refined]].
<br /><br />[[image:JoinFeatures-Algo-Cutout.png|800px]]
<br /><br />[[image:JoinFeatures-Algo-Cutout.png|800px]]


Line 75: Line 75:


<!--T:12-->
<!--T:12-->
* If after step 1, the object remains in one piece, the result of Cutout will be equivalent to [[Part Cut|boolean cut]] of Base with Tool.
* If after step 1, the object remains in one piece, the result of Cutout will be equivalent to [[Part_Cut|boolean cut]] of Base with Tool.
* Now, the tool will produce unexpected result, if a compound is supplied as Base. This may be changed in the future.
* Now, the tool will produce unexpected result, if a compound is supplied as Base. This may be changed in the future.
* Because the largest piece is determined by comparing volumes of pieces, the tool can only work with solids. This may be changed in the future.
* Because the largest piece is determined by comparing volumes of pieces, the tool can only work with solids. This may be changed in the future.
Line 102: Line 102:
<!--T:17-->
<!--T:17-->
The tool itself is implemented in Python, see {{FileName|/Mod/Part/JoinFeatures.py}} ([https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Part/JoinFeatures.py Github link]) under where FreeCAD is installed.
The tool itself is implemented in Python, see {{FileName|/Mod/Part/JoinFeatures.py}} ([https://github.com/FreeCAD/FreeCAD/blob/master/src/Mod/Part/JoinFeatures.py Github link]) under where FreeCAD is installed.



<!--T:20-->
<!--T:20-->
{{Docnav
{{Docnav
|[[Part_JoinEmbed|Embed]]
|[[Part_JoinEmbed|JoinEmbed]]
|[[Part_CompSplittingTools|CompSplittingTools]]
|[[Part_CompSplittingTools|CompSplittingTools]]
|[[Part_Module|Part]]
|[[Part_Module|Part]]
|IconL=Part_JoinEmbed.svg
|IconL=Part_JoinEmbed.svg
|IconC=Workbench_Part.svg
|IconR=Part_CompSplittingTools.png
|IconR=Part_CompSplittingTools.png
|IconC=Workbench_Part.svg
}}
}}



Revision as of 18:55, 1 December 2020

Part JoinCutout

Menu location
Part → Join → Cutout for Object
Workbenches
Part
Default shortcut
None
Introduced in version
0.16
See also
Part JoinConnect, Part JoinEmbed, Part Boolean, Part Thickness

Description

The Part JoinCutout tool creates a cutout in a walled object (e.g., a pipe) to fit another walled object.



Usage

  1. Select the base object first, then the object to define the cutout.
    The order of selection is important. It is enough to select one sub-shape of each object (e.g., faces).
  2. Invoke the Part JoinCutout command several ways:
    • Pressing on the Part JoinCutout button in the Part toolbar
    • Using the Part → Join → Cutout for Object entry in the Part menu

A Part JoinFeature object is created, with Mode set to 'Cutout'. Original objects are hidden, and the result of cutting is shown in 3D view.

Properties

Base

  • DataBase: Reference to base object (the one to make the cutout in). The object should be a single solid.
  • DataTool: Reference to tool object (the object that is to fit into the cutout). The object can be a single solid, or a valid compound of solids.
  • DataMode: The mode of operation, equals 'Cutout' (Changing that will transform the tool into another Part_JoinXXX). The value of 'bypass' can be used to temporarily disable the long computations (a compound of Base and Tool will be created, which is a fast operation).
  • DataRefine: Sets whether to apply Refine operation or not, to the final shape. The default value is determined by a 'Automatically refine shape after boolean operation' checkbox in PartDesign preferences. When Mode property is 'bypass', Refine is ignored (never applied).

Example

  1. Create a pipe by applying thickness to a cylinder:
  2. Create another, smaller diameter pipe, and place it so that it pierces the wall of the first pipe:
  3. Select the first pipe, then the second pipe (order of selection is important), and click the 'Cutout for object' option from the Join tools dropdown toolbar button.

Algorithm

The algorithms behind Join tools are quite simple, and understanding them is important to use the tools correctly.

1. Base object is boolean-cut with Tool object. The resulting shape is a set (compound) of non-intersecting solids (typically, two).

2. The resulting compound is filtered: only the largest solid is kept.

3. If Refine property is true, the resulting shape is refined.

Notes

  • If after step 1, the object remains in one piece, the result of Cutout will be equivalent to boolean cut of Base with Tool.
  • Now, the tool will produce unexpected result, if a compound is supplied as Base. This may be changed in the future.
  • Because the largest piece is determined by comparing volumes of pieces, the tool can only work with solids. This may be changed in the future.

Scripting

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

JoinFeatures.makePartJoinFeature(name = 'Cutout', mode = 'Cutout')
  • Creates an empty Cutout feature (or other Join feature, depending on mode passed). The properties Base and Tool must be assigned explicitly, afterwards.
  • Returns the newly created object.

Example:

import JoinFeatures
j = JoinFeatures.makePartJoinFeature(name = 'Cutout', mode = 'Cutout' )
j.Base = FreeCADGui.Selection.getSelection()[0]
j.Tool = FreeCADGui.Selection.getSelection()[1]

The tool itself is implemented in Python, see /Mod/Part/JoinFeatures.py (Github link) under where FreeCAD is installed.