-
Notifications
You must be signed in to change notification settings - Fork 18
pytha Edge Specification
Several workshop functions work on single edges of a part — edge banding, grain direction and the x axis. Edges have no element handle of their own, so they are addressed by the coordinates of their two end points, optionally narrowed down by the part they belong to.
An edge specification is a flat Lua table:
{ {x1, y1, z1}, {x2, y2, z2} [, part_handle] }| Type | Description | |
|---|---|---|
| index 1 | {x,y,z} |
Coordinate of the first end point |
| index 2 | {x,y,z} |
Coordinate of the second end point |
| index 3 | element_handle |
Optional: restricts the search to this part |
The order of the two coordinates does not matter. The coordinates are matched against the points of the part with the modelling tolerance, so they have to be exact — read them from get_element_bounding_box, analyze_polyline or analyze_part_silhouette rather than typing them by hand whenever you can.
The coordinates are global coordinates. They are not transformed by push_local_coordinates; a plugin that works in a local frame has to pass global coordinates here.
Functions that work on more than one edge take a list of edge specifications:
local edges = {
{ {0, 0, 19}, {600, 0, 19}, part },
{ {0, 400, 19}, {600, 400, 19}, part },
}Where the list order matters (edge banding), it defines the machining order within each part.
The remove_* functions accept either such a list or an element handle:
| Description | |
|---|---|
element_handle |
A part or group handle (or a table of those); every matching edge of those parts is used |
{edge_spec, ...} |
A list of edge specifications |
Minimum PYTHA Version: V27
pytha, Workshop Functions, element handles, apply_edge_banding, set_grain_direction