Turtle Graphics for Sketchup
-
Many times over my years of intermittent Sketchup use, I have wanted to be able to input a list of directions and distances and have SU simply follow that to create a line drawing.
Recently I realized that this isi the basic concept of one of the very first computer drawing programs, Turtle Graphics. Implementations of Turtle Graphics have been done in numerous languages, from SmallTalk to Python. There's even a downloadable Python Module.
Turtle Graphics also seems a natural for Sketchup, but in poring over Sketchucation, the Sketchup Form, the web, etc, I can't find anything.
The concept is simple, you provide a list of directions and distances and the system follows directions.
N 1"
W 1"
S 1"
E 1"or
0, 1
90, 1
180, 1
270, 1will draw a 1" or 1 unit square.
Previous uses that I would have like to use it in have been measuring a room interior that is more complicated that a simple rectangle and pacing off the layout of pathways in a large garden site.
If I were to try myself at getting a Ruby Script to input the data and draw the line, it could take me weeks to get up to speed on all the different Ruby functions I would need. I can read some Ruby, but generating it slower than one hour per line.
Has anyone done this already? Is there someone for whom Ruby is a native language who could just whip our a demonstration version (sans bell and whistles of different data input formats, etc.) that I might augment?
Thanks.
P.S. Nice to be back on Sketchucation. It's been a while.
-
@August said in Turtle Graphics for Sketchup:
Turtle Graphics
You would need to piggy back on the API to have implicit commands similar to Turtle-type behaviour.
In SketchUp you can use [#,#,#] to infer the [x,y,z] location in 3D space to place an object or point. But in all instances it requires user input to pick the tool and/or the first point.
I know of nothing that allow you to draw in the manner you need.
You could try @alexschreyer OpenAI extension: https://sketchucation.com/plugin/2643-as_openaiexplorer
Or @samuel_t Parametric Modelling extension: https://sketchucation.com/plugin/2387-parametric_modeling
Both have that type of capability of command based drawing. I like the latter for parametric block out.
You could use the Ruby Console to draw in the same way as you could use a chainsaw to trim your fingernails.
Try asking Claude.ai for ideas to get you a primitive example you could build on.
Advertisement