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

Add support for meshes to primitive builders #33

Merged
merged 15 commits into from
May 16, 2024

Conversation

lorycontixd
Copy link
Contributor

This pull requests adds the possibility to build meshes by using trimesh.
It implements a MeshBuilder class which implements the calculation for the mesh's moment of inertia and its geometry.

Summary of changes:

  • Implement MeshBuilder object and override its inertia and geometry methods with a calculation using trimesh methods.
  • Implement tests on mesh-building.

src/rod/builder/primitives.py Outdated Show resolved Hide resolved
src/rod/builder/primitives.py Outdated Show resolved Hide resolved
src/rod/builder/primitives.py Outdated Show resolved Hide resolved
tests/test_meshbuilder.py Outdated Show resolved Hide resolved
src/rod/builder/primitives.py Show resolved Hide resolved
tests/test_meshbuilder.py Outdated Show resolved Hide resolved
tests/test_meshbuilder.py Outdated Show resolved Hide resolved
tests/test_meshbuilder.py Outdated Show resolved Hide resolved
Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last comments

Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now! Thanks @lorycontixd

Comment on lines 80 to 82
extension = self.mesh_path.split(".")[-1]
elif isinstance(self.mesh_path, pathlib.Path):
extension = self.mesh_path.suffix
extension = str(self.mesh_path).split(".")[-1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last curiosity, any specific reason to go back to string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was just not working without a suffix keyword for NamedTempFile. I can easily revert back.

@diegoferigo diegoferigo changed the title Add mesh support Add support for meshes to primitive builders May 16, 2024
@diegoferigo diegoferigo merged commit b7daaf7 into ami-iit:main May 16, 2024
20 checks passed
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

Successfully merging this pull request may close these issues.

3 participants