A JavaScript library for 2D geometry manipulation, supporting shapes like points, lines, circles, polygons, and spatial queries.
Flatten-js is a comprehensive JavaScript library for creating and manipulating abstract 2D geometric shapes such as points, vectors, lines, circles, arcs, and polygons. It enables complex spatial operations like finding intersections, calculating distances, applying affine transformations, and performing boolean operations, making it essential for applications requiring precise geometric computations.
Developers and engineers working on applications that require robust 2D geometric computations, such as CAD software, GIS systems, game development, data visualization (e.g., with D3.js), and computational geometry algorithms.
Developers choose Flatten-js because it provides a complete, framework-agnostic toolkit for 2D geometry with mathematical accuracy, supports efficient spatial queries via Planar Set, includes advanced features like DE-9IM spatial relationship analysis and SVG visualization, and offers full JSON serialization for all shape objects.
Javascript library for 2d geometry
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports a wide range of 2D primitives including points, vectors, lines, circles, arcs, and multi-polygons, as listed in the README's key features.
Implements boolean operations using Weiler-Atherton clipping and DE-9IM spatial relationship analysis, enabling complex computations like intersection detection and polygon manipulation.
Includes a Planar Set container for fast rectangular spatial searches, which is essential for handling large datasets in applications like GIS or CAD.
Focuses on geometric accuracy without tying to a specific visualization framework, offering SVG methods for easy integration with libraries like D3.js, as noted in the philosophy section.
Provides only basic SVG output via svg() methods, requiring additional work for complex rendering or integration with other graphics libraries, which the README admits by not focusing on visualization.
Polygons must be valid with proper orientation and no self-intersections for boolean operations, placing the burden on users to ensure correctness, as highlighted in the polygon validity checks.
Tutorials are primarily on Observable notebooks, and understanding advanced concepts like DE-9IM can be challenging for developers without a background in computational geometry.