Liberty BASIC Community Forum
« Nucleation and growth »

Welcome Guest. Please Login or Register.
Jun 25th, 2017, 05:20am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Nucleation and growth  (Read 391 times)
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx Nucleation and growth
« Thread started on: Jun 29th, 2016, 11:50am »

Imagine a sheet of glass, kept below zero Celsius, and exposed to humid air. Every now and then an ice cystal nucleates at a random spot, triggered by imperfections on the surface or impurities on the surface.
Once nucleated, this crystal grows outward at a fixed rate.
However at random intervals others nucleate and start growing.
Growth of the crystals continues until they meet another one- but they can grow for ever if they DON't meet another.
What shapes result?

This seemed fun to play with, using my drawing functions. Here's the result of crystals that grow at the same speed in all directions. ( Now to try with hexagonal growth, more like ice)

User Image
The same model can represent growing colonies of bacteria, or towns and regions extending into uninhabited areas ( not that there are many of THOSE left)
« Last Edit: Jun 29th, 2016, 11:51am by tenochtitlanuk » User IP Logged

CarlGundel
Administrator
ImageImageImageImageImage


member is offline

Avatar

author of Liberty BASIC


Homepage PM


Posts: 2806
xx Re: Nucleation and growth
« Reply #1 on: Jun 30th, 2016, 07:16am »

That's fun. Would you be willing to post the code?

-Carl
User IP Logged

author of Liberty BASIC
http://www.libertybasic.com
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx Re: Nucleation and growth
« Reply #2 on: Jun 30th, 2016, 3:26pm »

Very much 'work in progress', but see drawing3Lsn.zip Warts and all. I really ought to start it again now I know better what I wanted to do!
See the last examples, but try the others....

It's part of a lesson on LB being used to create such graphics- several of the other lessons have been referred to on the forum.

GREAT to see you around! I know what a full day of work +commute can do to limit your days! As ever, thanks for LB and its development. And I reckon the lsn format is one of its most undervalued resources...

I'll wave my thanks as I fly over you en route to Salt Lake City in a couple of months!

JohnF /tnochtitlanuk
User IP Logged

CarlGundel
Administrator
ImageImageImageImageImage


member is offline

Avatar

author of Liberty BASIC


Homepage PM


Posts: 2806
xx Re: Nucleation and growth
« Reply #3 on: Jul 1st, 2016, 08:00am »

on Jun 30th, 2016, 3:26pm, tenochtitlanuk wrote:
Very much 'work in progress', but see drawing3Lsn.zip Warts and all. I really ought to start it again now I know better what I wanted to do!
See the last examples, but try the others....

It's part of a lesson on LB being used to create such graphics- several of the other lessons have been referred to on the forum.

GREAT to see you around! I know what a full day of work +commute can do to limit your days! As ever, thanks for LB and its development. And I reckon the lsn format is one of its most undervalued resources...

I'll wave my thanks as I fly over you en route to Salt Lake City in a couple of months!

JohnF /tnochtitlanuk

Come to Boston! smiley

You've inspired me to write a post about the lesson browser on my blog here. http://basicprogramming.blogspot.com

-Carl
User IP Logged

author of Liberty BASIC
http://www.libertybasic.com
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx Re: Nucleation and growth
« Reply #4 on: Jul 16th, 2016, 06:18am »

In extending the possibilities I needed Bresenham's algorithm to draw lines while checking existing color of each pixel.
We discussed Bresenham ( and Wu) here before, and for some reason didn't put it on Rosetta Code.
Anyway, I reinvented the wheel. This animation uses a sneaky hidden mask.
User Image
Code as always will be updated on my site...
« Last Edit: Jul 16th, 2016, 12:11pm by tenochtitlanuk » User IP Logged

tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1154
xx Re: Nucleation and growth
« Reply #5 on: Jul 21st, 2016, 5:58pm »

... nearly got the hexagonal growth version working...
User Image
Unfortunately the Bresenham algorithm leaves gaps that are visible and can allow colour leakage ( difficult to do much about these), and because I draw the shapes clockwise and in the same order there are incorrect distortions at the junctions ( which I can minimize)

Quite pleased with it anyway- reminds me of polishing brass samples for microphotography in my metallurgy days!
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls