levskaya / polyhedronisme

A tool to construct and explore polyhedra.
http://levskaya.github.io/polyhedronisme/
MIT License
196 stars 29 forks source link

k3gaO --- faces have valley fold, but no indication in shading #2

Closed ghost closed 8 years ago

ghost commented 11 years ago

Hello,

Create a recipe: k3gaO

You'll notice that some of the faces do not look possible. Rotate the polyhedron so that you are looking at the face edge-on, and you will see that it, in fact, is two faces. However, the color and shading gives no indication of that.

levskaya commented 11 years ago

This is actually quite tricky. In the code I separated the topological operators from the geometrical operators, such that you can get meshes that have non-flat faces. Applying the 'C' operator will attempt to flatten the faces into a 'canonical' polyhedron. My rendering algorithm is a super simple vector projection of crudely z-ordered faces, so this is a weird artifact of doing simple projections of a non-flat face. Some of these distorted shapes look pretty, which is the only reason I don't force flattening on the user. It's always possible to force a triangulable mesh by applying the triangulation operator 'z', but it tends to distort these weirder polyhedra into less pleasing shapes.

The funny thing is that many of the distorted polyhedra do seem to be capable of being represented by flat tri/quad meshes... however the algorithm for resolving an aesthetically pleasing triangulation, as opposed to a random triangulation, is really quite subtle.