Skip to content

compas_tf.schoring_element ¤

Classes¤

Dataset ¤

Methods:¤

select_by_type classmethod ¤
select_by_type(type='a', target_length=0)

Select dataset components by type and target length.

This method selects appropriate SchoringElement components based on the type and finds the best fitting body component based on the target length.

Parameters:

Name Type Description Default
type str

The type of dataset to select. Currently only "a" is supported. Default is "a".

'a'
target_length float

The target length for selecting the appropriate body component. Default is 0.

0

Returns:

Type Description
list[str]

A list of dataset filenames for the selected SchoringElement components: [foot, body_start, body_end, head]

SchoringElement ¤

SchoringElement(dataset: str = None, transformation: Transformation | None = None, features: list[SchoringElementFeature] | None = None, name: str | None = None, geometry_as_brep: bool = False)

A single shoring component loaded from a JSON dataset file.

Data structure

Each dataset is a JSON file (e.g. schoring_foot_0.json) that contains:

  • meshes -- triangulated mesh geometry embedded directly (always present, used by default).
  • frames -- connection planes: frames[0] is the base attachment point, frames[1] is the top attachment point (where the next element connects).
  • extension_length-- the physical extension length of the component in metres (used by Dataset.select_by_type to pick the right body length).
  • step_path -- absolute path to the STEP file for exact BREP geometry; only used when geometry_as_brep=True. The path may point to a different machine, so the loader falls back to a local data/ search by stem name.

OBJ files (schoring_*.obj) were generated alongside the JSON files but are redundant because the mesh is already embedded in the JSON. They have been removed.

Parameters:

Name Type Description Default
dataset str

The dataset filename containing the SchoringElement component data.

None
transformation :class:`compas.geometry.Transformation`

The transformation to apply to the element.

None
features list[:class:`SchoringElementFeature`]

The features of the SchoringElement element.

None
name str

The name of the SchoringElement element.

None
geometry_as_brep bool

Whether to load geometry as BREP from STEP file. Default is False.

False

Attributes:

Name Type Description
frames list

List of frames from the loaded dataset.

geometry :class:`compas.datastructures.Mesh`

The mesh geometry of the SchoringElement element.

xsize float

The width of the element (X dimension).

ysize float

The length of the element (Y dimension).

zsize float

The height of the element (Z dimension).

max_extension_length float

The maximum extension length from the dataset.

Methods:¤

clear_cache classmethod ¤
clear_cache()

Clear all cached data.

compute_aabb ¤
compute_aabb(inflate: float = 1.0) -> Box

Compute the axis-aligned bounding box of the element.

Parameters:

Name Type Description Default
inflate float

Inflation factor to scale the bounding box. Default is 1.0.

1.0

Returns:

Type Description
class:`compas.geometry.Box`

The axis-aligned bounding box of the element.

compute_collision_mesh ¤
compute_collision_mesh(inflate: float = 1.0) -> Mesh

Compute collision mesh - use the same geometry for now.

compute_elementgeometry ¤
compute_elementgeometry(include_features: bool = False) -> Mesh | Brep

Compute the shape of the element from the loaded geometry. This shape is relative to the frame of the element.

Parameters:

Name Type Description Default
include_features bool

If True, the features should be included in the element geometry.

False

Returns:

Type Description
class:`compas.datastructures.Mesh` or :class:`compas.geometry.Brep`

The geometry of the element.

compute_obb ¤
compute_obb(inflate: float = 1.0) -> Box

Compute the oriented bounding box of the element.

Parameters:

Name Type Description Default
inflate float

Inflation factor to scale the bounding box. Default is 1.0.

1.0

Returns:

Type Description
class:`compas.geometry.Box`

The oriented bounding box of the element.

compute_point ¤
compute_point() -> Point

Compute the centroid point of the element.

Returns:

Type Description
class:`compas.geometry.Point`

The centroid point of the element's geometry.

compute_surface_mesh ¤
compute_surface_mesh(meshsize_min=None, meshsize_max=None) -> Mesh

Compute surface mesh - use the same geometry for now.

compute_volumetric_mesh ¤
compute_volumetric_mesh(meshsize_min=None, meshsize_max=None)

Compute volumetric mesh - not implemented for surface meshes.

from_points_and_vectors staticmethod ¤
from_points_and_vectors(p0: Point = Point(0, 0, 2500), v0: Vector = Vector(0, 0, 1), p1: Point = Point(2500, 0, 0), v1: Vector = Vector(1, 0, 0), dataset_foot: str = schoring_foot_0, dataset_head: str = schoring_head_0, dataset_body0: str = schoring_body_start_0, dataset_body1: str = schoring_body_end_0, dataset_hat: str = None, geometry_as_brep: bool = False)

Create SchoringElement instances for foot and head from given points and vectors.

from_points_and_vectors_no_foot_no_head staticmethod ¤
from_points_and_vectors_no_foot_no_head(p0: Point = Point(0, 0, 2500), v0: Vector = Vector(0, 0, 1), p1: Point = Point(2500, 0, 0), v1: Vector = Vector(1, 0, 0), dataset_body0: str = schoring_body_start_0, dataset_body1: str = schoring_body_end_0, dataset_hat: str = None, geometry_as_brep: bool = False)

Create SchoringElement instances for foot and head from given points and vectors.

polylines_to_models staticmethod ¤
polylines_to_models(lines_unordered, geometry_as_brep=False)

Create a SchoringElement model from a list of lines.