Turfjs / Turfjs/turf

Unkinking self crossing shape fills in holes

Open
#1,824 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

@turf/unkink-polygon
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

Starting with a shape such as this: gist

Screen Shot 2020-01-22 at 5 28 17 PM

Unkinking this shape will fill in that center hole: runkit

This has to do with the way simplepolygon unwinds self intersecting shapes. Essentially that center shape, is supposed to be a hole in one of the upper shapes I believe.

Heres a gist with the resulting shape in case the runkit doesnt work

Screen Shot 2020-01-22 at 5 31 48 PM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the self-crossing shape from the linked gist and RunKit example, then trace the simplepolygon unwinding behavior that turns the center hole into a fill. Compare the resulting geometry with the expected hole-preserving shape shown in the issue; done means unkinking retains that center hole.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.