-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[orx-shapes] Fix ShapeContour.roundCorners, add demo. Closes #333
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
orx-shapes/src/jvmDemo/kotlin/operators/DemoRoundCorners01.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package operators | ||
|
||
import org.openrndr.application | ||
import org.openrndr.color.ColorRGBa | ||
import org.openrndr.extra.shapes.operators.roundCorners | ||
import org.openrndr.extra.shapes.primitives.regularStar | ||
|
||
fun main() = application { | ||
configure { | ||
width = 720 | ||
height = 720 | ||
} | ||
program { | ||
val rp = regularStar(7, 150.0, 300.0, drawer.bounds.center) | ||
extend { | ||
drawer.clear(ColorRGBa.WHITE) | ||
drawer.fill = null | ||
drawer.stroke = ColorRGBa.BLACK.opacify(0.2) | ||
for (i in 1 until 8 ) { | ||
val r = rp.roundCorners(i * 15.0).close() | ||
drawer.contour(r) | ||
} | ||
} | ||
} | ||
} |