Skip to content

pytha.create_silhouette

fabian-flassig edited this page Jul 31, 2026 · 1 revision

Creates the silhouette (outline) of a part as a new flat part.

Projects a part onto a plane and builds a new part from its outline. The silhouette is the outer contour of the part as seen along the projection direction, including any inner contours (holes). The projection direction is the w-axis of the coordinate frame and the outline is drawn in its u/v plane. Without an origin and axes the part is viewed along the global z-axis (top view).

Note: To obtain the outline as plain point loops instead of a part, use analyze_part_silhouette instead.

pytha.create_silhouette(part [,origin [,options]])
Parameter Type Description
part element_handle Element handle of the part to project. A group or a table of handles projects each contained part.
origin {x,y,z} Optional: origin of the projection frame.
options {...} Optional: a table that may contain the following options:
options.u_axis {x,y,z} Local coordinate u-axis of the projection frame.
options.v_axis {x,y,z} Local coordinate v-axis of the projection frame.
options.w_axis {x,y,z} Local coordinate w-axis of the projection frame; this is the direction the part is viewed along.
options.name string Name assigned to the resulting silhouette part.
options.material material_handle Material assigned to the resulting silhouette part.

Return value

Type Description
element_handle An element handle of the newly created silhouette part, or nil if the part has no silhouette.

Notes:

  • The projection direction is the w_axis. By default (no origin and no axes) the part is viewed along the global z-axis.
  • Only the outline is created; the result is a flat part in the u/v plane of the projection frame.
  • Inner contours (holes) of the silhouette are preserved as inner faces of the resulting part.
  • When a group or a table of handles is passed, one silhouette part is created per contained part and the handle of the last created part is returned.

Example:

Create the top-view silhouette of a part:

local outline = pytha.create_silhouette(part)

Create the silhouette as seen from the side (viewed along the y-axis):

local side = pytha.create_silhouette(part, {0, 0, 0}, { w_axis = {0, 1, 0}, name = "Side outline" })

Version Support:

Minimum PYTHA Version: V27

See also:

pytha, element handles, Axes and directions, Local Coordinates, analyze_part_silhouette, create_polygon_ex

Clone this wiki locally