SkillAgentSearch skills...

Edgy

Objective-C library for Delaunay Triangulation/Voronoi Diagram generation and Natural Neighbor Interpolation.

Install / Use

/learn @mrotondo/Edgy
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Edgy does 3 things:

Delaunay Triangulations

<pre> #import "DelaunayTriangulation.h" DelaunayTriangulation *triangulation = [DelaunayTriangulation triangulationWithSize:CGSizeMake(1000, 1000)]; UITouch *touch = (UITouch *)[touches anyObject]; CGPoint loc = [touch locationInView:self.view]; DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; [self.triangulation addPoint:newPoint]; </pre>

Voronoi Diagrams

<pre> NSDictionary *voronoiCells = [self.triangulation voronoiCells]; </pre>

Natural Neighbor Interpolation

<pre> UITouch *touch = (UITouch *)[touches anyObject]; CGPoint loc = [touch locationInView:self.view]; DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; [self.triangulation interpolateWeightsWithPoint:newPoint]; </pre>

After interpolateWeightsWithPoint is called, each DelaunayPoint in the DelaunayTriangulation object's points set will have a contribution property that is between [0, 1] and represents the weight of that point's contribution to the output at the interpolated point.

License

Code is under the Creative Commons Attribution 3.0 Unported license.

View on GitHub
GitHub Stars25
CategoryDevelopment
Updated5y ago
Forks9

Languages

Objective-C

Security Score

60/100

Audited on Dec 22, 2020

No findings