Recent

Author Topic: Morphic Turtle Patterns: Now Using Bgrabmp ... Final  (Read 1590 times)

Boleeman

  • Hero Member
  • *****
  • Posts: 686
Morphic Turtle Patterns: Now Using Bgrabmp ... Final
« on: July 20, 2024, 07:56:58 am »
Some nice fractal curves produced by Morphic Turtle.

Especially like the Caesaro Curve and the Plant Like Curve.

« Last Edit: July 31, 2024, 09:57:04 am by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 686
Re: Morphic Turtle Patterns: Mmmm ... Nice Curves
« Reply #1 on: July 20, 2024, 10:37:06 am »
A  LOT   more presets.  Just 198 presets.

Getting some Tessellated Patterns.

Have a look at the last attached file to see what I mean.
« Last Edit: July 20, 2024, 05:42:33 pm by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 686
Re: Morphic Turtle Patterns: Mmmm ... Nice Curves
« Reply #2 on: July 20, 2024, 01:41:23 pm »
Manually filled pattern.
« Last Edit: July 20, 2024, 05:41:02 pm by Boleeman »

Dzandaa

  • Sr. Member
  • ****
  • Posts: 354
  • From C# to Lazarus
Re: Morphic Turtle Patterns: Mmmm ... Nice Curves
« Reply #3 on: July 21, 2024, 11:38:26 am »
Hi,

I have an error at line 168:

Code: Pascal  [Select][+][-]
  1.     if MemoValues.Lines[11 + i][j] <> '/' then  
  2.  

Quote
Range Check Error
for
i = 0
j = 3

B->
Regards,
Dzandaa

Boleeman

  • Hero Member
  • *****
  • Posts: 686
Re: Morphic Turtle Patterns: Mmmm ... Nice Curves
« Reply #4 on: July 22, 2024, 12:21:27 pm »
DZandaa, not sure if this fixes the problem you encountered.

I was not getting any errors on AMD Windows10 platform.
Added some Extra checks.

What platform are you using DZandaa? (Linux or Mac?)


Code: Pascal  [Select][+][-]
  1. procedure TForm1.DrawFractal;
  2. var
  3.   i, j, k, n, d, hib, h: integer;
  4.   xx, yy, degreeangles: real;
  5.   str: array [0..3] of string;
  6.   sh: array [0..3] of real;
  7.   stream: array [1..500000] of byte;
  8.   s1, s2: string;
  9. begin
  10.   Image1.Picture.Bitmap.Canvas.Pen.Color := cbForecolor.ButtonColor;
  11.  
  12.   if (MemoValues.Lines.Count < 15) then
  13.   begin
  14.     ShowMessage('MemoValues does not have enough lines for processing.');
  15.     Exit;
  16.   end;
  17.  
  18.   n := StrToIntDef(MemoValues.Lines[0], 0);
  19.   d := StrToIntDef(MemoValues.Lines[1], 0);
  20.   xx := StrToFloatDef(MemoValues.Lines[2], 0);
  21.   yy := StrToFloatDef(MemoValues.Lines[3], 0);
  22.   degreeangles := StrToFloatDef(MemoValues.Lines[4], 0) * pi / 180;
  23.  
  24.   for i := 0 to 3 do
  25.     str[i] := MemoValues.Lines[6 + i];
  26.   hib := Length(str[0]);
  27.   for i := 1 to hib do
  28.     stream[i] := Ord(str[0][i]) - Ord('0');
  29.   h := 2;
  30.   while hib < n do
  31.   begin
  32.     j := stream[h];
  33.     for i := 1 to Length(str[j]) do
  34.       stream[hib + i] := Ord(str[j][i]) - Ord('0');
  35.     hib := hib + Length(str[j]);
  36.     h := h + 1;
  37.   end;
  38.   for i := 0 to 3 do
  39.   begin
  40.     j := 1;
  41.     s1 := '';
  42.     while (j <= Length(MemoValues.Lines[11 + i])) and (MemoValues.Lines[11 + i][j] <> '/') do
  43.     begin
  44.       s1 := s1 + MemoValues.Lines[11 + i][j];
  45.       j := j + 1;
  46.     end;
  47.     if (j <= Length(MemoValues.Lines[11 + i])) and (MemoValues.Lines[11 + i][j] <> '/') then
  48.       sh[i] := StrToFloatDef(s1, 0) * pi / 180
  49.     else
  50.     begin
  51.       s2 := '';
  52.       for k := j + 1 to Length(MemoValues.Lines[11 + i]) do
  53.         s2 := s2 + MemoValues.Lines[11 + i][k];
  54.       sh[i] := StrToFloatDef(s1, 0) * pi / (180 * StrToFloatDef(s2, 1));
  55.     end;
  56.   end;
  57.   Image1.Picture.Bitmap.Canvas.MoveTo(Round(xx), Round(yy));
  58.   for i := 1 to n do
  59.   begin
  60.     degreeangles := degreeangles + sh[stream[i]];
  61.     xx := xx + d * Sin(degreeangles);
  62.     yy := yy + d * Cos(degreeangles);
  63.     Image1.Picture.Bitmap.Canvas.LineTo(Round(xx), Round(yy));
  64.   end;
  65. end;      
« Last Edit: July 22, 2024, 12:33:29 pm by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 686
Re: Morphic Turtle Patterns: Mmmm ... Nice Curves
« Reply #5 on: July 22, 2024, 12:27:56 pm »
Here is a TBgrabmp version with Anti-aliasing.

How could we possibly add a Rotate the Pattern with a Mouse Drag function?

I like the 2nd attached png, as it has some unusual properties.

Seems to be a fairly complex line construction. Never seen something like this before.
Has almost Stars around the circle, triangles between those "almost stars" and Parallel lines inside.
Not sure why, but the horizontal and vertical lines are thinner in width?
« Last Edit: July 22, 2024, 12:59:04 pm by Boleeman »

Dzandaa

  • Sr. Member
  • ****
  • Posts: 354
  • From C# to Lazarus
Re: Morphic Turtle Patterns: Now Using Bgrabmp ... Nice Curves
« Reply #6 on: July 22, 2024, 01:22:31 pm »
Hi,

@Boleeman:

The BGRABmp version is working fine :)

B->
Regards,
Dzandaa

Boleeman

  • Hero Member
  • *****
  • Posts: 686
Re: Morphic Turtle Patterns: Now Using Bgrabmp ... Nice Curves
« Reply #7 on: July 23, 2024, 08:39:30 am »
279 Preset Files. Enjoy.
« Last Edit: July 23, 2024, 12:36:24 pm by Boleeman »

Boleeman

  • Hero Member
  • *****
  • Posts: 686
Re: Morphic Turtle Patterns: Now Using Bgrabmp ... Nice Curves
« Reply #8 on: July 31, 2024, 09:56:24 am »
Some updates:

Change the line thickness.
Save with a transparent background.


Hopefully the final version.
« Last Edit: July 31, 2024, 09:58:08 am by Boleeman »

 

TinyPortal © 2005-2018