├── .babelrc ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── biome.json ├── index.js ├── package.json ├── pnpm-lock.yaml ├── src ├── algorithms │ ├── booleanOperations.ts │ ├── distance.ts │ ├── intersection.ts │ ├── ray_shooting.ts │ └── relation.ts ├── classes │ ├── Arc.ts │ ├── Bezier.ts │ ├── Box.ts │ ├── Circle.ts │ ├── Edge.ts │ ├── Face.ts │ ├── Inversion.ts │ ├── Line.ts │ ├── Matrix.ts │ ├── Multiline.ts │ ├── Path.ts │ ├── Point.ts │ ├── Polygon.ts │ ├── Quadratic.ts │ ├── Ray.ts │ ├── Rect.ts │ ├── RoundedRect.ts │ ├── Segment.ts │ ├── Shape.ts │ ├── Vector.ts │ ├── curves.ts │ └── index.ts ├── data_structures │ ├── PlanarSet.ts │ ├── circular_linked_list.ts │ ├── de9im.ts │ ├── interval-tree │ │ ├── classes │ │ │ ├── interval.ts │ │ │ ├── intervalTree.ts │ │ │ └── node.ts │ │ ├── index.ts │ │ ├── tsconfig.json │ │ └── utils │ │ │ └── constants.ts │ ├── linked_list.ts │ └── smart_intersections.ts ├── index.ts ├── svg │ ├── index.ts │ ├── parseFromPath.ts │ └── stringify.ts └── utils │ ├── attributes.ts │ ├── constants.ts │ ├── errors.ts │ ├── lerp.ts │ └── utils.ts ├── test ├── algorithms │ ├── boolean_op.js │ ├── ray_shooting.js │ └── relation.js ├── classes │ ├── arc.js │ ├── box.js │ ├── circle.js │ ├── face.js │ ├── inversion.js │ ├── line.js │ ├── matrix.js │ ├── multiline.js │ ├── point.js │ ├── polygon.js │ ├── ray.js │ ├── segment.js │ └── vector.js ├── data_structures │ ├── de9im.js │ ├── linked_list.js │ └── planar_set.js ├── flatten.js ├── tolerance.js └── utils │ └── attributes.js └── tsconfig.json /.babelrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/.babelrc -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/.gitignore -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | ./test 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/README.md -------------------------------------------------------------------------------- /biome.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/biome.json -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/index.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/package.json -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/pnpm-lock.yaml -------------------------------------------------------------------------------- /src/algorithms/booleanOperations.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/algorithms/booleanOperations.ts -------------------------------------------------------------------------------- /src/algorithms/distance.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/algorithms/distance.ts -------------------------------------------------------------------------------- /src/algorithms/intersection.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/algorithms/intersection.ts -------------------------------------------------------------------------------- /src/algorithms/ray_shooting.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/algorithms/ray_shooting.ts -------------------------------------------------------------------------------- /src/algorithms/relation.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/algorithms/relation.ts -------------------------------------------------------------------------------- /src/classes/Arc.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Arc.ts -------------------------------------------------------------------------------- /src/classes/Bezier.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Bezier.ts -------------------------------------------------------------------------------- /src/classes/Box.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Box.ts -------------------------------------------------------------------------------- /src/classes/Circle.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Circle.ts -------------------------------------------------------------------------------- /src/classes/Edge.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Edge.ts -------------------------------------------------------------------------------- /src/classes/Face.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Face.ts -------------------------------------------------------------------------------- /src/classes/Inversion.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Inversion.ts -------------------------------------------------------------------------------- /src/classes/Line.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Line.ts -------------------------------------------------------------------------------- /src/classes/Matrix.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Matrix.ts -------------------------------------------------------------------------------- /src/classes/Multiline.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Multiline.ts -------------------------------------------------------------------------------- /src/classes/Path.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Path.ts -------------------------------------------------------------------------------- /src/classes/Point.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Point.ts -------------------------------------------------------------------------------- /src/classes/Polygon.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Polygon.ts -------------------------------------------------------------------------------- /src/classes/Quadratic.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Quadratic.ts -------------------------------------------------------------------------------- /src/classes/Ray.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Ray.ts -------------------------------------------------------------------------------- /src/classes/Rect.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Rect.ts -------------------------------------------------------------------------------- /src/classes/RoundedRect.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/RoundedRect.ts -------------------------------------------------------------------------------- /src/classes/Segment.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Segment.ts -------------------------------------------------------------------------------- /src/classes/Shape.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Shape.ts -------------------------------------------------------------------------------- /src/classes/Vector.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/Vector.ts -------------------------------------------------------------------------------- /src/classes/curves.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/curves.ts -------------------------------------------------------------------------------- /src/classes/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/classes/index.ts -------------------------------------------------------------------------------- /src/data_structures/PlanarSet.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/PlanarSet.ts -------------------------------------------------------------------------------- /src/data_structures/circular_linked_list.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/circular_linked_list.ts -------------------------------------------------------------------------------- /src/data_structures/de9im.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/de9im.ts -------------------------------------------------------------------------------- /src/data_structures/interval-tree/classes/interval.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/interval-tree/classes/interval.ts -------------------------------------------------------------------------------- /src/data_structures/interval-tree/classes/intervalTree.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/interval-tree/classes/intervalTree.ts -------------------------------------------------------------------------------- /src/data_structures/interval-tree/classes/node.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/interval-tree/classes/node.ts -------------------------------------------------------------------------------- /src/data_structures/interval-tree/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/interval-tree/index.ts -------------------------------------------------------------------------------- /src/data_structures/interval-tree/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/interval-tree/tsconfig.json -------------------------------------------------------------------------------- /src/data_structures/interval-tree/utils/constants.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/interval-tree/utils/constants.ts -------------------------------------------------------------------------------- /src/data_structures/linked_list.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/linked_list.ts -------------------------------------------------------------------------------- /src/data_structures/smart_intersections.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/data_structures/smart_intersections.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/svg/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/svg/index.ts -------------------------------------------------------------------------------- /src/svg/parseFromPath.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/svg/parseFromPath.ts -------------------------------------------------------------------------------- /src/svg/stringify.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/svg/stringify.ts -------------------------------------------------------------------------------- /src/utils/attributes.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/utils/attributes.ts -------------------------------------------------------------------------------- /src/utils/constants.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/utils/constants.ts -------------------------------------------------------------------------------- /src/utils/errors.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/utils/errors.ts -------------------------------------------------------------------------------- /src/utils/lerp.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/utils/lerp.ts -------------------------------------------------------------------------------- /src/utils/utils.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/src/utils/utils.ts -------------------------------------------------------------------------------- /test/algorithms/boolean_op.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/algorithms/boolean_op.js -------------------------------------------------------------------------------- /test/algorithms/ray_shooting.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/algorithms/ray_shooting.js -------------------------------------------------------------------------------- /test/algorithms/relation.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/algorithms/relation.js -------------------------------------------------------------------------------- /test/classes/arc.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/arc.js -------------------------------------------------------------------------------- /test/classes/box.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/box.js -------------------------------------------------------------------------------- /test/classes/circle.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/circle.js -------------------------------------------------------------------------------- /test/classes/face.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/face.js -------------------------------------------------------------------------------- /test/classes/inversion.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/inversion.js -------------------------------------------------------------------------------- /test/classes/line.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/line.js -------------------------------------------------------------------------------- /test/classes/matrix.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/matrix.js -------------------------------------------------------------------------------- /test/classes/multiline.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/multiline.js -------------------------------------------------------------------------------- /test/classes/point.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/point.js -------------------------------------------------------------------------------- /test/classes/polygon.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/polygon.js -------------------------------------------------------------------------------- /test/classes/ray.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/ray.js -------------------------------------------------------------------------------- /test/classes/segment.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/segment.js -------------------------------------------------------------------------------- /test/classes/vector.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/classes/vector.js -------------------------------------------------------------------------------- /test/data_structures/de9im.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/data_structures/de9im.js -------------------------------------------------------------------------------- /test/data_structures/linked_list.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/data_structures/linked_list.js -------------------------------------------------------------------------------- /test/data_structures/planar_set.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/data_structures/planar_set.js -------------------------------------------------------------------------------- /test/flatten.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/flatten.js -------------------------------------------------------------------------------- /test/tolerance.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/tolerance.js -------------------------------------------------------------------------------- /test/utils/attributes.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/test/utils/attributes.js -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romgrk/2d-geometry/HEAD/tsconfig.json --------------------------------------------------------------------------------