It’s just data

Penrose Tiling

The Wikipedia entry on Penrose_tiling describes an L-system for generating an aperiodic tiling of a plane.  Just for grins, I converted it to SVG and ECMAScript; the results appear to work with either Firefox 1.5 or the Adobe SVG viewer.


Seems to work fine in Opera 9 as well, for what it’s worth. Also, is ECMAScript really an acronym for JavaScript?!

Posted by Anne van Kesteren at

is ECMAScript really an acronym for JavaScript

I was the editor on the tail end of the 3rd (and current) edition of ECMAScript, and to make a long story short: pretty much. ;-)

Question: does Opera 9 show the inline SVG that is present on this post?

Posted by Sam Ruby at

License?

Posted by Mark at

Very cool! The L-system doesn’t do filling, what are your rules for that?

Posted by Sjoerd Visscher at

Question: does Opera 9 show the inline SVG that is present on this post?

Yes, the page (including the SVG) looks just like in Firefox.

Posted by Björn Graf at

License?

I can’t begin to imagine what use anybody could have for this code, but how does MIT sound?

The L-system doesn’t do filling, what are your rules for that?

There actually is an interesting story behind that.  This started out as a Ruby application that generated a static SVG with a single path element with fill='none'.  With n=6 (or was it 7? I don’t remember), FireFox simply trapped.

Taking a look at the output, I saw that it was a series of moves, each followed by a small number of lines.  There was some redundant moves (i.e., moves followed by other moves) that could simply be eliminated.  By splitting the path into separate elements, each starting with a move, Firefox could handle the output.  The inline SVG you see on this post was generated by a derivative of that program.

Once I had separate paths, two things occurred to me: some of the paths were closed and could therefore be filled.  The second was that with a little JavaScript, I could render the image incrementally.  Seeing the walk fold back on itself was a surprise, and I simply colored each closed path with the primary colors: red, green, blue, in that order.  Later I varied this effect by making the color less than fully opaque.

Finally, I realized that I could port my Ruby code to JavaScript and make it completely self contained.  However, I wasn’t pleased with the startup time necessary to compute the whole graph.  Some day, I hear that JavaScript will have true generators, but for now, I could emulate that behavior with objects.

Björn: this weblog is fully Unicode enabled, feel free to enter your name as it was intended to be.  I’ve gone ahead and edited your comment to reflect this.

Posted by Sam Ruby at

Wow!

Reminds me how much I miss QuasiTiler.app.

But that was two generations of “golem” ago.

Posted by Jacques Distler at

All inline and “standalone” SVG I’ve seen on your blog has worked in Opera 9, Sam. The only thing that seems a bit quirky about the Penroles Tiling SVG in Opera 9 is its positioning, which is a bit off compared to how it is in Firefox.

Posted by Asbjørn Ulsberg at

I’ve been trying to get the coloring regular. I thought adding 2 more colors would do the trick, but it doesn’t work. I can’t even get n = 1 regular.

What does look good is using just a single color: gray. This gives the effect of shaded cubes.

Posted by Sjoerd Visscher at

Sam Ruby: Penrose Tiling

self-contained Penrose tiling in SVG and ECMAScript...

Excerpt from del.icio.us/micampe at

Very cool, Sam!

Just a question:  Since you’re testing in Firefox and Adobe SVG Viewer, is there any reason you can’t also download and install Opera 9 to test it there also?  Opera 9’s SVG implementation is much more mature (maturer?) than Firefox.

Also, why not update your spellchecking to include SVG?

Posted by Jeff Schiller at

is there any reason you can’t also download and install Opera 9 to test it there also?

I’ve now downloaded and installed Opera 9.0 for Linux i386 for Ubuntu 6.06 Dapper Drake.  Each time I launch, I see the following:

ERROR: ld.so: object 'libjvm.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libawt.so' from LD_PRELOAD cannot be preloaded: ignored.
X Error: BadDevice, invalid or uninitialized input device 168
  Major opcode:  145
  Minor opcode:  3
  Resource id:  0x0
Failed to open device
X Error: BadDevice, invalid or uninitialized input device 168
  Major opcode:  145
  Minor opcode:  3
  Resource id:  0x0
Failed to open device

The first thing I notice is that Opera doesn’t support the CSS border-radius property.

Yes, I can launch penroseTiling.svg, but before it gets to the lower right corner, the CPU is pegged, and progress slows to a crawl.

I’ll keep with Firefox for now.

Also, why not update your spellchecking to include SVG?

Done.

Posted by Sam Ruby at

Sam: The errors you see are X errors that seem common on Ubuntu. It seems to be caused by the X configuration having definined /dev/wacom that doesn’t exist. Before that is an error about not being able to preload the Java object files.

The penrosetiling svg makes both Opera and Firefox use about 70% CPU here, using kanotix. The progress seems fine in both though.

Posted by Tommy A. Olsen at

GentleCMS Development Log: Part 3

The extract method is basically done. I’m sure it could be improved a bit more, but it seems to be fairly effective. I added a few extra features beyond the original URI class’s capabilities, such as supplying a base uri to resolve...

Excerpt from Sporkmonger at

SVG vs Canvas

I ported my incremental Penrose Tiling from SVG to Canvas, and am at a loss to explain the difference in performance.  If you have an SVG and Canvas aware browser, give this a whirl and tell me what you see. The issue seems to have something to do with... [more]

Trackback from Sam Ruby

at

Links for 2006-07-07 [del.icio.us]

Sam Ruby: Penrose Tiling self-contained Penrose tiling in SVG and ECMAScript...

Excerpt from micampe.it at

GentleCMS Development Log: Part 3

The extract method is basically done. I’m sure it could be improved a bit more, but it seems to be fairly effective. I added a few extra features beyond the original URI class’s capabilities, such as supplying a base uri to resolve...

Excerpt from uri on SWiK.net at

Apologies for the “thread necro”.

Just letting you know the Penrose Tiling application works just fine in Safari 3.0.4 (523.12.2), Firefox 2.0.0.12, iCab 4.0.1, OmniWeb-5.6-v613 on Mac OS X 10.4.11.

It’s about twice as fast in the WebKit-based browsers as it is in Firefox, though OmniWeb does draw parts of it off the bottom and right side of the page.

Posted by Alex Satrapa at

A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. ΗΛΕΚΤΡΟΛΟΓΟΣ ΑΘΗΝΑ

Posted by pioneerseo at

The Online Pharmacy in the UK is determined by its visualization to attain considerable business in prescription products with strong presences in market. Our dedicated teams co-ordinate with each other to make operations smoother and we work with top licensed Online pharmacy to guarantee customers the best products at the most reasonable rates.. aderell for sale

Posted by adilkhatri at

The essayist is searing about acquiring wooden furniture on the web and his examination about best wooden furniture has comprehended the plan of this article. Amziya Marketing

Posted by adilkhatri at

Extremely educational post ! There is a considerable measure of data here that can enable any business to begin with a fruitful long range interpersonal communication campaign ! online günlük

Posted by seo expert at

very nice article giving me hope

Posted by henry at

Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can’t wait to read lots of your posts. incontinence pants

Posted by seo expert at

Conditioning Gently apply conditioner from top to ends. Leave the conditioner on hair for up to 5 minutes. Comb conditioner through, using your wig comb. This is the best time to de-tangle hair. short wigs human hair

Posted by jackrobert at

I unquestionably appreciating each and every piece of it and I have you bookmarked to look at new stuff you post. best wrinkle cream

Posted by jackrobert at

I just got to this astonishing site in the relatively recent past. I was really caught with the bit of assets you have here. Enormous thumbs up for making such brilliant blog page! Kasauti Zindagi Ki

Posted by jackrobert at

Two full thumbs up for this magneficent article of yours. I’ve truly delighted in perusing this article today and I figure this may be outstanding amongst other article that I’ve perused yet. If it’s not too much trouble keep this work going ahead in a similar quality. Bigg Boss 12

Posted by jackrobert at

This totally unique organic flea control system will not only protect you from biting fleas but will also help you monitor the infestation and reduce the infestation. This happens as the adult fleas not only get caught in our Guardalone product but if they manage to escape they will die. Its a win-win for you. The wonderful thing is that Hostgaurd is a natural and 100% organic flea control system. kill fleas in home

Posted by Merck SEO at

Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well written. putlocker

Posted by Merck SEO at

Antika Ürünleriniz Degerinde Alınır, Plak AlanlarKuran AlanlarHurda GümüşAntika SaatAntika Mobilya Like Greet Post.!

Posted by Hurda Gümüş Fiyatları at

I need to search for objectives with fundamental data on given point and offer them to teacher our slant and the article. Prestamo parra negocios

Posted by S E O Experts at

I need to search for objectives with fundamental data on given point and offer them to teacher our slant and the article. logistiek Nederland Litouwen

Posted by jack Robert at

Standard visits recorded here are the least demanding technique to value your vitality, which is the reason why I am heading off to the site ordinary, hunting down new, intriguing data. Many, bless your heart! mike matei

Posted by Merck SEO at

Thanks For Sharing The Information. It’s Awesome
Read Latest Nepali News Here

Happy New Year 2076

Taarak Mehta Ka Ooltah Chashmah Lastest Episode

Aladin Naam Toh Sunga Hoga Latest Episode

Yeh Rishta Kya Kehlata Hai Latest Episode

Bigg Boss Latest Episode

Bepanah Latest Episode

Yeh Hai Mohabbatein Latest Episode

Silsila Badalte Rishton Ka Latest Episode

You See News

Posted by Taarak Mehta Ka Ooltah Chashmah Latest Episode at

Add your comment