diff --git a/ArrowPoints.js b/ArrowPoints.js index d123fe6..e2c3f33 100644 --- a/ArrowPoints.js +++ b/ArrowPoints.js @@ -1,16 +1,16 @@ const canvas = document.getElementById("canvas"); // Compute arrow polygon -import { getArrowPolygon } from "./Arrow.js"; -import { ARROW_BODY_STYLE_CONSTANT, ARROW_BODY_STYLE_LINEAR, ARROW_BODY_STYLE_EXPONENTIAL } from "./Arrow.js"; -import { getCirclePolygon } from "./BasicShapes.js"; -import { getRectanglePolygon } from "./BasicShapes.js"; -import { getFrontline } from "./Frontline.js"; -import { LEFT_SIDE, RIGHT_SIDE, BOTH_SIDES } from "./Frontline.js"; +import { getArrowPolygonEuclidean } from "athena-utils/shape/Arrow.js"; +import { ARROW_BODY_STYLE_CONSTANT, ARROW_BODY_STYLE_LINEAR, ARROW_BODY_STYLE_EXPONENTIAL } from "athena-utils/shape/Arrow.js"; +import { getCirclePolygonEuclidean } from "athena-utils/shape/BasicShapes.js"; +import { getRectanglePolygonEuclidean } from "athena-utils/shape/BasicShapes.js"; +import { getFrontline } from "athena-utils/shape/Frontline.js"; +import { LEFT_SIDE, RIGHT_SIDE, BOTH_SIDES } from "athena-utils/shape/Frontline.js"; // Polygon merge using Turf library -import {mergeTurfPolygons} from "./Polygon.js"; -import {addTurfPolygonToMerge} from "./Polygon.js"; -import {toTurfPolygon} from "./Polygon.js"; -import {drawPolygon} from "./PolygonVisuals.js"; +import {mergeTurfPolygons} from "athena-utils/shape/Polygon.js"; +import {addTurfPolygonToMerge} from "athena-utils/shape/Polygon.js"; +import {toTurfPolygon} from "athena-utils/shape/Polygon.js"; +import {drawPolygon} from "athena-utils/shape/PolygonVisuals.js"; const circleCenter = {x:320, y:180}; const circleRadius = 70; @@ -154,13 +154,13 @@ const arrowDataA = { }; -const arrowPolygonA = getArrowPolygon(arrowDataA, styleA, arrowHeadDataA); -const arrowPolygonB = getArrowPolygon(arrowDataB, styleB, arrowHeadDataB); -const arrowPolygonC = getArrowPolygon(arrowDataC, styleC); +const arrowPolygonA = getArrowPolygonEuclidean(arrowDataA, styleA, arrowHeadDataA); +const arrowPolygonB = getArrowPolygonEuclidean(arrowDataB, styleB, arrowHeadDataB); +const arrowPolygonC = getArrowPolygonEuclidean(arrowDataC, styleC); -const circlePolygon = getCirclePolygon(circleCenter, circleRadius, circleDensity); -const circlePolygonB = getCirclePolygon(circleCenterB, circleRadiusB, circleDensityB); -const rectanglePolygon = getRectanglePolygon(rectangleCenter, rectangleSideA, rectangleSideB, rectangleRotation); +const circlePolygon = getCirclePolygonEuclidean(circleCenter, circleRadius, circleDensity); +const circlePolygonB = getCirclePolygonEuclidean(circleCenterB, circleRadiusB, circleDensityB); +const rectanglePolygon = getRectanglePolygonEuclidean(rectangleCenter, rectangleSideA, rectangleSideB, rectangleRotation); const mergedTurfPoly = mergeTurfPolygons(arrowPolygonA, arrowPolygonC); const mergedTurfPolyAll = addTurfPolygonToMerge(mergedTurfPoly, arrowPolygonB); @@ -168,7 +168,7 @@ const mergedTurfPolyAll = addTurfPolygonToMerge(mergedTurfPoly, arrowPolygonB); const mergedTurfPolyRectangle = addTurfPolygonToMerge(mergedTurfPolyAll, rectanglePolygon); const mergedRectangle = mergeTurfPolygons(circlePolygon, circlePolygonB); -const rectanglePoly = getRectanglePolygon(circleCenter, rectangleSideA, rectangleSideB, rectangleRotation*-1); +const rectanglePoly = getRectanglePolygonEuclidean(circleCenter, rectangleSideA, rectangleSideB, rectangleRotation*-1); const rectangleToTurfPoly = toTurfPolygon(rectanglePoly); const frontlinePolygonA = getFrontline(frontlineDataA); diff --git a/index.html b/index.html index 3a82005..3c3b183 100644 --- a/index.html +++ b/index.html @@ -1,3 +1,6 @@ + @@ -15,4 +18,24 @@ body { margin: 0; padding: 0; }
- \ No newline at end of file + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d8fedb9..c78ee40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2718,7 +2718,7 @@ "dev": true }, "node_modules/athena-utils": { - "resolved": "git+https://git.projectathena.ca/andyaxxe/athena-utils.git#904b62b360", + "resolved": "git+https://git.projectathena.ca/andyaxxe/athena-utils.git#284cea819e", "dev": true, "dependencies": { "@turf/turf": "7.2.0"