GrblGeneratorContext

class GrblGeneratorContext(val drawRate: Double?, val moveRate: Double?, val setup: Commands, val preDraw: Commands, val postDraw: Commands, val comment: (String) -> Commands, val end: Commands, val distanceTolerance: Double, val minSquaredDistance: Double, deduplicateCommands: Boolean = true) : BaseGeneratorContext(source)

Constructors

Link copied to clipboard
constructor(drawRate: Double?, moveRate: Double?, setup: Commands, preDraw: Commands, postDraw: Commands, comment: (String) -> Commands, end: Commands, distanceTolerance: Double, minSquaredDistance: Double, deduplicateCommands: Boolean = true)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val distanceTolerance: Double

Distance tolerance used for org.openrndr.shape.Segment2D.adaptivePositions when approximating curves.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val minSquaredDistance: Double

Minimum distance for two points to be considered distinct. Consecutive points with a distance smaller than this are considered duplicates and skipped.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun add(command: Command)
fun add(vararg commands: Command)
fun add(commands: Commands)
Link copied to clipboard
fun addComment(comment: String)
Link copied to clipboard
open override fun beginContour(start: Vector2, contour: ShapeContour)

Called at the beginning of a new contour.

Link copied to clipboard
open override fun beginFile()

Called at the beginning of a new file.

Link copied to clipboard
open override fun beginLayer(layer: String, composition: Composition)

Called at the beginning of a new layer.

Link copied to clipboard
open override fun beginShape(shape: Shape)

Called at the beginning of a new shape.

Link copied to clipboard
open override fun commands(): Commands
Link copied to clipboard
open override fun drawTo(p: Vector2)

Drawing move from the current to the given position. Called for each point of a contour, excluding the start point.

Link copied to clipboard
open override fun endContour(contour: ShapeContour)

Called at the end of a contour. Expected to disable the drawing tool, for example, lift pen, turn laser off, etc.

Link copied to clipboard
open override fun endFile()

Called at the end of a file.

Link copied to clipboard
open override fun endLayer(layer: String, composition: Composition)

Called at the end of a composition.

Link copied to clipboard
open override fun endShape(shape: Shape)

Called at the end of a shape.

Link copied to clipboard
fun moveTo(p: Vector2)
Link copied to clipboard
fun GeneratorContext.render(shape: Shape)

fun GeneratorContext.render(contour: ShapeContour)

Renders the contour to the generator context.

fun GeneratorContext.render(layer: String, composition: Composition)

Renders the composition to the generator context.