CAM Shape: Difference between revisions

From FreeCAD Documentation
m (moved templates out of translation tags + links)
No edit summary
(2 intermediate revisions by the same user not shown)
Line 19: Line 19:
{{GuiCommand
{{GuiCommand
|Name=Path FromShapes
|Name=Path FromShapes
|Workbenches=[[Path Workbench|Path]]
|Workbenches=[[Path_Workbench|Path]]
|MenuLocation=Path → Partial commands → From Shape
|MenuLocation=Path → Partial commands → From Shape
|Shortcut=
|Shortcut=
Line 44: Line 44:
<!--T:6-->
<!--T:6-->
All edges associated with the 3D Model selection will be included.
All edges associated with the 3D Model selection will be included.
# Select edges by selecting the entire object from the [[3D view]] or [[Tree view]], or by selecting individual edges, or by Faces from the [[3D view]].
# Select edges by selecting the entire object from the [[3D_view|3D view]] or [[Tree_view|Tree view]], or by selecting individual edges, or by Faces from the [[3D_view|3D view]].
# Press the {{KEY|[[Image:Path_GcodeFromShape.png|16px]] [[Path FromShapes|From Shape]]}} button
# Press the {{KEY|[[Image:Path_GcodeFromShape.png|16px]] [[Path_FromShapes|From Shape]]}} button


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


==Scripting== <!--T:20-->
==Scripting== <!--T:20-->
{{Emphasis|See also:}} [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


====DocString Info==== <!--T:22-->
====DocString Info==== <!--T:22-->
Returns a Path object from a list of shapes
Returns a Path object from a list of shapes.


<!--T:23-->
<!--T:23-->
Line 85: Line 85:
<!--T:26-->
<!--T:26-->
* arc_plane(1): 0=None,1=Auto,2=XY,3=ZX,4=YZ,5=Variable. Arc drawing plane, corresponding to G17, G18, and G19.
* arc_plane(1): 0=None,1=Auto,2=XY,3=ZX,4=YZ,5=Variable. Arc drawing plane, corresponding to G17, G18, and G19.
If not 'None', the output wires will be transformed to align with the selected plane,
**If not 'None', the output wires will be transformed to align with the selected plane, and the corresponding GCode will be inserted.
**'Auto' means the plane is determined by the first encountered arc plane. If the found plane does not align to any GCode plane, XY plane is used.
and the corresponding GCode will be inserted.
'Auto' means the plane is determined by the first encountered arc plane. If the found
**'Variable' means the arc plane can be changed during operation to align to the arc encountered.
plane does not align to any GCode plane, XY plane is used.
'Variable' means the arc plane can be changed during operation to align to the
arc encountered.


<!--T:27-->
<!--T:27-->
* sort_mode(1): 0=None,1=2D5,2=3D,3=Greedy. Wire sorting mode to optimize travel distance.
* sort_mode(1): 0=None,1=2D5,2=3D,3=Greedy. Wire sorting mode to optimize travel distance.
'2D5' explode shapes into wires, and groups the shapes by its plane. The 'start' position
**'2D5' explode shapes into wires, and groups the shapes by its plane. The 'start' position chooses the first plane to start. The algorithm will then sort within the plane and then move on to the next nearest plane.
**'3D' makes no assumption of planarity. The sorting is done across 3D space.
chooses the first plane to start. The algorithm will then sort within the plane and then
**'Greedy' like '2D5' but will try to minimize travel by searching for nearest path below the current milling layer. The path in lower layer is only selected if the moving distance is within the value given in 'threshold'.
move on to the next nearest plane.
'3D' makes no assumption of planarity. The sorting is done across 3D space.
'Greedy' like '2D5' but will try to minimize travel by searching for nearest path below
the current milling layer. The path in lower layer is only selected if the moving distance
is within the value given in 'threshold'.


<!--T:28-->
<!--T:28-->
* min_dist(0.0): minimum distance for the generated new wires. Wires maybe broken if the
* min_dist(0.0): minimum distance for the generated new wires. Wires maybe broken if the algorithm see fits. Set to zero to disable wire breaking.
algorithm see fits. Set to zero to disable wire breaking.


<!--T:29-->
<!--T:29-->
* abscissa(3.0): Controls vertex sampling on wire for nearest point searching
* abscissa(3.0): Controls vertex sampling on wire for nearest point searching. The sampling is dong using OCC GCPnts_UniformAbscissa.
The sampling is dong using OCC GCPnts_UniformAbscissa


<!--T:30-->
<!--T:30-->
* nearest_k(3): Nearest k sampling vertices are considered during sorting
* nearest_k(3): Nearest k sampling vertices are considered during sorting.


<!--T:31-->
<!--T:31-->
* orientation(0): 0=Normal,1=Reversed. Enforce loop orientation
* orientation(0): 0=Normal,1=Reversed. Enforce loop orientation:
'Normal' means CCW for outer wires when looking against the positive axis direction,
**'Normal' means CCW for outer wires when looking against the positive axis direction, and CW for inner wires.
and CW for inner wires. 'Reversed' means the other way round
**'Reversed' means the other way round.


<!--T:32-->
<!--T:32-->
* direction(0): 0=None,1=XPositive,2=XNegative,3=YPositive,4=YNegative,5=ZPositive,6=ZNegative. Enforce open path direction
* direction(0): 0=None,1=XPositive,2=XNegative,3=YPositive,4=YNegative,5=ZPositive,6=ZNegative. Enforce open path direction.


<!--T:33-->
<!--T:33-->
* threshold(0.0): If two wire's end points are separated within this threshold, they are consider
* threshold(0.0): If two wire's end points are separated within this threshold, they are consider as connected. You may want to set this to the tool diameter to keep the tool down.
as connected. You may want to set this to the tool diameter to keep the tool down.


<!--T:34-->
<!--T:34-->
* retract_axis(2): 0=X,1=Y,2=Z. Tool retraction axis
* retract_axis(2): 0=X,1=Y,2=Z. Tool retraction axis.


<!--T:35-->
<!--T:35-->
* retraction(0.0): Tool retraction absolute coordinate along retraction axis
* retraction(0.0): Tool retraction absolute coordinate along retraction axis.


<!--T:36-->
<!--T:36-->
* resume_height(0.0): When return from last retraction, this gives the pause height relative to the Z
* resume_height(0.0): When return from last retraction, this gives the pause height relative to the Z value of the next move.
value of the next move.


<!--T:37-->
<!--T:37-->
* segmentation(0.0): Break long curves into segments of this length. One use case is for PCB autolevel,
* segmentation(0.0): Break long curves into segments of this length. One use case is for PCB autolevel, so that more correction points can be inserted.
so that more correction points can be inserted


<!--T:38-->
<!--T:38-->
* feedrate(0.0): Normal move feed rate
* feedrate(0.0): Normal move feed rate.


<!--T:39-->
<!--T:39-->
* feedrate_v(0.0): Vertical only (step down) move feed rate
* feedrate_v(0.0): Vertical only (step down) move feed rate.


<!--T:40-->
<!--T:40-->
* verbose(true): If true, each motion GCode will contain full coordinate and feedrate
* verbose(true): If true, each motion GCode will contain full coordinate and feedrate.


<!--T:41-->
<!--T:41-->
* abs_center(false): Use absolute arc center mode (G90.1)
* abs_center(false): Use absolute arc center mode (G90.1).


<!--T:42-->
<!--T:42-->
* preamble(true): Emit preambles
* preamble(true): Emit preambles.


<!--T:43-->
<!--T:43-->
* deflection(0.01): Deflection for non circular curve discretization. It also also used for
* deflection(0.01): Deflection for non circular curve discretization. It also also used for discretizing circular wires when you 'Explode' the shape for wire operations
discretizing circular wires when you 'Explode' the shape for wire operations


====Example:==== <!--T:44-->
====Example:==== <!--T:44-->

Revision as of 14:55, 1 November 2020

This documentation is not finished. Please help and contribute documentation.

GuiCommand model explains how commands should be documented. Browse Category:UnfinishedDocu to see more incomplete pages like this one. See Category:Command Reference for all commands.

See WikiPages to learn about editing the wiki pages, and go to Help FreeCAD to learn about other ways in which you can contribute.

To use this enable experimental feature you have to enable Experimental Features


Path FromShapes

Menu location
Path → Partial commands → From Shape
Workbenches
Path
Default shortcut
None
Introduced in version
-
See also
None

Description

Path FromShapes doesn't match the current Path workflow. For that reason it's moved to the experimental features.


This tool generates tool-paths from Path Object edges.

Tool-paths are uncompensated for tool radius. There is no Tool controller associated with the generated tool-paths .

Usage

All edges associated with the 3D Model selection will be included.

  1. Select edges by selecting the entire object from the 3D view or Tree view, or by selecting individual edges, or by Faces from the 3D view.
  2. Press the From Shape button

The output tool-path is added outside the Path Job.

Options

All Options provided are available only from the FromShape.Property.Data view, and include:

  • Retraction Axis
  • Retraction Height
  • Resume Height
  • Feed Rate
  • Feed Rate Vertical

Properties

Data

Empty

View

Empty

Scripting

See also: FreeCAD Scripting Basics.

DocString Info

Returns a Path object from a list of shapes.

  • shapes: input list of shapes.
  • start (Vector()): feed start position, and also serves as a hint of path entry.
  • return_end (False): if True, returns tuple (path, endPosition).
  • arc_plane(1): 0=None,1=Auto,2=XY,3=ZX,4=YZ,5=Variable. Arc drawing plane, corresponding to G17, G18, and G19.
    • If not 'None', the output wires will be transformed to align with the selected plane, and the corresponding GCode will be inserted.
    • 'Auto' means the plane is determined by the first encountered arc plane. If the found plane does not align to any GCode plane, XY plane is used.
    • 'Variable' means the arc plane can be changed during operation to align to the arc encountered.
  • sort_mode(1): 0=None,1=2D5,2=3D,3=Greedy. Wire sorting mode to optimize travel distance.
    • '2D5' explode shapes into wires, and groups the shapes by its plane. The 'start' position chooses the first plane to start. The algorithm will then sort within the plane and then move on to the next nearest plane.
    • '3D' makes no assumption of planarity. The sorting is done across 3D space.
    • 'Greedy' like '2D5' but will try to minimize travel by searching for nearest path below the current milling layer. The path in lower layer is only selected if the moving distance is within the value given in 'threshold'.
  • min_dist(0.0): minimum distance for the generated new wires. Wires maybe broken if the algorithm see fits. Set to zero to disable wire breaking.
  • abscissa(3.0): Controls vertex sampling on wire for nearest point searching. The sampling is dong using OCC GCPnts_UniformAbscissa.
  • nearest_k(3): Nearest k sampling vertices are considered during sorting.
  • orientation(0): 0=Normal,1=Reversed. Enforce loop orientation:
    • 'Normal' means CCW for outer wires when looking against the positive axis direction, and CW for inner wires.
    • 'Reversed' means the other way round.
  • direction(0): 0=None,1=XPositive,2=XNegative,3=YPositive,4=YNegative,5=ZPositive,6=ZNegative. Enforce open path direction.
  • threshold(0.0): If two wire's end points are separated within this threshold, they are consider as connected. You may want to set this to the tool diameter to keep the tool down.
  • retract_axis(2): 0=X,1=Y,2=Z. Tool retraction axis.
  • retraction(0.0): Tool retraction absolute coordinate along retraction axis.
  • resume_height(0.0): When return from last retraction, this gives the pause height relative to the Z value of the next move.
  • segmentation(0.0): Break long curves into segments of this length. One use case is for PCB autolevel, so that more correction points can be inserted.
  • feedrate(0.0): Normal move feed rate.
  • feedrate_v(0.0): Vertical only (step down) move feed rate.
  • verbose(true): If true, each motion GCode will contain full coordinate and feedrate.
  • abs_center(false): Use absolute arc center mode (G90.1).
  • preamble(true): Emit preambles.
  • deflection(0.01): Deflection for non circular curve discretization. It also also used for discretizing circular wires when you 'Explode' the shape for wire operations

Example:

shapes = [Box.Shape]
Path.fromShapes(shapes, start=Vector(), return_end=False arc_plane=1, sort_mode=1, min_dist=0.0, abscissa=3.0, nearest_k=3, orientation=0, direction=0, threshold=0.0, retract_axis=2, retraction=0.0, resume_height=0.0, segmentation=0.0, feedrate=0.0, feedrate_v=0.0, verbose=true, abs_center=false, preamble=true, deflection=0.01)

Template:Path Tools navi