Skip to content

Instantly share code, notes, and snippets.

@mattexdee
mattexdee / drawings-to-walls.js
Last active October 20, 2023 11:14 — forked from schultzcole/drawings-to-walls.js
A macro script to convert polygonal drawings to walls
let drawings = canvas.drawings.controlled;
drawings = drawings.map(drawing =>{
switch (drawing.data.type) {
case "f":
case "p": {
let { _id, points, rotation, x, y, width, height } = drawing.data;
return { id: _id, valid: true, points, rotation, x, y, width, height };
}
case "r": {