draw.path in new orientations after brush.turn.*

Ah. I see what you mean. I'm happy to change any drawing behavior if you think it would make it more logical or consistent. I'd actually forgotten there was any connection between draw.path and brush.move.to
3 Replies
dwillington
dwillington17mo ago
having thought about it, it would be great to have draw.path to paint in the orientation it is currently in, i.e. to respect any brush.turn.* statements that have been made prior. Besides, one can always reset the orientation to default if they want the default orientation after they have issued brush.turn.* It also feels more consistent that brush.draw and draw.path do the same thing if brush.turn.* commands have been issued prior. This would really help in some of the work I want to do going forward. I also don't want to do this if this breaks something fundamental or is against some 3D graphics principle. But I can't think of an issue, and it seems intuitive to me, I was expecting it to work that way. Happy to voice chat if this needs some clarification...
andybak
andybak17mo ago
Hmmm. It's more that it's a chunk of work in exactly the area of the code that tends to hurt my brain the most. I always thought of "drawing paths" and "simple turtle graphics implementation" as totally separate. Maybe my mistake was not using the word "turtle" in commands to make the separation clearer. That and the fact I've added a few extra command like "polygon" that do blur the line. I guess I added the whole turtle thing because it was quick and easy and seemed like a fun addition. However - On reflection I do need to write a remarkably similar bit of code to make some common actions simpler in the Lua API - so there's one hurdle out of the way. My only concern is whether there needs to be two different commands. One for "just draw this damn path" and another for "draw a path relative to the brush orientation" also - do all drawing commands need a brush-relative and canvas-relative version now? So. I've kinda changed my mind on this while typing a response! I'd also assumed that the whole "turtle" approach was specific to the Http API and not relevant to Lua - but on reflection I can see value in using it for the latter as well. Especially for ToolScripts.
dwillington
dwillington17mo ago
tough to follow this over discord...I will say that for now, I'm content with what's there in the API. What I suggested is definitely more a "nice to have". I'm not sure it's a valid ask, b/c I haven't come across this in other APIs. It was just a natural assumption after using draw.polygon. For now, I'm actually making do with the rotation matrices. What's nice about that is it's forcing me to explicitly understand what's actually happening and expanding my toolkit. Much more transferable to other APIs and domains...