06-28-2023, 07:13 PM
(06-28-2023, 05:20 AM)PhilOfPerth Wrote: Thanks Petr. No, I didn't necessarily want the exact same shape. I wanted a flexible algorithm that I could apply to different shapes to colour them
It's worth studying what Petr and Terry propose, because as I've said before, it could be a chore to find point inside a shape out of only DRAW commands. It would be difficult even to tell from one DRAW string or several strings if the shape is closed, or if it draws several shapes together which are closed and which one to fill in.
A few years ago I wrote a QB64 program that does "interactive" DRAW commands. The user types in the DRAW string as QBasic/QB64 expects in the text editor area at the bottom of the screen, and the program then tries to execute the resulting DRAW string. It has two modes: one which is the text editor mode that I described, and another which is "doodle" mode with the arrow keys and other keys (for color and scale) but which still creates DRAW commands. I have to go find it in my backups.
One might have to build such a program to design the DRAW string for a specific shape and to figure out which is a safe point to use before painting. Otherwise it could cause repeated requests to compile that wear down the disk drive... only for one little adjustment to the DRAW string. Yes I have done that many times before.