trapezoid experiment runs
This commit is contained in:
parent
f2b3c67d4b
commit
ea3f924c81
5 changed files with 9 additions and 9 deletions
|
@ -27,7 +27,7 @@ proc roundBy*(v: Vec2, n: float32): Vec2 {.inline.} =
|
||||||
|
|
||||||
proc pathToTrapezoids(p: Path): seq[Trapezoid] =
|
proc pathToTrapezoids(p: Path): seq[Trapezoid] =
|
||||||
|
|
||||||
var polygons = p.commands.commandsToPolygons()
|
var polygons = p.commandsToShapes()
|
||||||
|
|
||||||
const q = 1/256.0
|
const q = 1/256.0
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ block:
|
||||||
var image = newImage(200, 200)
|
var image = newImage(200, 200)
|
||||||
image.fill(rgba(255, 255, 255, 255))
|
image.fill(rgba(255, 255, 255, 255))
|
||||||
|
|
||||||
var p = newPath()
|
var p: Path
|
||||||
p.moveTo(50, 50)
|
p.moveTo(50, 50)
|
||||||
p.lineTo(50, 150)
|
p.lineTo(50, 150)
|
||||||
p.lineTo(150, 150)
|
p.lineTo(150, 150)
|
||||||
|
@ -189,7 +189,7 @@ block:
|
||||||
var trapezoids = p.pathToTrapezoids()
|
var trapezoids = p.pathToTrapezoids()
|
||||||
image.drawTrapezoids(trapezoids)
|
image.drawTrapezoids(trapezoids)
|
||||||
|
|
||||||
image.writeFile("trapezoids/rect.png")
|
image.writeFile("experiments/trapezoids/rect.png")
|
||||||
|
|
||||||
block:
|
block:
|
||||||
# Rhombus
|
# Rhombus
|
||||||
|
@ -197,7 +197,7 @@ block:
|
||||||
var image = newImage(200, 200)
|
var image = newImage(200, 200)
|
||||||
image.fill(rgba(255, 255, 255, 255))
|
image.fill(rgba(255, 255, 255, 255))
|
||||||
|
|
||||||
var p = newPath()
|
var p: Path
|
||||||
p.moveTo(100, 50)
|
p.moveTo(100, 50)
|
||||||
p.lineTo(150, 100)
|
p.lineTo(150, 100)
|
||||||
p.lineTo(100, 150)
|
p.lineTo(100, 150)
|
||||||
|
@ -207,7 +207,7 @@ block:
|
||||||
var trapezoids = p.pathToTrapezoids()
|
var trapezoids = p.pathToTrapezoids()
|
||||||
image.drawTrapezoids(trapezoids)
|
image.drawTrapezoids(trapezoids)
|
||||||
|
|
||||||
image.writeFile("trapezoids/rhombus.png")
|
image.writeFile("experiments/trapezoids/rhombus.png")
|
||||||
|
|
||||||
block:
|
block:
|
||||||
# heart
|
# heart
|
||||||
|
@ -223,7 +223,7 @@ block:
|
||||||
var trapezoids = p.pathToTrapezoids()
|
var trapezoids = p.pathToTrapezoids()
|
||||||
image.drawTrapezoids(trapezoids)
|
image.drawTrapezoids(trapezoids)
|
||||||
|
|
||||||
image.writeFile("trapezoids/heart.png")
|
image.writeFile("experiments/trapezoids/heart.png")
|
||||||
|
|
||||||
block:
|
block:
|
||||||
# l
|
# l
|
||||||
|
@ -240,7 +240,7 @@ block:
|
||||||
var trapezoids = p.pathToTrapezoids()
|
var trapezoids = p.pathToTrapezoids()
|
||||||
image.drawTrapezoids(trapezoids)
|
image.drawTrapezoids(trapezoids)
|
||||||
|
|
||||||
image.writeFile("trapezoids/l.png")
|
image.writeFile("experiments/trapezoids/l.png")
|
||||||
|
|
||||||
block:
|
block:
|
||||||
# g
|
# g
|
||||||
|
@ -257,4 +257,4 @@ block:
|
||||||
var trapezoids = p.pathToTrapezoids()
|
var trapezoids = p.pathToTrapezoids()
|
||||||
image.drawTrapezoids(trapezoids)
|
image.drawTrapezoids(trapezoids)
|
||||||
|
|
||||||
image.writeFile("trapezoids/g.png")
|
image.writeFile("experiments/trapezoids/g.png")
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
@ -11,4 +11,4 @@ requires "chroma >= 0.2.1"
|
||||||
requires "zippy >= 0.3.5"
|
requires "zippy >= 0.3.5"
|
||||||
requires "flatty >= 0.1.3"
|
requires "flatty >= 0.1.3"
|
||||||
requires "nimsimd >= 1.0.0"
|
requires "nimsimd >= 1.0.0"
|
||||||
requires "bumpy >= 1.0.1"
|
requires "bumpy >= 1.0.2"
|
||||||
|
|
Loading…
Reference in a new issue