Skip to content

Different polygon slicing method #14

@luucvanderzee

Description

@luucvanderzee

To slice polygons into N pieces, we are using the same method as transformr and flubber, which is to

  1. triangulate a polygon
  2. take the smallest triangle (or, after some triangles have been merged, polygon)
  3. merge it with the first found neighbor
  4. compute area of the resulting polygon
  5. repeat step 2 - 4 until the number of polygons/triangles is equal to N

This is pretty slow. I wonder if there is a faster way to do this. PolyK seems to be able to slice polygons without triangulation (see this, doesn't support holes tho). If we could figure out a quick way to find a line that approximately cuts a polygon in half, we could just keep cutting the biggest polygon in half until we have the desired number of pieces N. I suspect that to be faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions