Skip to content

Delaunay triangulation implementation written in Swift

License

Notifications You must be signed in to change notification settings

008v/DelaunayTriangulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DelaunayTriangulation

Delaunay triangulation implementation written in Swift

Example

/* Make points. */
let points = generateVertices(maxX: UInt32(view.bounds.size.width), maxY: UInt32(view.bounds.size.height), count: 1000)

/* Make triangles. */
let triangles = Delaunay().triangulate(points)

/* Render to the screen. */
for triangle in triangles {
let shape = CAShapeLayer()
shape.path = triangle.toPath()
shape.fillColor = UIColor.clear.cgColor
shape.strokeColor = UIColor.blue.cgColor
shape.lineJoin = CAShapeLayerLineJoin.round
shape.lineCap = CAShapeLayerLineCap.round
shape.lineWidth = 0.5
view.layer.addSublayer(shape)
}

About

Delaunay triangulation implementation written in Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages