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

Faces with holes #21

Open
edemaine opened this issue Jul 22, 2019 · 1 comment
Open

Faces with holes #21

edemaine opened this issue Jul 22, 2019 · 1 comment

Comments

@edemaine
Copy link
Owner

edemaine commented Jul 22, 2019

@amandaghassaei points out that the current spec does not deal with holes in faces (without subdividing them somehow), e.g.

+-----+
|     |
| +-+ |
| | | |
| +-+ |
|     |
+-----+

We should extend the spec to handle this. The tricky part is doing so in a backwards-compatible way.


Proposal 1:

  • faces_boundaries: for each face, list of boundaries, first of which is outside and rest are interior holes
  • boundaries_vertices/edges: counterclockwise (?) order of vertices/edges for the boundary, similar to current faces_vertices/edges
  • faces_vertices/edges: can still list all vertices/edges on boundary of face (union of face's boundaries), but order is no longer particularly useful.
  • When no boundaries listed, assume each face is a single boundary and already in ccw order. So this makes everything backward-compatible: when not using holes, can use FOLD as is, but when dealing with holes, work with boundaries structures instead of faces_vertices/edges.
  • frame_attributes of holey (?) and nonHoley (?) to specify whether boundaries are in use

The downside of this approach is unneeded complexity: boundaries don't really need to be first-class, because will generally be used by exactly one face.


Proposal 2:

  • faces_vertices becomes an array of array of vertex indices, one array per boundary, where first boundary is exterior and ccw, and other boundaries are holes and cw
  • faces_edges (optional) similarly becomes an array of array of edge indices

Key question for this approach: do we want v2 to allow both forms (each element of faces_vertices is an array of indices, or an array of array of indices), or just the hole-supporting form (each element of faces_vertices is an array of array of indices)?

@edemaine
Copy link
Owner Author

Update on this topic: FOLD 1.2 supports "J" assignment for join edges, which is one way to represent holes (subdividing holey faces into simply connected faces).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant