Part JoinEmbed: Difference between revisions

From FreeCAD Documentation
No edit summary
(Corrected Part_Fuse links.)
(34 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<languages/>
<translate>
<translate>
<!--T:22-->
Under construction!!
{{Docnav
|[[Part_JoinConnect|JoinConnect]]
|[[Part_JoinCutout|JoinCutout]]
|[[Part_Module|Part]]
|IconL=Part_JoinConnect.svg
|IconR=Part_JoinCutout.svg
|IconC=Workbench_Part.svg
}}


<!--T:1-->
{{GuiCommand|Name=Part_JoinEmbed|MenuLocation=Part -> Join -> Embed Object|Workbenches=Part}}
{{GuiCommand
|Name=Part JoinEmbed
|MenuLocation=Part → Join → Embed Object
|Workbenches=[[Part_Module|Part]]
|Version=0.16
|SeeAlso=[[Part_JoinConnect|Part JoinConnect]], [[Part_JoinCutout|Part JoinCutout]], [[Part_Boolean|Part Boolean]], [[Part_Thickness|Part Thickness]]
}}


==Description== <!--T:2-->
==Description== <!--T:2-->


<!--T:3-->
Embed tool embeds a walled object (e.g., a pipe) into another walled object.
Embed tool embeds a walled object (e.g., a pipe) into another walled object.
<br><br>
[[image:JoinFeatures_Embed.png]] image
<br><br>
==How to use==


<!--T:4-->
# Select the base object first, then the object to be embedded.
[[image:JoinFeatures_Embed.png|600px]]
# Invoke the Part_JoinEmbed command


==Properties== <!--T:6-->
==Usage== <!--T:5-->

<!--T:6-->
# Select the base object first, then the object to be embedded. The order of selection is important. It is enough to select one sub-shape of each object (e.g., faces).
# Invoke the Part JoinEmbed command.

<!--T:7-->
A Part JoinFeature object is created, with Mode set to 'Embed'. Original objects are hidden, and the result of embedding is shown in 3D view.

==Properties== <!--T:8-->
{{TitleProperty|Base}}
{{TitleProperty|Base}}
* {{PropertyData|Base}}: Reference to base object (the one the other object is to be embedded into)
* {{PropertyData|Base}}: Reference to base object (the one the other object is to be embedded into). The object should be a single solid.
* {{PropertyData|Tool}}: Reference to tool object (the object to be embedded)
* {{PropertyData|Tool}}: Reference to tool object (the object to be embedded). The object can be a single solid, or a [[Part_Compound|valid compound]] of solids.
* {{PropertyData|Mode}}: The mode of operation, equals 'Embed' (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 'Embed' (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. When {{PropertyData|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==
==Example== <!--T:9-->
# Create a pipe by applying [[Part_Thickness|thickness]] to a [[Part_Cylinder|cylinder]]:[[image:JoinFeatures_Example_step1.png]]
# Create a pipe by applying [[Part_Thickness|thickness]] to a [[Part_Cylinder|cylinder]]:<br />[[Image:JoinFeatures_Example_step1.png|320px]]
# Create another, smaller diameter pipe, and [[Placement|place]] it so that it pierces the wall of the first pipe:[[image:JoinFeatures_Example_step2.png]]
# Create another, smaller diameter pipe, and [[Placement|place]] it so that it pierces the wall of the first pipe:<br />[[image:JoinFeatures_Example_step2.png|320px]]
# Select the first pipe, then the second pipe (order of selection is important), and click the 'Embed object' option from the Join tools dropdown toolbar button.[[image:JoinFeatures_Example_step3_Embed.png]]
# Select the first pipe, then the second pipe (order of selection is important), and click the 'Embed object' option from the Join tools dropdown toolbar button. <br />[[image:JoinFeatures_Example_step3_Embed.png|320px]]
# Use some cross-section tool ([[Std_ClippingPlane|Clipping plane]], [[Arch_SectionPlane|Arch Section Plane]], [[Arch_CutPlane|Arch Cut Plane]]) to reveal internals. [[image:JoinFeatures_Example_step4_Embed.png]]
# Use some cross-section tool ([[Std_ToggleClipPlane|Clipping plane]], [[Arch_SectionPlane|Arch Section Plane]], [[Arch_CutPlane|Arch Cut Plane]]) to reveal internals. On the picture below, Arch Section Plane is used.<br />[[image:JoinFeatures_Example_step4_Embed.png|320px]]


==Algorithm==
==Algorithm== <!--T:10-->
The algorithm behind Join tools is quite simple, and understanding it is important to use it correctly.
The algorithms behind Join tools are quite simple, and understanding them is important to use the tools correctly.


<!--T:11-->
1. Base object is [[Part Cut|boolean-cut]] with Tool object.
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).

The resulting shape is a set ([[Part MakeCompound|compound]]) of non-intersecting solids (typically, two).


<!--T:12-->
2. The resulting compound is filtered: only the largest solid is kept.
2. The resulting compound is filtered: only the largest solid is kept.


<!--T:13-->
3. That largest solid is [[Part Fuse|boolean-fused]] with Tool object.
3. That largest solid is [[Part_Fuse|boolean-fused]] with Tool object.


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


===Notes=== <!--T:15-->
==Scripting==
* If after step 1, the object remains in one piece, the result of Embed will be equivalent to [[Part_Fuse|union]] of Base and Tool, but taking longer to compute.
* 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== <!--T:16-->

<!--T:17-->
The Join tools can by used in [[macros]] and from the python console by using the following function:
The Join tools can by used in [[macros]] and from the python console by using the following function:
</translate>
</translate>
'''JoinFeatures.makePartJoinFeature(name = 'Embed', mode = 'Embed')'''
{{Code|code=JoinFeatures.makePartJoinFeature(name = 'Embed', mode = 'Embed')}}
<translate>
<translate>
<!--T:18-->
* Creates an empty Embed feature (or other Join feature, depending on mode passed). The properties Base and Tool must be assigned explicitly, afterwards.
* Creates an empty Embed feature (or other Join feature, depending on mode passed). The properties Base and Tool must be assigned explicitly, afterwards.
* Returns the newly created object.
* Returns the newly created object.


<!--T:19-->
Example:
Example:
</translate>
{{code|code=
{{code|code=
import JoinFeatures
import JoinFeatures
j = JoinFeatures.makePartJoinFeature(name = 'Connect', mode = 'Connect' )
j = JoinFeatures.makePartJoinFeature(name = 'Embed', mode = 'Embed' )
j.Base = FreeCADGui.Selection.getSelection()[0]
j.Base = FreeCADGui.Selection.getSelection()[0]
j.Tool = FreeCADGui.Selection.getSelection()[1]
j.Tool = FreeCADGui.Selection.getSelection()[1]
}}
}}
<translate>
==Version==
<!--T:20-->
The tool was introduced in FreeCAD v0.16.5069
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:23-->
{{Docnav
|[[Part_JoinConnect|JoinConnect]]
|[[Part_JoinCutout|JoinCutout]]
|[[Part_Module|Part]]
|IconL=Part_JoinConnect.svg
|IconR=Part_JoinCutout.svg
|IconC=Workbench_Part.svg
}}


</translate>
</translate>
{{Part Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}
<languages/>

Revision as of 20:23, 8 December 2020

Part JoinEmbed

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

Description

Embed tool embeds a walled object (e.g., a pipe) into another walled object.

Usage

  1. Select the base object first, then the object to be embedded. The order of selection is important. It is enough to select one sub-shape of each object (e.g., faces).
  2. Invoke the Part JoinEmbed command.

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

Properties

Base

  • DataBase: Reference to base object (the one the other object is to be embedded into). The object should be a single solid.
  • DataTool: Reference to tool object (the object to be embedded). The object can be a single solid, or a valid compound of solids.
  • DataMode: The mode of operation, equals 'Embed' (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 'Embed object' option from the Join tools dropdown toolbar button.
  4. Use some cross-section tool (Clipping plane, Arch Section Plane, Arch Cut Plane) to reveal internals. On the picture below, Arch Section Plane is used.

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. That largest solid is boolean-fused with Tool object.

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

Notes

  • If after step 1, the object remains in one piece, the result of Embed will be equivalent to union of Base and Tool, but taking longer to compute.
  • 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 = 'Embed', mode = 'Embed')
  • Creates an empty Embed 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 = 'Embed', mode = 'Embed' )
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.