Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating an geometric model #191

Open
Moanalengkeek opened this issue Dec 22, 2023 · 1 comment
Open

Creating an geometric model #191

Moanalengkeek opened this issue Dec 22, 2023 · 1 comment

Comments

@Moanalengkeek
Copy link
Collaborator

Feature

This issue covers point 1 of issue #190.

Desired Behavior / Functionality

Adding a geometric model to the model. This is done with two options; option 1 is to model a basic cuboid with width, length, and height. Option 2 is to import an .obj file, and to use the mesh from that.
The outputs of the geometric model are currently planned to be the moments of inertia, and the center of gravity.

What Needs to Be Done

Several functions/classes will be created. Firstly, in the file actor_builder.py there will be a function set_cubiod_geometric_model to add then cuboid geometric model to the actor. There will also be a similar function, set_geometric_model_from_import for the option to import a mesh from the .obj file.
Then a new file is implemented, geometric_model.py, which contains two classes, CuboidGeomtericModel, and ImportGeometricModel. These two classes will each have the function to find the moment of inertia, and the centre of gravity. Additionally, the mass of the satellite is stored in the class.
Depending on what is needed for the disturbances that will be added, more parameters may need to be added to these two classes.

How Can It Be Tested

Lastly, two tests will be added in the file actor_builder_test.py. One to test the cuboid geometric model, and one to test the import. The import test contains the ability to view the imported model in the correct coordinate system.

@gomezzz
Copy link
Collaborator

gomezzz commented Dec 29, 2023

Option 2 is to import an .obj file, and to use the mesh from that.

Please avoid files, can just pass a mesh as two lists of vertices and faces as seen in trimesh example (since you added trimesh ;) )

the center of gravity.

You assume uniform density I presume? Just to check

Firstly, in the file actor_builder.py there will be a function set_cubiod_geometric_model to add then cuboid geometric model to the actor. There will also be a similar function, set_geometric_model_from_import for the option to import a mesh from the .obj file.

I would suggest to just have one function set_mesh(vertices,faces,scale=1) which defaults to a cube scaled by scale. It is more intuitive for users if there is exactly one functions that works the same way in both cases.

Then a new file is implemented, geometric_model.py, which contains two classes, CuboidGeomtericModel, and ImportGeometricModel. These two classes will each have the function to find the moment of inertia, and the centre of gravity.

ImportGeometricModel should not be necessary without files. The one I would call ActorGeometricModel and make it generically work for meshes (a cuboid is just a mesh of 8 point).

Additionally, the mass of the satellite is stored in the class.

Should be stored in the actor itself since other models use it too (e.g. thermal)

More comments to follow in the PR ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants