Skip to content

🤖 A Swift port of Mapbox's earcut.js library

License

MIT, ISC licenses found

Licenses found

MIT
LICENSE
ISC
LICENSE.mapbox
Notifications You must be signed in to change notification settings

measuredweighed/SwiftEarcut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftEarcut

A Swift port of Mapbox's earcut.js polygon triangulation library.

Table of Contents

  1. License
  2. Installation
  3. Documentation
  4. Quick Start

License

Mapbox's earcut.js is governed by an ISC license while this Swift port is governed by an MIT license.

Installation

Swift Package Manager

Add the following dependency

.package(url: "https://github.com/measuredweighed/SwiftEarcut.git", from: "1.0.0"),

Documentation

Comprehensive documentation for SwiftEarcut can be found on the Swift Package Index (click on Documentation).

Quick Start

Pass Earcut a flat array of vertex coordinates and optionally include an array of hole indices, and the tesselate function will return a flat array of triangle indices.

let result = Earcut.tesselate(data: [10, 0, 0, 50, 60, 60, 70, 10])

// result: [1, 0, 3, 3, 2, 1]

About

🤖 A Swift port of Mapbox's earcut.js library

Topics

Resources

License

MIT, ISC licenses found

Licenses found

MIT
LICENSE
ISC
LICENSE.mapbox

Stars

Watchers

Forks

Packages

No packages published

Languages