-
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.
- Loading branch information
Showing
3 changed files
with
61 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
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,19 @@ | ||
import org.openrndr.application | ||
import org.openrndr.color.ColorRGBa | ||
import org.openrndr.shape.Circle | ||
|
||
/** | ||
* a simple demo that tests heavy stroke weights on tiny geometry | ||
* | ||
* This was made to assist in resolving https://github.com/openrndr/openrndr/issues/164 | ||
*/ | ||
fun main() = application { | ||
program { | ||
val c = Circle(200.0, 200.0, 10.0).contour | ||
extend { | ||
drawer.strokeWeight = mouse.position.y | ||
drawer.stroke = ColorRGBa.PINK | ||
drawer.contour(c) | ||
} | ||
} | ||
} |
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,41 @@ | ||
import org.openrndr.application | ||
import org.openrndr.color.ColorRGBa | ||
import org.openrndr.draw.LineJoin | ||
import org.openrndr.math.Vector2 | ||
import org.openrndr.shape.ShapeContour | ||
import org.openrndr.shape.contour | ||
|
||
/** | ||
* a simple demo that tests line joins | ||
* | ||
* This was made to assist in resolving https://github.com/openrndr/openrndr/issues/162 | ||
*/ | ||
|
||
fun arc(start: Vector2, end: Vector2, radius: Double): ShapeContour { | ||
return contour { | ||
moveTo(start) | ||
arcTo(radius, radius, 0.0, false, false, end) | ||
} | ||
} | ||
|
||
fun main() = application { | ||
configure { | ||
width = 800 | ||
height = 800 | ||
} | ||
program { | ||
val center = Vector2(width / 2.0, height / 2.0) | ||
val extra = Vector2(75.0, 75.0) | ||
|
||
extend { | ||
drawer.clear(ColorRGBa.PINK) | ||
|
||
drawer.lineJoin = LineJoin.BEVEL | ||
|
||
drawer.strokeWeight = 40.0 | ||
drawer.contour(arc(center - extra, center - extra - extra, 75.0)) | ||
drawer.contour(arc(center, center + extra, 75.0 / 2.0)) | ||
drawer.contour(arc(center + extra + extra, center + extra, 75.0 / 2.0)) | ||
} | ||
} | ||
} |