Skip to content

Object creation

The starting point for working with Pyomeca is to create an object with one of the specific methods associated with the different classes available:

api

Pyomeca offers several ways to create these objects: from scratch, from random data, from files or from other data structures.

From scratch

The first way to create a data array in Pyomeca is to directly specify the data.

Example

/api/angles/#pyomeca.angles.Angles

/api/markers/#pyomeca.markers.Markers

/api/rototrans/#pyomeca.rototrans.Rototrans

/api/analogs/#pyomeca.analogs.Analogs

From random data

We occasionally want to quickly create an object to test implementations or prototype new features. In this case, we could simply use random numerical values. Pyomeca offers a method for directly creating objects from random data.

Example

/api/angles/#pyomeca.angles.Angles.from_random_data

/api/markers/#pyomeca.markers.Markers.from_random_data

/api/rototrans/#pyomeca.rototrans.Rototrans.from_random_data

/api/analogs/#pyomeca.analogs.Analogs.from_random_data

From files

Most of the time, we want to create objects from files collected during experimentation. Pyomeca supports most of the formats used in biomechanics.

Note

Pyomeca does not support a format you need? You can inform us by opening an issue or even submit a pull request to make your implementation available to the whole community!

Example

/api/markers/#pyomeca.markers.Markers.from_c3d

/api/analogs/#pyomeca.analogs.Analogs.from_c3d

Example

/api/markers/#pyomeca.markers.Markers.from_csv

/api/analogs/#pyomeca.analogs.Analogs.from_csv

Example

/api/markers/#pyomeca.markers.Markers.from_excel

/api/analogs/#pyomeca.analogs.Analogs.from_excel

Example

/api/analogs/#pyomeca.analogs.Analogs.from_mot

Example

/api/markers/#pyomeca.markers.Markers.from_trc

Example

/api/analogs/#pyomeca.analogs.Analogs.from_sto

From other data structures

We often have to switch between different representations of the same data. Pyomeca implements different matrix manipulation routines such as getting Euler angles or a marker to/from a rototranslation matrix.

Angles & Rototrans

Example

/api/angles/#pyomeca.angles.Angles.from_rototrans

/api/rototrans/#pyomeca.rototrans.Rototrans.from_euler_angles

Markers & Rototrans

Example

/api/markers/#pyomeca.markers.Markers.from_rototrans

/api/rototrans/#pyomeca.rototrans.Rototrans.from_markers

Processed Rototrans

Example

/api/rototrans/#pyomeca.rototrans.Rototrans.from_transposed_rototrans

/api/rototrans/#pyomeca.rototrans.Rototrans.from_averaged_rototrans