Sutcliffe Fractal: Found a nice animated JavaScript version lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2024-02-04 01:13 Finally completed the Sutcliffe Pentagon by TRon. The Naming "Sutcliffe Pentagons" is a bit deceptive as it produces the fractal for different polygon types. I put in another image to demonstrate nesting. Actually TRon put a Paying it Forward messaage in the converted source so I will assume it's OK to share. So here it is: What I noticed is: 1.  When you change the TSpinedit for number of sides from 7 to 6 it is unresponsive, but going up to 8 sides and then back to 6 brings up the correct image. 2. Increasing the SubStructTarget values bring up exact images from previous values. 3. TRon mentions the root branch as possibly not being necessary but I do not get an image if it is not there.  // render root branch   CreateBranch(0, 0, Points, aNest, aStrutTarget, aSubStrutTarget, aStrutFactor);   // ??? is the following call really necessary ???   //  DrawBranch(Points, aNest);  4. I used   centerY := (Self.Height - 77) div 2;  to center the image. The 77 is the height of Panel1.     (was a bit lost on how to instead use Panel1.height in the other unit and ended up just using the value 77) ---------------------------------------------------------------------- Curt Carpenter · 2024-02-04 16:29 Interesting.  I was not familiar with the object, but found an interesting discussion of its origins here:  https://www.codeproject.com/Articles/214536/Generative-Art-Case-Study- Sutcliffe-Pentagons ---------------------------------------------------------------------- Boleeman · 2024-02-05 00:32 Curt, I had originally learnt about it at Codeproject as well and then I found a great Javascript version of it which TRon had graciously converted for this forum. The code is based on https://github.com/tex2e/p5js-pentagon In the Lazarus version I would like to have added opacity, perhaps using BGRAbmp. ---------------------------------------------------------------------- TRon · 2024-02-10 07:54 Quote from: Boleeman on February 04, 2024, 02:13:18 amActually TRon put a Paying it Forward messaage in the converted source so I will assume it's OK to share. If that was a question (indirectly  ) directed to me then the answer is yes it is ok to share. That is exactly what PIF means:  use, abuse and share what you've learned/created so that others can (also) learn from it  Quote3. TRon mentions the root branch as possibly not being necessary but I do not get an image if it is not there. Hmz, I would have to take a closer look at your current example then (bit busy atm so will do that later) because in my tests I did indeed not notice the difference. But also note that I have not the faintest idea about sutcliffe diagrams and their mathematical peculiarities (let alone know anything about the implementation that was offered at the javascript repo.. as it was (almost) a literal translation). ---------------------------------------------------------------------- Boleeman · 2024-02-10 11:13 Initially was unsure of the sharing status, so thanks for confirming (did not want to overstep the mark). Still amazed at your conversion skills. I have been practicing conversions with the Pentaflakes and Curling Pythagoras Tree programs from JavaScript. With CSharp conversions and Python conversions, there must be a difference in World transform coordinates, as only some bits are working. Need to study up a bit more and work out why? Thanks TRon for all your help. ---------------------------------------------------------------------- lainz · 2024-02-11 01:51 Try using bgrabitmap. It has CanvasBGRA that's the same as canvas but with antialias. ---------------------------------------------------------------------- TRon · 2024-02-11 12:18 Quote from: Boleeman on February 10, 2024, 12:13:57 pmThanks TRon for all your help. Thank /you/ for taking the effort to experiment and share I had to think a bit about the remark I made in the source-code. It is not about the creation of the branch (that is necessary) but the drawing of the root branch that seem redundant. For some reason the original code does draw the root branch directly (and thus seem to draw the root branch twice. That is, as far as my understanding of js goes). Drawing or not drawing the root branch directly after creation does not have a (visual) effect/difference (for as far as I was able to verify). BTW: in case you wish to use BGRABitmap then you can simply adjust the helper to be a helper of class TBGRACanvas (or whatever the canvas is named in/for BGRABItmap. Lainz seem to mention CanvasBGRA). The only thing you would have to do yourself is add support for alphablending/antialiasing inside the actual sutcliffe helper code (if you would like to use live special blending effects or in case it is required to use special code for antialiasing that is). ---------------------------------------------------------------------- Boleeman · 2025-01-18 12:07 Just recently stumbled across a JavaScript the animates a Sutcliffe fractal by: Changing its color (colour morphing) Changing its size  (shape morphing) Rotating Run the index.html file in the dist folder after you decompress the files. Kinda nice to watch, so I thought I would share it. Might be nice to implement these animation features in the Lazarus Sutcliffe Fractal version.