#!/usr/bin/env node "use strict"; const fs = require("fs"); const path = require("path"); const { turnLaneArrows: { templateFor } } = require("@osm-asset/road-compiler"); const output = path.resolve(process.argv[2] || path.join("outputs", "turn-lane-arrow-samples.svg")); const DISPLAY_SCALE = 60; const samples = [{ id: "right", label: "right" }, { id: "through;right", label: "through;right" }]; const cells = samples.map((sample, index) => { const x = 95 + index * 190; const polygons = templateFor(sample.id).map((ring) => { const points = ring.map(([right, forward]) => `${x + right * DISPLAY_SCALE},${185 - forward * DISPLAY_SCALE}`).join(" "); return ``; }).join(""); return `${polygons}${sample.label}`; }).join(""); const svg = `${cells}\n`; fs.mkdirSync(path.dirname(output), { recursive: true }); fs.writeFileSync(output, svg); console.log(`TURN_LANE_ARROW_SAMPLES ${output}`);