polygon_finder 1.0.3 copy "polygon_finder: ^1.0.3" to clipboard
polygon_finder: ^1.0.3 copied to clipboard

Library to help you to find the polygons from defined set of lines

example/polygon_finder_example.dart

import 'dart:math';

import 'package:polygon_finder/polygon_finder.dart';

void main() {
  final List<Line> lines = [
    Line(Point(0, 0), Point(2, 2)),
    Line(Point(1, 2), Point(1, 0)),
    Line(Point(-1, 0), Point(1, 0)),
  ];

  List<Polygon> polygons = PolygonFinder.polygonsFromSegments(lines);

  print('Number of polygons: ${polygons.length}');
  for (final polygon in polygons) {
    print(polygon); // POLYGON((1.0 1.0), (0.0 0.0), (1.0 0.0), (1.0 1.0))
  }
}
3
likes
150
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

Library to help you to find the polygons from defined set of lines

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection

More

Packages that depend on polygon_finder