Mechaphlowers Coordinates System
Mechaphlowers provides a set of tools to handle coordinates in 3D space.
The philosophy is to store the same objects with the same resolution as layers of a coordinate system. In this way, calculations can be performed on all layers at once.
Formats
There are three format used:
- Vectors: A tuple of three 2D numpy arrays, each representing the x, y, and z coordinates of a set of points. The shape of each array is (number of layers, number of points).
- Coordinates: A 3D numpy arrays with shape (number of layers, number of points, 3), where the last dimension represents the x, y, and z coordinates of each point.
- Points: A 2D numpy array with shape (number of points, 3). The points are a flattened version of the coordinates array, where each row is a point (x, y, z). The points loose the layer information.
Note
The points format can be generated with a stack_nan option, which stacks the points of all layers on top of each other, separated by NaN. In this way, scatters of each objects can be plotted separately in a single plot. And the layers are preserved.

Provided classes
Points
The Points class is used to handle a set of points in 3D space. It provides methods to convert the coordinates to vectors, points, and to create a Points object from vectors or coordinates.
Inside, the data are stored as coordinates, which are more convenient to manipulate.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
CoordsCalculator
The CoordsCalculator class is used to handle all the points of a section.
It is useful to get the points of a section in a specific format.
The class provides helpers to get the points in different frames:
- cable frame
- localsection frame
- support frame
- section frame
Warning
For the moment only the spans are available in different frames. Insulators and supports are only available in the section frame.
To get the different section points, all you need is to input the section parameters, a span model to generate the span shape and use the getter methods.
You can also add a wind load using the beta parameter.
The span model can be changed using the init_span method.
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 47 48 | |
How does span engine work?
As you can see in the following graph, the span engine is generating the spans in the cable frame with origin at the lowest point of the span.
Then we change the spans generated from the cable frame to the crossarm frame and finally to the section frame.
You can click on the legend to hide successively the fourth steps of the span engine.
Note
The beta angle is set before the cable plane generation. That is why the spans in the first step are not in the same plane.