bmershon / scissors

Compute a scissors congruence layout for two polygons.
MIT License
7 stars 1 forks source link

cutCollection should be cutMesh? #48

Open bmershon opened 7 years ago

bmershon commented 7 years ago

One of the most obvious problems with cutting a soup of polygons is that newly created polygons will not share vertex references, if done naively (the current way). Other steps of the current pipeline take care to preserve exact vertex references, which goes a long way towards encoding a mesh.

Polygons are currently stored as "open polygons" with a bit of extra information (and some prototype methods for performing cloning, translations, scaling, rotations about a point, and so on). Perhaps polygons should be closed, where the first and last vertex are the same object (a reference to a two-element array representing the 2D coordinates of that vertex). The mesh will be implicitly stored in exact references shared by coincident vertices. There is redundancy in this encoding, but it seems like this could be used during the cutCollection part of the pipeline to ensure that all vertex references that can be shared are actually shared.

The machinery of encoding topology in a radically different data structure might be unnecessary.

bmershon commented 7 years ago

See in development example.