[orx-shapes] Fix RectifiedPath.kt for closed contours; Closes #334

This commit is contained in:
Edwin Jakobs
2024-05-14 23:09:55 +02:00
parent 4db8f28543
commit cebc217c94
2 changed files with 30 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
package rectify
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.shapes.rectify.rectified
import org.openrndr.shape.Circle
import org.openrndr.shape.Segment2D
fun main() = application {
configure {
width = 720
height = 720
}
program {
val c = Circle(drawer.bounds.center, 50.0).contour
val rc = c.rectified()
val normals = List(200) {
val t = it / 200.0
val p = rc.position(t)
val n = rc.normal(t)
Segment2D(p, p + n * 200.0)
}
extend {
drawer.clear(ColorRGBa.WHITE)
drawer.segments(normals)
}
}
}