Skip to content

pytha.stretch_element

fabian-flassig edited this page Jul 31, 2026 · 8 revisions

Stretches a single element or a table of elements to a given size.

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

pytha.stretch_element(element, dimentsions [,options]) 
Parameter Type Description
element element_handle or {...} A single element handle or a table of element handles
dimensions {l_u,l_v,l_w} Table giving the new dimensions
options {...} Optional: a table that may contain the following options:
options.u_axis {x,y,z} Local coordinate u-axis for the zooming
options.v_axis {x,y,z} Local coordinate v-axis for the zooming
options.w_axis {x,y,z} Local coordinate w-axis for the zooming
options.pivot {...} Table giving the orientation of the pivot point. The values can be "mid" (default), "low", "high" or absolute coordinates.

Additional information

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

Setting one value in dimensions to 0 will preserve the length of the object along this axis.

By specifying options.pivot the resting point of the scaling operation can be defined. For each axis this can be set individually either relative to the uvw-bounding box of the object: "low" refers to the minimum coordinate value, "high" to the maximum and "mid" to the center. Or it can be given numerically in absolute coordinates. For example, pivot={0,0,"low"} will stretch an element around 0,0,w_min.

See also:

pytha, Part Tools Functions, Element Handles, Axes and directions, zoom_element, extend_element

Clone this wiki locally