Skip to content

Commit

Permalink
Improved 'pana' score
Browse files Browse the repository at this point in the history
  • Loading branch information
JaffaKetchup committed Aug 4, 2023
1 parent 88503f1 commit 84cf401
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Ear-clipping (earcutting) triangulation algorithm, ported (with minor API differ

## The Algorithm

The library implements a modified ear slicing algorithm, optimized by [z-order curve](http://en.wikipedia.org/wiki/Z-order_curve) hashing and extended to handle holes, twisted polygons, degeneracies and self-intersections in a way that doesn't _guarantee_ correctness of triangulation, but attempts to always produce acceptable results for practical data.
The library implements a modified ear slicing algorithm, optimized by [z-order curve](https://en.wikipedia.org/wiki/Z-order_curve) hashing and extended to handle holes, twisted polygons, degeneracies and self-intersections in a way that doesn't _guarantee_ correctness of triangulation, but attempts to always produce acceptable results for practical data.

It's based on ideas from [FIST: Fast Industrial-Strength Triangulation of Polygons](http://www.cosy.sbg.ac.at/~held/projects/triang/triang.html) by Martin Held and[Triangulation by Ear Clipping](http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf) by David Eberly.
It's based on ideas from [FIST: Fast Industrial-Strength Triangulation of Polygons](https://www.cosy.sbg.ac.at/~held/projects/triang/triang.html) by Martin Held and[Triangulation by Ear Clipping](https://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf) by David Eberly.
7 changes: 2 additions & 5 deletions lib/dart_earcut.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'dart:math';
/// Earcutting triangulation algorithm, ported (with minor API differences) from
/// [earcut4j/earcut4j](https://github.com/earcut4j/earcut4j) and
/// [mapbox/earcut](https://github.com/mapbox/earcut).
final class Earcut {
abstract final class Earcut {
/// Triangulates the given polygon
///
/// [polygonVertices] should be a list of all the [Point]s defining
Expand Down Expand Up @@ -819,7 +819,7 @@ final class Earcut {
}
}

class _Node {
final class _Node {
int i;
double x;
double y;
Expand All @@ -833,7 +833,4 @@ class _Node {
_Node(this.i, this.x, this.y)
: z = 4.9E-324,
steiner = false;

@override
String toString() => 'i: $i, x: $x, y: $y, prev: $prev, next: $next';
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dart_earcut
description: Performant triangulation algorithm based on https://github.com/mapbox/earcut
version: 1.0.0
version: 1.0.1
repository: https://github.com/JaffaKetchup/dart_earcut

environment:
Expand Down

0 comments on commit 84cf401

Please sign in to comment.