Skip to content

Larpon/earcut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

earcut

A hand-ported V version of mapbox/earcut.

The implementation is currently based on commit f40dd2

Example

module main

import earcut

fn main() {
	flat := earcut.flatten(v_logo)
	vertices := flat.vertices
	holes := flat.holes
	indicies := earcut.earcut(vertices, holes, 2)
	println(indicies)
	println(earcut.deviation(vertices, holes, 2, indicies))
}

const (
	v_logo = [[
		[f32(1), 1], [f32(3.5), 1.4],
		[f32(5), 6],
		[f32(6.5), 1.4], [f32(9), 1],
		[f32(6), 9], [f32(4), 9],
	]]
)

About

Hand-ported (near 1:1) V version of https://github.com/mapbox/earcut

Resources

License

MIT, ISC licenses found

Licenses found

MIT
LICENSE
ISC
LICENSE.mapbox

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages