Skip to content

Geometry

Module: xfea.model.geometry

A part’s base geometry: what a meshing plugin meshes into nodes and elements.

A part’s base_geometry (a file path, a mesh, lines, polylines) is kept as a BaseGeometry of the matching kind, with named GeometryFeature items a meshing plugin can use.

BaseGeometry(kind: str, data: object, features: Dict[str, GeometryFeature] = <factory>)

The geometry a part is meshed from, tagged with its kind, with named features for the meshing plugin.

A part normally builds it from what is given as its base geometry: a file path, a mesh, a line or polyline, or a list of them (xfea’s or COMPAS’s).

Parameters

Name Type Description
kind str The geometry’s kind, such as "path", "step", "mesh", "line", "lines" or "polyline".
data object The geometry itself, or the path of its file.
features dict[str, GeometryFeature], optional Named features (nodes, edges, faces) for meshing plugins; empty by default.
Methods
add_feature(name, feature=None, kind=None, data=None, **tags)→GeometryFeature
add_feature(
    name: str,
    feature: GeometryFeature | None = None,
    kind: str | None = None,
    data: object = None,
    **tags,
) -> GeometryFeature

Add a named feature to this geometry, replacing one of the same name.

Superseded by selections: name a group with part.mesh(..., groups={name: Select...}) and make the mesh finer with MeshingSettings(refine=[Refine(Select..., size=...)]) (xfea.meshing.select). A "plane" feature (data={"origin", "normal", "tol", "dim"}) with mesh_size (and mesh_size_depth, mesh_size_max) still names the plane’s faces and refines there; a "point" feature (data={"xyz"}) names the node nearest the point.

Parameters

Name Type Description
name str The feature’s name.
feature GeometryFeature, optional The feature, or None to build one from kind, data and the other keyword arguments (its tags).
kind str, optional The kind of the feature to build; needed when feature is None.
data object, optional The payload of the feature to build.

Returns

Name Type Description
GeometryFeature The feature added.
describe(what=None, select=None)→list
describe(what: str | None = None, select=None) -> list

This geometry file’s solids, faces, edges and points with their properties (describe()).

Parameters

Name Type Description
what {“solids”, “faces”, “edges”, “points”}, optional One kind only; all by default.
select Select, optional Only what this selection picks.
with_feature(name, feature=None, kind=None, data=None, **tags)→BaseGeometry
with_feature(
    name: str,
    feature: GeometryFeature | None = None,
    kind: str | None = None,
    data: object = None,
    **tags,
) -> BaseGeometry

A copy of this geometry with a named feature added or replaced; this one is left unchanged.

Takes the same arguments as add_feature(). The copy shares the geometry data with this one.

GeometryFeature(kind: str, data: object, tags: Dict[str, object] = <factory>)

A named part of a base geometry (nodes, edges, faces) that a meshing plugin can use, e.g. to refine it.

Parameters

Name Type Description
kind str The feature’s kind, such as "nodes", "edges", "faces" or one a plugin defines.
data object The feature’s payload: indices, geometry, or other data the plugin reads.
tags dict, optional Extra settings for the meshing plugin; empty by default.
LineGeometry(data: object, features: Mapping[str, GeometryFeature] | None = None)

A single Line to mesh into 1D elements.

LinesGeometry(data: object, features: Mapping[str, GeometryFeature] | None = None)

A list of Line objects to mesh into 1D elements.

MeshGeometry(data: object, features: Mapping[str, GeometryFeature] | None = None)

A Mesh to mesh, e.g. a surface for shell elements.

ObjectGeometry(data: object, features: Mapping[str, GeometryFeature] | None = None)

Any other object given as a part’s base geometry, kept as it is for a plugin that knows it.

PathGeometry(data: str, features: Mapping[str, GeometryFeature] | None = None)

A geometry file to mesh, by its path (BREP, IGES and others; STEP files use StepGeometry).

PolylineGeometry(data: object, features: Mapping[str, GeometryFeature] | None = None)

A single Polyline to mesh into 1D elements.

PolylinesGeometry(data: object, features: Mapping[str, GeometryFeature] | None = None)

A list of Polyline objects to mesh into 1D elements.

StepGeometry(data: str, features: Mapping[str, GeometryFeature] | None = None)

A STEP file to mesh, by its path (.step or .stp).

geometry_from_data(data: dict) -> BaseGeometry

A geometry rebuilt from its serialized __data__, features included.

geometry_from_kind(
    kind: str,
    data: object,
    features: Mapping[str, GeometryFeature] | None = None,
) -> BaseGeometry

A geometry of the class that matches kind (a plain BaseGeometry for an unknown kind), holding data.

Module: xfea.model.shapes

CShape(
    height: float,
    flange_width: float,
    web_thickness: float,
    flange_thickness: float,
    frame: Frame | None = None,
)

A C (channel) opening towards +x: its web along y from x = 0, its flanges along x; origin at the web’s outer bottom corner.

Parameters

Name Type Description
height float Overall height, along y.
flange_width float Overall width, along x, web included.
web_thickness float Thickness of the web.
flange_thickness float Thickness of both flanges.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Circle(radius: float, segments: int = 360, frame: Frame | None = None)

A solid circle of a given radius, centred on the origin: drawn as a polygon, its properties exact.

Its area, second moments, J and shear areas use the circle’s closed forms, not the polygon’s (whose sides fall slightly short of the circle).

Parameters

Name Type Description
radius float The radius, positive.
segments int, optional Number of sides of the polygon it is drawn with. Defaults to 360.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloatread-only

Shear area for shear along x: 0.9 of the area.

Avyfloatread-only

Shear area for shear along y: 0.9 of the area.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jfloatread-only

Torsion constant, the polar second moment π r⁴ / 2, in length⁴ (mm⁴ for mm).

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

circumferencefloatread-only

The circle’s perimeter, 2 π r.

diameterfloatread-only

Twice the radius.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

radiusfloat

The radius; setting it redraws the polygon.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

segmentsintread-only

Number of sides of the polygon the circle is drawn with.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

CustomI(
    height: float,
    top_flange_width: float,
    bottom_flange_width: float,
    web_thickness: float,
    top_flange_thickness: float,
    bottom_flange_thickness: float,
    frame: Frame | None = None,
)

An I section whose top and bottom flanges may differ in width and thickness.

Its height is centred on y = 0, its web and flanges on x = 0.

Parameters

Name Type Description
height float Overall height, along y.
top_flange_width float Width of the top flange, along x.
bottom_flange_width float Width of the bottom flange, along x.
web_thickness float Thickness of the web.
top_flange_thickness float Thickness of the top flange.
bottom_flange_thickness float Thickness of the bottom flange.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Ellipse(
    radius_a: float,
    radius_b: float,
    segments: int = 32,
    frame: Frame | None = None,
)

A solid ellipse of semi-axes radius_a along x and radius_b along y, centred on the origin.

Its area, second moments and J use the ellipse’s closed forms, not the polygon’s (32 sides fall 0.6 % short in area).

Parameters

Name Type Description
radius_a float Semi-axis along x.
radius_b float Semi-axis along y.
segments int, optional Number of sides of the polygon it is drawn with. Defaults to 32.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloatread-only

Shear area for shear along x: 0.9 of the area, as for a circle (an approximation for an elongated ellipse).

Avyfloatread-only

Shear area for shear along y: 0.9 of the area, as for a circle (an approximation for an elongated ellipse).

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jfloatread-only

Torsion constant, Saint-Venant’s π a³ b³ / (a² + b²) (exact for an ellipse), in length⁴.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

circumferencefloatread-only

The ellipse’s perimeter, by Ramanujan’s approximation.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

radius_afloat

Semi-axis along x; setting it redraws the polygon.

radius_bfloat

Semi-axis along y; setting it redraws the polygon.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

segmentsintread-only

Number of sides of the polygon the ellipse is drawn with.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Hexagon(side_length: float, frame: Frame | None = None)

A regular hexagon centred on the origin, a corner on the +x axis.

Parameters

Name Type Description
side_length float Length of each side (also the distance from the centre to each corner).
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

side_lengthfloat

Length of each side; setting it redraws the points.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

IShape(
    w: float,
    h: float,
    tw: float,
    tbf: float,
    ttf: float,
    direction: str = 'up',
    frame: Frame | None = None,
)

An I (wide-flange) section w wide and h high, its flanges along x, centred on its bounding box.

With equal flanges the centre is the centroid; with unequal ones the centroid moves towards the thicker flange.

Parameters

Name Type Description
w float Width of the flanges, along x, positive.
h float Overall height, along y, positive.
tw float Thickness of the web, positive.
tbf float Thickness of the bottom flange, positive.
ttf float Thickness of the top flange, positive.
direction str, optional Stored, not used at present: the shape is always drawn as described. Defaults to "up".
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloatread-only

Shear area for shear along x (the flanges’ direction): the flanges’ area abf + atf.

Avyfloatread-only

Shear area for shear along y (the web’s direction): the web’s area aw.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jfloatread-only

Torsion constant, thin-walled open section: (w (tbf³ + ttf³) + hw tw³) / 3, in length⁴.

An approximation: it ignores the web-flange junctions and fillets.

abffloatread-only

Area of the bottom flange, tbf * w.

atffloatread-only

Area of the top flange, ttf * w.

awfloatread-only

Area of the web between the flanges, tw * hw.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

hfloatread-only

Overall height, along y.

hwfloatread-only

Clear height of the web between the flanges, h - tbf - ttf.

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

shear_area_I_beam_axesread-only

(Avx, Avy): the flanges abf + atf for shear along x, the web aw for shear along y (EN 1993-1-1, 6.2.6).

tbffloatread-only

Thickness of the bottom flange.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

ttffloatread-only

Thickness of the top flange.

twfloatread-only

Thickness of the web.

uidUUID | Noneread-only

The object’s unique id, a UUID.

wfloatread-only

Width of the flanges, along x.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

LShape(
    a: float,
    b: float,
    t1: float,
    t2: float,
    direction: str = 'up',
    frame: Frame | None = None,
)

An L (angle) in a box a wide (x) and b high (y), centred on the box, its corner at the bottom left.

Parameters

Name Type Description
a float Length of the horizontal leg, along x.
b float Height of the vertical leg, along y.
t1 float Thickness of the horizontal leg.
t2 float Thickness of the vertical leg.
direction str, optional Stored, not used at present: the shape is always drawn as described. Defaults to "up".
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloatread-only

Shear area for shear along x: the horizontal leg, a t1.

Avyfloatread-only

Shear area for shear along y: the vertical leg, b t2.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jfloatread-only

Torsion constant, thin-walled open section: (a t1³ + (b - t1) t2³) / 3, in length⁴.

afloatread-only

Length of the horizontal leg, along x.

bfloatread-only

Height of the vertical leg, along y.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

t1floatread-only

Thickness of the horizontal leg.

t2floatread-only

Thickness of the vertical leg.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Octagon(circumradius: float, frame: Frame | None = None)

A regular octagon centred on the origin, a corner on the +x axis.

Parameters

Name Type Description
circumradius float Distance from the centre to each corner.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Parallelogram(width: float, height: float, angle: float, frame: Frame | None = None)

A parallelogram with its base along x from the origin: area width * height.

Parameters

Name Type Description
width float Length of the base and the top, along x.
height float Height, along y.
angle float Angle between the base and the sloping sides, in radians (pi / 2: a rectangle).
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Pentagon(circumradius: float, frame: Frame | None = None)

A regular pentagon centred on the origin, a corner on the +x axis.

Parameters

Name Type Description
circumradius float Distance from the centre to each corner.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

PolygonShape(
    points: list[Point],
    frame: Frame | None = None,
    check_planarity: bool = True,
)

A shape given by its corner points: any plane polygon.

Parameters

Name Type Description
points list[Point] The polygon’s corners, counter-clockwise round it, in one plane.
frame Frame, optional The shape’s frame; None means world XY.
check_planarity bool, optional Raise ValueError if the points are not in one plane. Defaults to True.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Rectangle(w: float, h: float, frame: Frame | None = None)

A solid rectangle of width w along x and height h along y, centred on the origin.

Parameters

Name Type Description
w float Width, along x, positive.
h float Height, along y, positive.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloatread-only

Shear area for shear along x: 5/6 of the area.

Avyfloatread-only

Shear area for shear along y: 5/6 of the area.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s, not the polar second moment), in length⁴ (mm⁴ for mm).

J = a b³ / 16 · (16/3 - 3.36 b/a (1 - b⁴ / (12 a⁴))), a the longer side and b the shorter (Roark’s Formulas for Stress and Strain, 7th edition, Young and Budynas).

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

hfloatread-only

Height, along y.

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

wfloatread-only

Width, along x.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Rhombus(a: float, b: float, frame: Frame | None = None)

A rhombus (a diamond) given by its two diagonals, a along x and b along y, centred on the origin.

Parameters

Name Type Description
a float Diagonal along x.
b float Diagonal along y.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

afloatread-only

Diagonal along x.

bfloatread-only

Diagonal along y.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Shape(points: list[Point], frame: Frame | None = None, check_planarity: bool = True)

A plane polygon, a beam’s cross-section: its area, centroid, second moments of area and principal axes.

The values are in the units of the points’ coordinates: area in length² (mm² for mm), second moments in length⁴ (mm⁴). The second moments are about axes through the centroid, parallel to the shape’s local x and y axes. Area, centroid and second moments are computed once and cached.

Abstract base class; do not instantiate directly.

Parameters

Name Type Description
points list[Point] The polygon’s corners, counter-clockwise round it, in one plane.
frame Frame, optional The shape’s frame; None means world XY.
check_planarity bool, optional Raise ValueError if the points are not in one plane. Defaults to True.

References

Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Methods
jobdata(*args, **kwargs)

Nothing: a shape writes nothing to a solver’s input.

oriented(frame, check_planarity=True)→Shape
oriented(frame: Frame, check_planarity: bool = True) -> Shape

A copy of the shape placed on a frame, turned a quarter turn about the frame’s x axis.

The new shape’s frame is frame rotated by +90 degrees about its x axis: the shape’s x axis lies along frame.xaxis, its y axis along frame.zaxis, and its plane contains both. Beams use it to sweep their section along their axis.

Parameters

Name Type Description
frame Frame The frame to place the shape on.
check_planarity bool, optional Check that the new shape’s points are in one plane. Defaults to True.

Returns

Name Type Description
class:Shape A shape of the same class and dimensions (a PolygonShape for one built from points alone).
plot(fill=True, facecolor='#B0C4DE', edgecolor='#333333', centroid_color='red', axis_color='#555555', alpha=0.6, figsize=(8, 6))
plot(
    fill: bool = True,
    facecolor: str = '#B0C4DE',
    edgecolor: str = '#333333',
    centroid_color: str = 'red',
    axis_color: str = '#555555',
    alpha: float = 0.6,
    figsize=(8, 6),
)

Draw the shape with matplotlib: its outline, centroid, principal axes and section properties.

Parameters

Name Type Description
fill bool, optional Fill the shape. Defaults to True.
facecolor, edgecolor str, optional Colours of the fill and the outline.
centroid_color, axis_color str, optional Colours of the centroid’s marker and the principal axes.
alpha float, optional Opacity of the fill, 0 to 1. Defaults to 0.6.
figsize tuple[float, float], optional Figure size in inches. Defaults to (8, 6).
summary()→str

The section properties as text: area, centroid, second moments, radii of gyration, principal axes.

Values rounded to 2 decimals; the angle in degrees.

to_mesh()→Mesh

The shape as a one-face Mesh on its points.

translated(vector, check_planarity=True)→Shape
translated(vector, check_planarity: bool = True) -> Shape

A copy of the shape with its frame moved by a vector; its points are unchanged.

Parameters

Name Type Description
vector Vector or sequence of 3 floats The translation.
check_planarity bool, optional Check that the new shape’s points are in one plane. Defaults to True.

Returns

Name Type Description
class:Shape A shape of the same class and dimensions (a PolygonShape for one built from points alone).
Star(a: float, b: float, c: float, frame: Frame | None = None)

A four-pointed star, for demonstration: a rectangle a by b whose sides are pulled in by c at their middles.

Its points are the rectangle’s corners, (0, 0) to (a, b).

Parameters

Name Type Description
a float Width, along x.
b float Height, along y.
c float How far each side’s middle is pulled in.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

afloat

Width, along x; setting it redraws the points.

bfloat

Height, along y; setting it redraws the points.

cfloat

How far each side is pulled in; setting it redraws the points.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

TShape(
    a: float,
    b: float,
    t1: float,
    t2: float,
    direction: str = 'up',
    frame: Frame | None = None,
)

A T with its flange along the bottom and its stem rising from it, in a box a by b, centred on the origin.

As drawn (y up) it reads as an upside-down T: the flange spans the full width a at the bottom, the stem is centred on x = 0.

Parameters

Name Type Description
a float Width of the flange, along x.
b float Overall height, along y.
t1 float Thickness of the flange.
t2 float Thickness of the stem.
direction str, optional Stored, not used at present: the shape is always drawn as described. Defaults to "up".
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

afloatread-only

Width of the flange, along x.

bfloatread-only

Overall height, along y.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

t1floatread-only

Thickness of the flange.

t2floatread-only

Thickness of the stem.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Trapezoid(
    top_width: float,
    bottom_width: float,
    height: float,
    frame: Frame | None = None,
)

A trapezoid with its parallel sides along x: bottom_width at y = 0, top_width at y = height.

The bottom side runs from x = 0 to bottom_width; the top side is centred over it.

Parameters

Name Type Description
top_width float Length of the side at y = height.
bottom_width float Length of the side at y = 0.
height float Distance between the parallel sides.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

Triangle(circumradius: float, frame: Frame | None = None)

An equilateral triangle centred on the origin, a corner on the +x axis.

Parameters

Name Type Description
circumradius float Distance from the centre to each corner.
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

UShape(
    a: float,
    b: float,
    t1: float,
    t2: float,
    t3: float,
    direction: str = 'up',
    frame: Frame | None = None,
)

A U (channel opening upwards) in a box a wide (x) and b high (y), centred on the origin.

The base runs along the bottom; the left and right walls rise to the top, with the opening between them.

Parameters

Name Type Description
a float Overall width, along x.
b float Overall height, along y.
t1 float Thickness of the left wall.
t2 float Thickness of the base.
t3 float Thickness of the right wall.
direction str, optional Stored, not used at present: the shape is always drawn as described. Defaults to "up".
frame Frame, optional The shape’s frame; None means world XY.
Properties
Afloatread-only

Same as area.

Avxfloat | Noneread-only

Shear area for shear along x, in length²; raises ValueError for a shape without a formula for it.

Avyfloat | Noneread-only

Shear area for shear along y, in length²; raises ValueError for a shape without a formula for it.

I1floatread-only

The larger principal second moment of area, in length⁴ (mm⁴ for mm).

I2floatread-only

The smaller principal second moment of area, in length⁴ (mm⁴ for mm).

Ixxfloatread-only

Second moment of area about the x axis through the centroid, ∫ y² dA, in length⁴ (mm⁴ for mm).

Ixyfloatread-only

Product of area about the centroid, ∫ x y dA, in length⁴ (mm⁴ for mm); zero if x or y is an axis of symmetry.

Iyyfloatread-only

Second moment of area about the y axis through the centroid, ∫ x² dA, in length⁴ (mm⁴ for mm).

Jread-only

Torsion constant (Saint-Venant’s J), in length⁴; raises ValueError for a shape without a formula for it.

afloatread-only

Overall width, along x.

bfloatread-only

Overall height, along y.

centroidPointread-only

centroid_xy in world coordinates, placed by the shape’s frame.

For the default frame (world XY) it is centroid_xy.

frameFrameread-only

The shape’s frame (world XY by default).

is_planarboolread-only

Whether the corners lie in one plane.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

lineslist[Line]read-only

The sides, the last back to the first corner.

namestr

The object’s name.

normalVectorread-only

The unit normal, by the right-hand rule round the points.

planePlaneread-only

The polygon’s plane, its normal by the right-hand rule round the points.

pointslist[Point]

The outline’s points, in the shape’s own frame; setting them clears the cached properties.

points_worldlist[Point]read-only

The points taken as coordinates in the shape’s frame, given in world coordinates: where the shape is drawn.

r1floatread-only

Radius of gyration about the I1 axis, sqrt(I1 / A), in length.

r2floatread-only

Radius of gyration about the I2 axis, sqrt(I2 / A), in length.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

rxfloatread-only

Radius of gyration about the centroidal x axis, sqrt(Ixx / A), in length.

ryfloatread-only

Radius of gyration about the centroidal y axis, sqrt(Iyy / A), in length.

t1floatread-only

Thickness of the left wall.

t2floatread-only

Thickness of the base.

t3floatread-only

Thickness of the right wall.

thetafloatread-only

Angle in radians from the x axis to the axis of I1, positive from x towards y.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xy_arraystuple[list[float], list[float]]read-only

The x and the y coordinates of points_xy, as two lists, the first point repeated at the end.

© 2026 Francesco Ranaudo · Text and pictures CC BY 4.0 · Code Elastic License 2.0 · how to reuse them