collectScreenshots: drop @see... lines
otherwise images are duplicated in README.md
This commit is contained in:
@@ -43,7 +43,7 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
|
|||||||
"preload class not found: '${preloadClass.absolutePath}'"
|
"preload class not found: '${preloadClass.absolutePath}'"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute demos
|
// Execute demos and produce PNG files
|
||||||
inputChanges.getFileChanges(inputDir).forEach { change ->
|
inputChanges.getFileChanges(inputDir).forEach { change ->
|
||||||
if (change.fileType == FileType.DIRECTORY) return@forEach
|
if (change.fileType == FileType.DIRECTORY) return@forEach
|
||||||
if (change.file.extension == "class") {
|
if (change.file.extension == "class") {
|
||||||
@@ -98,7 +98,7 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// List found PNG images.
|
// List produced PNG images.
|
||||||
// Only executed if there are changes in the inputDir.
|
// Only executed if there are changes in the inputDir.
|
||||||
val demoImageBaseNames = outputDir.get().asFile.listFiles { file: File ->
|
val demoImageBaseNames = outputDir.get().asFile.listFiles { file: File ->
|
||||||
file.extension == "png"
|
file.extension == "png"
|
||||||
@@ -135,10 +135,14 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
|
|||||||
val main = codeLines.indexOfFirst { it.startsWith("fun main") }
|
val main = codeLines.indexOfFirst { it.startsWith("fun main") }
|
||||||
|
|
||||||
if ((start < end) && (end < main)) {
|
if ((start < end) && (end < main)) {
|
||||||
codeLines.subList(start + 1, end).joinToString("\n") {
|
codeLines.subList(start + 1, end).joinToString("\n") { line ->
|
||||||
it.trimStart(' ', '*')
|
val trimmed = line.trimStart(' ', '*')
|
||||||
|
if(trimmed.startsWith("@see")) "" else trimmed
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
println("/** comment */ missing in $projectPath/$ktFilePath")
|
||||||
|
""
|
||||||
}
|
}
|
||||||
} else ""
|
|
||||||
} else ""
|
} else ""
|
||||||
|
|
||||||
readmeLines.add(
|
readmeLines.add(
|
||||||
|
|||||||
@@ -8,6 +8,14 @@ import org.openrndr.shape.Circle
|
|||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demonstrates how to use `adjustContour` to select and modify three vertices
|
||||||
|
* in a circular contour. In OPENRNDR circles contain 4 cubic bézier
|
||||||
|
* segments connecting 4 vertices.
|
||||||
|
*
|
||||||
|
* On every animation frame the circular contour is created and transformed
|
||||||
|
* using sines, cosines and the variable `seconds` for an animated effect.
|
||||||
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
width = 800
|
width = 800
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ import org.openrndr.shape.Circle
|
|||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demonstrates how to use `adjustContour` to select and remove vertex 0
|
||||||
|
* from a circular contour, then select and animate the position and scale the new vertex 0.
|
||||||
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
width = 800
|
width = 800
|
||||||
@@ -22,8 +26,6 @@ fun main() = application {
|
|||||||
selectVertex(0)
|
selectVertex(0)
|
||||||
vertex.moveBy(Vector2(cos(seconds) * 40.0, sin(seconds * 0.43) * 40.0))
|
vertex.moveBy(Vector2(cos(seconds) * 40.0, sin(seconds * 0.43) * 40.0))
|
||||||
vertex.scale(cos(seconds * 2.0) * 2.0)
|
vertex.scale(cos(seconds * 2.0) * 2.0)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
drawer.stroke = ColorRGBa.RED
|
drawer.stroke = ColorRGBa.RED
|
||||||
drawer.contour(contour)
|
drawer.contour(contour)
|
||||||
|
|||||||
@@ -7,6 +7,18 @@ import org.openrndr.math.Vector2
|
|||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
import kotlin.math.sin
|
import kotlin.math.sin
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demonstrates how to select and alter the edges of a rectangle.
|
||||||
|
*
|
||||||
|
* The rectangle is a scaled-down version window bounds.
|
||||||
|
*
|
||||||
|
* By default, the edges of a rectangular contour are linear, so the `edge.toCubic()` method
|
||||||
|
* is called to make it possible to bend them.
|
||||||
|
*
|
||||||
|
* Then various edges are selected one by one and transformed over time using operations like
|
||||||
|
* scale, rotate, splitAt and moveBy.
|
||||||
|
*
|
||||||
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
width = 800
|
width = 800
|
||||||
@@ -23,13 +35,14 @@ fun main() = application {
|
|||||||
selectEdge(0)
|
selectEdge(0)
|
||||||
edge.scale(0.5, 0.5)
|
edge.scale(0.5, 0.5)
|
||||||
edge.rotate(cos(seconds * 0.5) * 30.0)
|
edge.rotate(cos(seconds * 0.5) * 30.0)
|
||||||
|
|
||||||
selectEdge(1)
|
selectEdge(1)
|
||||||
edge.toCubic()
|
edge.toCubic()
|
||||||
edge.splitAt(0.5)
|
edge.splitAt(0.5)
|
||||||
edge.moveBy(Vector2(cos(seconds * 10.0) * 40.0, 0.0))
|
edge.moveBy(Vector2(cos(seconds * 10.0) * 40.0, 0.0))
|
||||||
|
|
||||||
//edge.next?.select()
|
//edge.next?.select()
|
||||||
selectEdge(3)
|
selectEdge(3)
|
||||||
|
|
||||||
edge.moveBy(Vector2(0.0, sin(seconds * 10.0) * 40.0))
|
edge.moveBy(Vector2(0.0, sin(seconds * 10.0) * 40.0))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,15 @@ import org.openrndr.extra.shapes.adjust.adjustContour
|
|||||||
import org.openrndr.shape.Circle
|
import org.openrndr.shape.Circle
|
||||||
import kotlin.math.cos
|
import kotlin.math.cos
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demonstrates an `adjustContour` animated effect where edge 0 of a contour
|
||||||
|
* is replaced by a point sampled on that edge. The specific edge point oscillates between
|
||||||
|
* 0.0 (at the start) and 1.0 (at the end) using a cosine and the `seconds` variable.
|
||||||
|
*
|
||||||
|
* The base contour used for the effect alternates every second
|
||||||
|
* between a rectangular and a circular contour.
|
||||||
|
*
|
||||||
|
*/
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
width = 800
|
width = 800
|
||||||
|
|||||||
Reference in New Issue
Block a user