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

Proposal for what to do with this code #20

Open
Tracked by #11
almarklein opened this issue Sep 29, 2023 · 3 comments
Open
Tracked by #11

Proposal for what to do with this code #20

almarklein opened this issue Sep 29, 2023 · 3 comments

Comments

@almarklein
Copy link
Member

Purpose

The purpose of this code is to provide:

  • A data structure (DynamicMesh) that represents a mesh that can be modified in-place, while effectively tracking the changes.
  • A library of (low-level) functions to measure things on a mesh or calculate specific changes to apply to a mesh.
  • High level interaction (in the form of examples?) to perform specific tasks, at this point limited to mesh morphing.

Main code

I propose to keep the main code in a separate repo, and release it as a separate library. One reason being that at some points we're close to hit the performance boundary of using pure Python, so it's not unlikely that we want to implemen Cythonized code paths for some tasks later.

Code that can be put somewhere else

  • The DynamicMeshGeometry inherits from gfx.Geometry and the gfxmorph.MeshChangeTracker. It's place seems more natural here.
  • The smooth_sphere_geometry seems like a shape worth having in pygfx, since it represents a smooth sphere with few vertices. The solid_tetrahedon is less useful for visualization.
  • The volume_of_triangle and volume_of_closed_mesh could be put into pylinalg, but are also very much specific to meshes, so I'm now leaning more towards keeping them here.
@almarklein almarklein mentioned this issue Sep 29, 2023
18 tasks
@Korijn
Copy link

Korijn commented Sep 29, 2023

I'd say we can find more of these fundamental computational geometry functions such as volume_of_triangle and volume_of_closed_mesh in gfxmorph, but also in pygfx actually (e.g. to compute vertex and face normals), and we can put all of those together in a new library "pycompgeo", like we discussed a while ago.

This will improve code organization across the board and make it easier to optimize those functions, e.g. using cython.

@Korijn
Copy link

Korijn commented Sep 29, 2023

Otherwise I agree with your suggestions! 😅

@almarklein
Copy link
Member Author

With pygfx/pycompgeo#1, the above mentioned functions all move to pycompgeo instead 😃

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