Geometry API: Structures

Module containing the data classes for the geometry module.

class owimetadatabase_preprocessor.geometry.structures.DataMat

Bases: TypedDict

title: str
slug: str
id: int64
description: str
young_modulus: float64
density: float64
poisson_ratio: float64
class owimetadatabase_preprocessor.geometry.structures.DataBB

Bases: TypedDict

id: int64
description: str
slug: str
alpha: float64
beta: float64
gamma: float64
x_position: float64
y_position: float64
z_position: float64
vertical_position_reference_system: str
title: str
height: float64
mass_distribution: float64
volume_distribution: float64
area_distribution: float64
c_d: float64
c_m: float64
sub_assembly: int64
projectsite_name: str
asset_name: str
subassembly_name: str
material_name: str
youngs_modulus: float64
density: float64
poissons_ratio: float64
bottom_outer_diameter: float64
top_outer_diameter: float64
wall_thickness: float64
material: float64
moment_of_inertia_x: float64
moment_of_inertia_y: float64
moment_of_inertia_z: float64
mass: float64
class owimetadatabase_preprocessor.geometry.structures.DataSA

Bases: TypedDict

id: int64
title: str
description: str
slug: str
x_position: float64
y_position: float64
z_position: float64
vertical_position_reference_system: str
subassembly_type: str
source: str
asset: int64
model_definition: int64
class owimetadatabase_preprocessor.geometry.structures.BaseStructure

Bases: object

Base class for all structures.

class owimetadatabase_preprocessor.geometry.structures.Material(json: DataMat)

Bases: BaseStructure

Material derived from the raw data.

__init__(json: DataMat) None

Create an instance of the Material class with the required parameters.

Parameters:

json – json data containing the material information.

Returns:

None

as_dict() Dict[str, str | float64]

Transform data into dictionary.

Returns:

Dictionary with the following keys:

  • ”title”: Name of the material.

  • ”description”: Description of the material.

  • ”poisson_ratio”: Poisson ratio of the material.

  • ”young_modulus”: Young modulus of the material.

class owimetadatabase_preprocessor.geometry.structures.Position(x: float64 = 0.0, y: float64 = 0.0, z: float64 = 0.0, alpha: float64 = 0.0, beta: float64 = 0.0, gamma: float64 = 0.0, reference_system: str = 'LAT')

Bases: BaseStructure

Position of the components.

__init__(x: float64 = 0.0, y: float64 = 0.0, z: float64 = 0.0, alpha: float64 = 0.0, beta: float64 = 0.0, gamma: float64 = 0.0, reference_system: str = 'LAT') None

Create an instance of the Position class with the required parameters.

Parameters:
  • x – X coordinate of the component.

  • y – Y coordinate of the component.

  • z – Z coordinate of the component.

  • alpha – Rotation around the x-axis.

  • beta – Rotation around the y-axis.

  • gamma – Rotation around the z-axis.

  • reference_system – Reference system for the vertical position.

Returns:

None

class owimetadatabase_preprocessor.geometry.structures.BuildingBlock(json: DataBB, subassembly: Any | None = None)

Bases: BaseStructure

Building blocks description.

__init__(json: DataBB, subassembly: Any | None = None) None

Create an instance of the BuildingBlock class with the required parameters.

Parameters:
  • json – json data containing the building block information.

  • subassembly – Subassembly object containing the building block.

Returns:

None

property type: str

Type of the building block.

property wall_thickness: float64 | None

Wall thickness of the building block (if exists), mm.

property bottom_outer_diameter: float64 | None

Bottom outer diameter of the building block (if exists), mm.

property top_outer_diameter: float64 | None

Top outer diameter of the building block (if exists), mm.

property diameter_str: str

Diameter of the building block as a string (if exists), mm.

property height: float64 | None

Height of the building block , mm.

property volume: float64 | None

Volume of the building block, m³.

property mass: float64

Mass of the building block, kg.

property moment_of_inertia: Dict[str, float64 | None]

Moment of inertia of the building block, kg*m². IMPORTANT! Only works for building blocks of the type lumped_mass.

Returns:

Dictionary containing the moment of inertia around the three axis, x,y,z

property outline: None | Tuple[List[float64], List[float64]]

Trace of the outlines.

Returns:

A tuple of two lists containing the x and corresponding z coordinates of the outline.

property marker: None | Dict[str, str | float64]

Indication for the lumped mass in the building block.

Returns:

Dictionary containing the x,y,z coordinates of the marker and the radius of the marker.

property line: None | Dict[str, List[float64] | str]

Line for the distributed mass in the building block.

Returns:

Dictionary containing the x,y,z coordinates of the line and the color of the line.

as_dict() Dict[str, str | float64 | Dict[str, float64 | None] | None]

Transform data into dictionary.

Returns:

Dictionary with the following keys:

  • ”title”: Name of the building block.

  • ”x”: X coordinate of the building block.

  • ”y”: Y coordinate of the building block.

  • ”z”: Z coordinate of the building block.

  • ”OD”: Outer diameter of the building block.

  • ”wall_thickness”: Wall thickness of the building block.

  • ”height”: Height of the building block.

  • ”volume”: Volume of the building block.

  • ”mass”: Mass of the building block.

  • ”moment_of_inertia”: Moment of inertia of the building block.

  • ”description”: Description of the building block.

class owimetadatabase_preprocessor.geometry.structures.SubAssembly(materials: DataFrame | bool | int64 | None, json: DataSA, api_object: Any | None = None)

Bases: BaseStructure

Subassemblies description.

__init__(materials: DataFrame | bool | int64 | None, json: DataSA, api_object: Any | None = None) None

Create an instance of the SubAssembly class with the required parameters.

Parameters:
  • materials – Pandas dataframe containing the material information.

  • json – json data containing the subassembly information.

  • api_object – API object to access the building blocks.

Returns:

None

property color: str

Color based on subassembly type.

property building_blocks: List[BuildingBlock] | None

Building blocks of the subassembly

Returns:

List of instances of building block class.

property height: float64

Height of the subassembly.

property mass: float64

Mass of the subassembly.

property properties: Dict[str, float64]

Mass and height of the subassembly.

property outline: Tuple[List[float64], List[float64]]

Defines the traces of the outline of the subassembly

Returns:

A tuple of two lists containing the x and corresponding z coordinates of the outline.

plot(x_offset: float64 = 0.0) None

Plot the subassembly.

plotly(x_offset: float64 = 0.0, y_offset: float64 = 0.0)

Plot the subassembly.

Parameters:
  • x_offset – Offset in the x direction.

  • y_offset – Offset in the y direction.

Returns:

Plotly data and layout.

as_df(include_absolute_postion: bool = False) DataFrame

Transform data into pandas dataframe.

Parameters:

include_absolute_postion – Include absolute position of the building blocks.

Returns:

Pandas dataframe with the building block information.

property absolute_bottom: float64

Absolute bottom of the subassembly, m.

property absolute_top: float64

Absolute top of the subassembly, m.