npm install github:MarquisNecrosis/SVGArea#main
You can use this page to try the algorithms.
This algorithm computes the area of merged polygons and can also create the merged polygon.
import { polygonIntersectionInSvg } from "svg-area-intersection"; polygonIntersectionInSvg(svgID, {show, redraw, color, opacity})
Where parameters are:
This algorithm simply computes all pixels inside polygons. It's raw and inefficient.
import { lazyStupidAreaCalculation } from "svg-area-intersection/heuristic"; lazyStupidAreaCalculation(svgID)
import { areaInSvgWithIntersection } from "svg-area-intersection/heuristic"; areaInSvgWithIntersection(svgID, numberOfRandomPoints)