pytha.cut_element - pytha-3d-cad/pytha-lua-api GitHub Wiki

Cuts a single element or a table of elements at a given plane into two parts.

Similar to the Part tools -> Cutting plane function in the PYTHA user interface.

pytha.cut_element(element, origin, axis [,options]) 
Parameter Type Description
element element_handle or {...} A single element handle or a table of element handles
origin {x,y,z} Coordinates giving the position of the cutting plane
axis {x,y,z} Normal vector of the cutting plane
options {...} Optional: a table that may contain the following options:
options.type string "keep_both" (default), "keep_front", "keep_back"

Return value

Depending on options.type, either one or two tables with the resulting element handles will be returned.

Type Description
{element_handle, ...} A table containing the element handles to all elements in the positive hemisphere of the cutting plane (for "keep_both" and "keep_front")
{element_handle, ...} A table containing the element handles to all elements in the negative hemisphere of the cutting plane (for "keep_both" and "keep_back")

Additional information

If element contains element handles to groups, all members of these group will be cut as well.

See also:

pytha, Part Tools Functions, Element Handles, boole_part_difference, boole_part_union