Skip to content

pytha.create_pyramid

fabian-flassig edited this page Jun 8, 2026 · 2 revisions

Creates a pyramid in PYTHA as new part.

Similar to the Parts -> Pyramid function in the PYTHA user interface.

pytha.create_pyramid(height, radius [,origin [,options]])
Parameter Type Description
height number Height of the pyramid (in w/z-direction)
radius number Base edge length (segment-radius mode, like the native Pyramid tool): the value is the length of one side of the base polygon. For segments = 4 this is the side length of the square base.
origin {x,y,z} Optional: center point of the base
options {...} Optional: a table that may contain the following options:
options.u_axis {x,y,z} Local coordinate u-axis for the orientation of the pyramid
options.v_axis {x,y,z} Local coordinate v-axis for the orientation of the pyramid
options.w_axis {x,y,z} Local coordinate w-axis for the orientation of the pyramid
options.segments number Number of base sides (default 4)
options.height_segments number Height sections of the pyramid

Additional information

With options.segments = 4 a classic square pyramid is created; higher values produce pyramids with a regular n-gon base. The radius is interpreted in segment-radius mode (matching the native Pyramid tool), i.e. it is the base edge length; internally it is converted to the circumradius via radius * 0.5 / sin(180° / segments).

Return value

Type Description
element_handle An element handle of the newly created part

Version Support:

Minimum PYTHA Version: V27

See also:

pytha, element handles, Axes and Directions, create_cone, create_block

Clone this wiki locally