bluemira.geometry.face

Wrapper for FreeCAD Part.Face objects

Classes

BluemiraFace

Bluemira Face class.

Module Contents

class bluemira.geometry.face.BluemiraFace(boundary: bluemira.geometry.wire.BluemiraWire | list[bluemira.geometry.wire.BluemiraWire], label: str = '')

Bases: bluemira.geometry.base.BluemiraGeo

Inheritance diagram of bluemira.geometry.face.BluemiraFace

Bluemira Face class.

Parameters:
static _converter(func)

Function used in __getattr__ to modify the added functions.

Returns:

Function used in __getattr__ to modify the added functions.

_plotting_wires()
copy()

Make a copy of the BluemiraFace

Returns:

A copy of the BluemiraFace.

deepcopy(label: str | None = None) BluemiraFace

Make a copy of the BluemiraFace

Returns:

A deepcopy of the BluemiraFace.

Parameters:

label (str | None)

Return type:

BluemiraFace

_check_boundary(objs)

Check if objects in objs are of the correct type for this class

Returns:

Inputted object if correct type for class or None when input is None.

Raises:
  • TypeError – Only wires are allowed as boundaries

  • NotClosedWireError – not all boundary wires are closed

_create_face(*, check_reverse: bool = True)

Create the primitive face

Returns:

The primitive face.

Raises:

DisjointedFaceError – More than 1 face created

Parameters:

check_reverse (bool)

_create_shape() bluemira.codes._freecadapi.apiFace
Returns:

Shape of the object as a primitive face

Return type:

Part.Face

classmethod _create(obj: bluemira.codes._freecadapi.apiFace, label='') BluemiraFace
Parameters:

obj (bluemira.codes._freecadapi.apiFace)

Return type:

BluemiraFace

discretise(ndiscr: int = 100, *, byedges: bool = False, dl: float | None = None) numpy.ndarray

Make an array of the geometry.

Parameters:
  • ndiscr (int) – Number of points in the array

  • dl (float | None) – Optional length discretisation (overrides ndiscr)

  • byedges (bool) – Whether or not to discretise by edges

Returns:

  • (M, (3, N)) array of point coordinates where M is the number of boundaries

  • and N the number of discretisation points.

Return type:

numpy.ndarray

normal_at(alpha_1: float = 0.0, alpha_2: float = 0.0) numpy.ndarray

Get the normal vector of the face at a parameterised point in space. For planar faces, the normal is the same everywhere.

Returns:

The normal vector of the face at a parameterised point in space.

Parameters:
  • alpha_1 (float)

  • alpha_2 (float)

Return type:

numpy.ndarray

property vertexes: bluemira.geometry.coordinates.Coordinates

The vertexes of the face.

Return type:

bluemira.geometry.coordinates.Coordinates

property edges: tuple[bluemira.geometry.wire.BluemiraWire]

The edges of the face.

Return type:

tuple[bluemira.geometry.wire.BluemiraWire]

property wires: tuple[bluemira.geometry.wire.BluemiraWire]

The wires of the face.

Return type:

tuple[bluemira.geometry.wire.BluemiraWire]

property faces: tuple[BluemiraFace]

The faces of the face. By definition a tuple of itself.

Return type:

tuple[BluemiraFace]

property shells: tuple

The shells of the face. By definition an empty tuple.

Return type:

tuple

property solids: tuple

The solids of the face. By definition an empty tuple.

Return type:

tuple