done converting coordinates to triangles for exporting (but I still need header and footer for that)

This commit is contained in:
2025-07-12 19:00:24 +01:00
parent 1fb6b43ac3
commit 9a748c8e0d
3 changed files with 16 additions and 8 deletions

BIN
dotscape

Binary file not shown.

View File

@@ -12,14 +12,14 @@ struct
, right, top , right, top
] ]
fun ltrbToVertexRgb (left, top, right, bottom, r, g, b) = fun ltrbToVertexRgb (startX, startY, endX, endY, r, g, b) =
#[ left, bottom, r, g, b #[ startX, endY, r, g, b
, right, bottom, r, g, b , endX, endY, r, g, b
, left, top, r, g, b , startX, startY, r, g, b
, left, top, r, g, b , startX, startY, r, g, b
, right, bottom, r, g, b , endX, endY, r, g, b
, right, top, r, g, b , endX, startY, r, g, b
] ]
fun fromPixelX (xpos, windowWidth, windowHeight) = fun fromPixelX (xpos, windowWidth, windowHeight) =

View File

@@ -553,7 +553,15 @@ struct
, ") - halfHeight) / halfHeight)" , ") - halfHeight) / halfHeight)"
] ]
in in
x :: y :: ex :: ex :: y :: ey :: r :: g :: b :: acc (* based on triangle order formed by `Ndc.ltrbToVertexRgb` function *)
x :: ey :: r :: g :: b ::
ex :: ey :: r :: g :: b ::
x :: y :: r :: g :: b ::
x :: y :: r :: g :: b ::
ex :: ey :: r :: g :: b ::
ex :: y :: r :: g :: b ::
acc
end end
fun toExportString (squares, canvasWidth, canvasHeight) = fun toExportString (squares, canvasWidth, canvasHeight) =