1 / 10

Fraktale in PostScript

Fraktale in PostScript. Sebastian Redl Manuel Pöter Helmut Petritsch. Fraktale. Künstliche oder natürliche Gebilde, geometrische Muster Erzeugt durch rekursive Ersetzungen z.B. Drachenkurve: F → R oder F → L R → + R - - L + L → - R + + L – Daraus resultiert + R - - L +

kemp
Download Presentation

Fraktale in PostScript

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fraktale in PostScript Sebastian Redl Manuel Pöter Helmut Petritsch

  2. Fraktale • Künstliche oder natürliche Gebilde, geometrische Muster • Erzeugt durch rekursive Ersetzungen • z.B. Drachenkurve: F → R oder F → L R → + R - - L + L → - R + + L – • Daraus resultiert + R - - L + + ( + R - - L + ) - - ( - R + + L - ) +

  3. Verbesserungen • Stack Overflow Exception bei der 13. Iteration • Ersetzungsregeln generisch durch Verwendung von HashTable • Optimierung bei der Verwendung von Winkelfunktionen /+ { ang rotate } def /- { ang neg rotate } def

  4. Lösung 1 – Rekursives Ersetzen • Problem: • Stacktiefe beschränkt (~ 60.000 Elemente) • Arrays beschränkt (max. 65.536 Elemente)

  5. Lösung 1 – Rekursives Ersetzen • Ersetzung von R und L im Array durch Sub-Arrays  statt einem Array mit vielen Element - viele Arrays mit wenig Elementen

  6. Ersetzungsfunktion /replaceDict << /R { [ /+ /R /- /- /L /+ ] } /L { [ /- /R /+ /+ /L /- ] } /+ { /+ } /- { /- } >> def /replFunc { << /arraytype { replFunc } /nametype { cvx exec } >> begin [ exch { dup type exec } forall ] end } def

  7. Lösung 2 – Direktes Zeichnen • R und L sind rekursive Funktionsaufrufe. • Für die letzte Rekursion wird ein Dictionary verwendet, in dem R und L Zeichenbefehle sind. /recurseDict << … >> def /drawDict << … >> def

  8. Generieren der Dictionaries /LSystem_Dict << /R { + R - - L + } /L { - R + + L - } >> def /recurseDict << LSystem_Dict { [ exch /drawRecurse cvx ] cvx } forall >> def /drawDict << /F { Zeichenbefehle } def LSystem_Dict { pop { F } } forall >> def

  9. Rekursion /drawRecurse { exch dup 0 eq { drawDict begin } if dup 1 sub 3 2 roll exec pop dup 0 eq { end } if } def /start { L } def recurseDict begin start end

  10. Danke für die Aufmerksamkeit Fragen?

More Related