otherlab / geode

A computational geometry library for C++ and Python
Other
86 stars 22 forks source link

TriMesh and rendering #20

Open martinwicke opened 11 years ago

martinwicke commented 11 years ago

It is very unintuitive to work with TriMesh in scripts that render a lot because TriMesh loses normals in csg etc.

render_mesh could automatically add normals (if necessary to a copy). Or TriMesh could be forced to always have (up to date) normals (marked dirty and updated whenever accessed).

A BareTriMesh could be provided for space-critical tasks where a mesh without extra information is necessary.

girving commented 11 years ago

Deterministically computable normals (e.g., default vertex normals) can be computed on demand with an unimportant amount of space overhead when not used. However, it's probably worth a bit of thought as to how fields on meshes should be handled as a general principle without falling back to imperativeness.

martinwicke commented 11 years ago

I think this will effectively require our own implementation of a halfedge mesh with custom properties. And some thought.

Geoffrey Irving wrote:

Deterministically computable normals (e.g., default vertex normals) can be computed on demand with an unimportant amount of space overhead when not used. However, it's probably worth a bit of thought as to how fields on meshes should be handled as a general principle without falling back to imperativeness.

— Reply to this email directly or view it on GitHub https://github.com/otherlab/core/issues/20#issuecomment-12620285.