N-gram Star Patterns: With Save Settings lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2024-08-16 14:21 I tried to make a Star Pentagram ... and now have an N-Gram Star Pattern Now With Save Settings Star Pentagram and Other Recursive Curve Patterns Please Go down to latest reply. Star Pentagram fixed by RVK. Thankyou. ---------------------------------------------------------------------- rvk · 2024-08-16 14:36 You have a problem when recursing. You do a ACanvas.LineTo inside the loop of 0 to 4 and expect the position to be correct in the next itteration. But... when calling starpentagram inside the same loop, it can mess with the current position. If you reset the position after the recursive call back to newX/newY, it will look better. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     if i = 0 then      ACanvas.MoveTo(Round(newX), Round(newY))    else      ACanvas.LineTo(Round(newX), Round(newY));     // Draw the smaller star if the recursion level is less than the depth    if level < depth then    begin      starpentagram(level + 1, newX, newY, r * scale, ACanvas);      ACanvas.MoveTo(Round(newX), Round(newY)); // back to correct position    end; ---------------------------------------------------------------------- Boleeman · 2024-08-16 16:50 RVK: A great many thanks for that fix. I was going batty trying to try to fix that bug. Added Save to Png and Back Colour selection. Here is what I ended up with. 2nd attached png was filled manually in MsPaint. Kinda really like the Black and White Level 5 third attached png, with the fine white lines. ---------------------------------------------------------------------- Boleeman · 2024-08-17 01:19 Wow. Extra Curve Fun Now getting some extra interesting curves by changing the angle divisor, as well as the scale and the radius. Even got the square fractal. Can't believe it. ---------------------------------------------------------------------- Boleeman · 2024-08-17 05:34 Made some changes to code (In particular, the angle) Now beautifully rendering to Tbgrabmp, with anti-aliasing. Able to make N-gram PolyStars, like pentagram, Hexagram, etc.  (see attached png) Widened the range of values for the TSpinedits to get extra curve types. ---------------------------------------------------------------------- Boleeman · 2024-08-17 10:03 A Tbgrabmp version where you can save and load your favorite design settings. I am not sure why, but when clicking on a Listbox row the loading of the settings is a bit jumpy. Is it because of using the bgrabmp OnPaint event?