Shape

A single geometric entity (vertex, edge, face or volume) within a model.

Returned by selection and query methods such as select, get_shape_by_id and get_shapes. Which numeric properties are populated depends on the shape type (length for edges, area for faces, volume for volumes).

Properties

id : int
Unique identifier of the shape within its stage.
type : ShapeType
Geometry kind of the shape: vertex, edge, face or volume.
length : float
Length of the shape; populated for edges, otherwise None.
area : float
Surface area of the shape; populated for faces, otherwise None.
volume : float
Volume of the shape; populated for volumes, otherwise None.
location : list[float]
Representative coordinates of the shape when available, otherwise None.

Methods

vertices()

List of all the vertices bounding the shape.

edges()

List of all the edges bounding the shape.

faces()

List of all the faces bounding the shape.

volumes()

List with the volume shape.

set_2d_to_3d_settings()

Set 2D to 3D extrusion settings for this shape.

Parameters

depth_in : float, optional
Extrusion depth inward
depth_out : float, optional
Extrusion depth outward
repetition : bool, optional
Enable repetition
repetition_spacing : float, optional
Spacing between repetitions
repetition_out : float, optional
Number of repetitions outward
repetition_in : float, optional
Number of repetitions inward
fill : bool, optional
Fill between repetitions
fill_in : float, optional
Fill depth inward
fill_out : float, optional
Fill depth outward
as_face : bool, optional
Treat as face

Returns

bool
True if settings were applied successfully

get_2d_to_3d_settings()

Get 2D to 3D extrusion settings for this shape.

Returns

dict
Dictionary containing extrusion settings: - depth_in: Extrusion depth inward - depth_out: Extrusion depth outward - repetition: Whether repetition is enabled - repetition_spacing: Spacing between repetitions - repetition_out: Number of repetitions outward - repetition_in: Number of repetitions inward - fill: Whether fill is enabled - fill_in: Fill depth inward - fill_out: Fill depth outward - as_face: Whether to treat as face