gcs package

Subpackages

Module contents

Generalized Cylindrical Shells

Provides
  1. An object representing generalized cylindrical shell (GCS) structures.

  2. Operations on GCS structures.

How to use the documentation

Documentation is available in docstrings provided with the code.

The docstring examples assume that gcs has been imported:

>>> import gcs

Code snippets are indicated by three greater-than signs:

>>> shape = gcs.GCS(...)
>>> shape.parameters

Available subpackages

io

Functions for loading/saving GCS shapes.

verify

Functions for verifying the validity of GCS shapes.

class gcs.Cylinder(height: float, mass: float, thickness: float, n_steps: int = 100, d_theta: float = 0.01, triangulate_faces: bool = True)[source]

Bases: GCS

Simple GCS cylinder.

Attributes:
base_perimeter

The base perimeter (mm).

faces

The faces.

mesh

The mesh.

parameters

The GCS parameters.

top_perimeter

The top perimeter (mm).

valid

True if the GCS is valid.

valid_base_perimeter

True if the base perimeter is valid.

valid_radius

True if the radii are valid.

vertices

The vertices.

class gcs.GCS(c4_base: float, c8_base: float, c4_top: float, c8_top: float, twist_linear: float, twist_amplitude: float, twist_cycles: float, perimeter_ratio: float, height: float, mass: float, thickness: float, n_steps: int = 100, d_theta: float = 0.01, triangulate_faces: bool = True)[source]

Bases: object

The generalized cylindrical shell (GCS) class.

Attributes:
base_perimeter

The base perimeter (mm).

faces

The faces.

mesh

The mesh.

parameters

The GCS parameters.

top_perimeter

The top perimeter (mm).

valid

True if the GCS is valid.

valid_base_perimeter

True if the base perimeter is valid.

valid_radius

True if the radii are valid.

vertices

The vertices.

property base_perimeter: float

The base perimeter (mm).

property faces: ndarray

The faces.

Refer to gcs.triangulate for full documentation.

property mesh: Mesh

The mesh.

References

property parameters: dict

The GCS parameters.

property top_perimeter: float

The top perimeter (mm).

property valid: bool

True if the GCS is valid.

Refer to gcs.verify.verify for full documentation.

property valid_base_perimeter: bool

True if the base perimeter is valid.

Refer to gcs.verify.verify_base_perimeter for full documentation.

property valid_radius: bool

True if the radii are valid.

Refer to gcs.verify.verify_radius for full documentation.

property vertices: ndarray

The vertices.

Refer to gcs.discretize for full documentation.

gcs.discretize(shape: gcs.GCS) np.ndarray[source]

Discretizes a GCS.

Parameters:
shapegcs.GCS

The GCS.

Returns:
vertices(N, 3) np.ndarray

The vertices.

Examples

>>> shape = gcs.GCS(...)
>>> vertices = gcs.discretize(shape=shape)
>>> shape = gcs.GCS(...)
>>> vertices = shape.vertices
gcs.triangulate(shape: gcs.GCS) np.ndarray[source]

Triangulates a GCS.

Parameters:
shapegcs.GCS

The GCS.

Returns:
faces(N, 3) np.ndarray

The faces.

Examples

>>> shape = gcs.GCS(...)
>>> faces = gcs.triangulate(shape=shape)
>>> shape = gcs.GCS(...)
>>> faces = gcs.faces