cornerContour

Using Sketcher with turtle style graphics.

#TODO: ( code modified you now pass sketcher to a new Turtle instance ) but theory below is very similar.

demo project: https://github.com/nanjizal/cornerContourWebGLTurtle

Sometimes it can be easier to draw using simple turtle graphics. Turtle style graphics allows you to define drawing as if your controlling a turtle, with rotation and movement commands, these commands can be chained together as a sequence:

public function turtleTest(){
       var s = new Sketcher( pen2D, Fine, both );
        s.setPosition( 100, 100 )
            .penSize( 7 )
            .forward( 30 )
            .right( 45 )
            .forward( 30 )
            .arc( 50, 120 );
 }

Specific turtle related commands provided from Sketcher class, these are designed to be easily chained. There is a simple repeat that allows non nested multiple repeat of commands.

Turtle allow draw and move commands.

Distance movement

Basic shapes

Basic repeat

Curved Distance, similar to forward, but uses ‘distance2’ and ‘radius’ to define a third point relative to the current vector.

Pen thickness and color

Default colors are defined similar to other turtle implementations

For thickness gradients when using SketcherGrad, untested, second color defaults to ‘colorB’

Non chainable commands just for information

History, the commands are stored internally as abstract enum ie Array and as properties Array