Turtle internal format changes #626
i-make-robots
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
idea 1: add a name field.
Default value "". When a bitmap is converted to a turtle the source filename becomes the turtle name. When a vector is loaded same idea. The name can flow through the system and become a hint/suggestion for the output filename. Splitting a turtle into color channels changes the turtle name and gives a hint about its origin.
idea 2: refactor internal history
Presently the history of a Turtle is a recording of the moves the Turtle made to produce the drawing in the form
It made sense when the only way to make a path was to drive a Turtle around the screen and there was only one color of pen.
This is inefficient for most actions. OpenGL would prefer to have an ordered list of points. Sorting, clipping, and filling tests would prefer a list of paths. Presently all editing actions convert a Turtle to an array of line segments, do work, then convert them back.
Proposed change would look like
The travel moves are implicit between lines.
OpenGL will be happy because the lines/point system is the same as Vertex Array Objects, meaning render time will be a tiny fraction of the old way.
Clipping, filling, and reordering algorithms will be faster because they don't have to convert to and from different ways of thinking.
Generating the new style of history does not change the Turtle interface - it walks same as before.
Bonus: it should be very hard to accidentally have two tool changes in a row and very easy to detect a tool change followed by zero moves followed by another tool change.
It is impossible to have multiple travel moves in a row with this method. Why would anyone want that? To make it dance?
It would mean
Beta Was this translation helpful? Give feedback.
All reactions