-
Notifications
You must be signed in to change notification settings - Fork 18
pytha.create_part_section
Creates the cross-section face of a part cut by a plane, as a new flat part.
Cuts a part (or several) with a plane and builds the resulting cross-section as a new flat part. The outer contour and any holes are combined into a single face, so holes remain inner loops of the section rather than separate contours. The cutting plane is defined the same way as for cut_element: a point on the plane (origin) and the plane normal (axis).
Unlike cut_element, the input parts are left unchanged; only the cross-section part is added.
Note: To obtain the cross-section as plain point loops instead of a part, use analyze_part_section instead.
pytha.create_part_section(part, origin, axis [,options])| Parameter | Type | Description |
|---|---|---|
part |
element_handle or {...}
|
A single part handle or a table of handles. A group is cut as its member parts. |
origin |
{x,y,z} |
A point the cutting plane passes through. |
axis |
{x,y,z} |
Normal vector of the cutting plane. |
options |
{...} |
Optional: a table that may contain the following options: |
options.name |
string |
Name assigned to the resulting cross-section part. |
options.material |
material_handle |
Material assigned to the resulting cross-section part. |
| Type | Description |
|---|---|
element_handle |
An element handle of the new cross-section part, or nil if the plane does not cut the part. |
- Holes in the cross-section are kept as inner loops of the same face, not as separate contours.
- The input parts are not modified.
- When several parts are cut by the plane, their sections are combined into one cross-section part; the handle of that part is returned.
- If the plane misses the part (no section),
nilis returned.
Cross-section of a part at the horizontal plane through z = 500:
local face = pytha.create_part_section(part, {0, 0, 500}, {0, 0, 1}, { name = "Section A" })Minimum PYTHA Version: V27
pytha, Part Tools Functions, element handles, analyze_part_section, cut_element, create_silhouette