-
Notifications
You must be signed in to change notification settings - Fork 18
pytha.create_pyramid
fabian-flassig edited this page Jul 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 |
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, which corresponds to a circumradius of radius * 0.5 / sin(180° / segments).
| Type | Description |
|---|---|
element_handle |
An element handle of the newly created part |
Minimum PYTHA Version: V27
pytha, element handles, Axes and Directions, create_cone, create_block