GeometryCollective / boundary-first-flattening

MIT License
768 stars 96 forks source link

Question for applicability as a geometry image #64

Open kingofthebongo2008 opened 4 years ago

kingofthebongo2008 commented 4 years ago

Hello, I am sorry to post here, Can i use this library to generate a geometry image of mesh? What restrictions i should put to the initial geometry? Here is a link to the paper, if you are not familiar. http://www.cs.harvard.edu/~sjg/papers/gim.pdf

keenancrane commented 4 years ago

Yep! Easily.

Just change the "Target Boundary" mode to "Set Boundary Angles" and pick four corners, setting each of their target angles to 0.5π. Then export the mesh. This will give you an OBJ file where the UV coordinates are all inside a rectangle. To get your geometry image, you now just have to draw these UV coordinates as a 2D mesh, where the (r,g,b) color of each vertex is set to the (x,y,z) coordinates from the original 3D coordinates.

Note that in general you'll get a rectangle, rather than a square. If you want a square, just scale the UV coordinates in the horizontal (or vertical) direction so that you have a square.

As noted in the original paper, the only restriction on the geometry is that your surface needs to be partitioned into a collection of disk-like pieces (so that you get one rectangle, or square, per piece).

image