shapes
SupportShape
SupportShape(
name: str,
xyz_arms: ndarray,
set_number: ndarray,
ground_point: ndarray = array([0, 0, 0]),
arms_length: ndarray | None = None,
)
Support shape class enables to store a support complete "set" representation. The support is then represented by a set of arms, each arm being represented by x,y,z coordinate. Assumption for the representation:
1 2 3 4 | |
The class supposes the support centered with origin at the support ground. However, the ground origin can be moved by user.
Usages: generated with support catalog, and use plotting.plot_support_shape to visualize.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
support name |
required |
|
ndarray
|
(n, 3) array with x,y,z set point coordinates in the support frame (n is the number of arms) |
required |
|
ndarray
|
(n,) array with the set numbers |
required |
|
ndarray
|
ground point of the support. Defaults to np.array([0, 0, 0]). |
array([0, 0, 0])
|
|
ndarray | None
|
(n,) array with the arms lengths. Defaults to None means the amrs are the norm of x,y values |
None
|
Source code in src/mechaphlowers/entities/shapes.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
arms_points
property
arms_points: ndarray
arms_points
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (3*n, 3) array with the points of the arms of the support in points format |
arms_set_points
property
arms_set_points: ndarray
arms_set_points
Support shape can have X coordinates different from 0, which means several set points for the same arm. This property returns the points of the arms of the support in points format.
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (3*n, 3) with n the number on nonzero values on the X coordinates of the arms of the support. If n=0 returns array([np.nan, np.nan, np.nan]) |
labels_points
property
labels_points: ndarray
labels_points
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (n,) array with set numbers of the arms of the support |
support_points
property
support_points: ndarray
support_points
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: ( (n+1)*3, 3) array with the points of the trunk of the support in points format |
trunk_points
property
trunk_points: ndarray
trunk_points
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (2, 3) array with the points of the trunk of the support in points format |
from_dataframe
staticmethod
from_dataframe(df: DataFrame) -> list[SupportShape]
from_dataframe allows to generate a list of SupportShape object from a dataframe
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DataFrame
|
description |
required |
Raises:
| Type | Description |
|---|---|
IndexError
|
if the dataframe has no index |
Returns:
| Type | Description |
|---|---|
list[SupportShape]
|
list[SupportShape]: list of SupportShape objects |
Source code in src/mechaphlowers/entities/shapes.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | |