Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Jeremy Dunn on March 19, 2018, 01:07:38 AM
Title: ===[CHALLENGE - hex fractal]===
Post by: Jeremy Dunn on March 19, 2018, 01:07:38 AM
The diagram shows a three stage development of a fractal that is based on the 7 hex unit on the left. One repeats 6 hex units and leaves the central hex empty. The challenge is to write a program that will draw any generation of the pattern given the iteration integer. The program should draw the pattern without repeating edges and calculate points in such a way as to have as little cumulative error as possible. Let the programs begin!
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: ribarm on March 19, 2018, 06:37:24 AM
Another one...
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: ribarm on March 19, 2018, 09:04:30 AM
And yet another one...
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: ribarm on March 19, 2018, 02:08:27 PM
Not exactly what you wanted, but I managed to get this...
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: ribarm on March 19, 2018, 02:17:41 PM
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: gile on March 20, 2018, 02:14:12 PM
Nice!
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: Jeremy Dunn on March 20, 2018, 03:15:52 PM
You guys are too quick! Do you get any work done during the day? :2funny: Here's a variation of the hexfractal that you can try that looks simpler but has its own problems to solve. This time draw the outside perimeter as normal but replace the white filled areas with white filled circles that just fit inside the normal jagged holes.
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: ribarm on March 20, 2018, 11:06:37 PM
I have to say that there were lacks in my last posted code - formulas for p1 and p2 in both subs (odd) and (even) were wrong... Now updated code and checked for 6 iterations (5 hours on my slow PC) and it looked fine which means that now p1 and p2 are correct... BTW. DWG is ab 125 MB... But no such astonishing effect with fractals - even 4 iterations is enough to see it good like in my posted picture... Only its more dense - you have to zoom in and pan more...
Gilles's subs I haven't checked, but I guess they are fine...
Regards, M.R. 8-)
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: gile on March 21, 2018, 05:28:00 AM
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: ribarm on March 23, 2018, 03:12:10 PM
When I replace (command-s) with (vl-cmdf) on A2014 it works, but on A2017 it doesn't... Can you explain? Thanks for your input... It works significantly faster with block command and insert.
M.R.
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: gile on March 23, 2018, 03:58:37 PM
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: ribarm on March 24, 2018, 05:06:01 AM
Thanks, that explains things...
FYI, (command-s) is just slightly slower than (vl-cmdf)... Test it for yourself : https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fit-arc-lisp-not-working-in-2017/m-p/7401334/highlight/true#M359125
M.R.
Title: Re: ===[CHALLENGE - hex fractal]===
Post by: gile on March 24, 2018, 06:03:31 AM
From the tests I did using MP's Benchmark routine, command-s is slighty faster.
Never mind, if execution speed is an issue, don't use command/vl-cmdf/command-s at all, or better, don't use LISP...