GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.31k stars 387 forks source link

Convex Hull node #1673

Open Kakapio opened 3 months ago

Kakapio commented 3 months ago

This node should convert vector shapes into convex hulls of their shapes, preserving their convex curves and bridging their concave parts with straight lines.

@Keavon Just wanted a run-down of how you want this to work. I'll be implementing a standard algorithm but wanted to ask if you had any specific functionality in mind.

~~Edit: Information for whoever wants to tackle this task:~~

While there is plenty of literature about building the convex hull from polygons (polylines), there is much less on the internet about algorithms for doing that from bezier curves. You'll have to do some additional research to solve this, either through Googling for online resources or reading academic papers or thinking through a solution to the problem yourself as an extension of one of the polyline algorithms. The same algorithm needs to work for both shapes such as a hexagon and a circle.

0HyperCube commented 3 months ago

@Kakapio creating a convex hull from points is reasonably well explored e.g. gift wrap algorithm.

Kakapio commented 3 months ago

@Kakapio creating a convex hull from points is reasonably well explored e.g. gift wrap algorithm.

Sorry, I think my initial post was a little unclear. I was more asking if there was any specific functionality the team wanted? If not, I'll just go ahead and implement it.

0HyperCube commented 3 months ago

I would expect there to be a node with some vector data to be passed in containing some points and some vector data containing a region that is the convex hull to be output.

Keavon commented 3 months ago

This task is free.