POV-Ray : Newsgroups : povray.general : <no subject> Server Time
1 Mar 2024 20:10:10 EST (-0500)
  <no subject> (Message 1 to 9 of 9)  
From: Thomas Fester
Subject: <no subject>
Date: 21 Jan 2024 08:45:00
Message: <web.65ad1f84c23a6d991f41fb48a2a825f@news.povray.org>
As already anounced I am starting a series on modeling chemical models and here
is my first example: fullerene. From a didactic point of view I should have
started with graphene/graphite, but I wanted something a bit more spectacular.
Reflecting all the time I invested in this molecule, it seems pretty easy to
model, when you look at my final video:
https://www.youtube.com/watch?v=wqR_b8usU4Q.

I also deposited the Pov-Ray file in Github:
https://github.com/tjrfester/Modeling-Nature-Chemistry

Currently it is the only structure in this repository - I will work on this in
the coming weeks.

By the way, I already noted two minor mistakes in the video...


Post a reply to this message


Attachments:
Download '01fullerene.png' (280 KB)

Preview of image '01fullerene.png'
01fullerene.png


 

From: Bald Eagle
Subject: Re: <no subject>
Date: 21 Jan 2024 19:10:00
Message: <web.65adb15e6f92e8561f9dae3025979125@news.povray.org>
Hi Thomas,

Buckminsterfullerene (BF) is quite interesting - I remember clearly when they
were discovered in 1985 - it was a big deal, even though I was only in HS and
didn't understand why (yet).

From a didactic point, you should have started with basic bonding,
Hund/Aufbau/orbital-filling, VSEPR, and orbital hybridization to show how atoms
bond, why they adopt the shapes that they do, and explain why certain atoms have
the number of bonds that they do.  And of course, since we're talking about
Buckminsterfullerene, you should probably mention aromaticity, and what makes BF
interesting and why its discovery was so important, and why 3 people won the
Nobel prize for its discovery...
(Even if you only do so VERY briefly.  You could also just talk about it and
provide links in your video description / GitHub)
I know, I know....

Although I'm personally happy that you covered the topic, I think you might
scare off some people by diving right into the geometry of dihedral angles, etc.

"Reflecting all the time I invested in this molecule, it seems pretty easy to
model, ..."  Maybe.  I haven't tried your way yet, and when I looked at your
code on GitHub, it's 1134 lines.  I think it might be time to introduce arrays
and macros, and the blessings of shorter code.  :)
Also, if you're thinking of modeling larger molecules, maybe #read from ASCII
CSV file would be a good topic to cover in advance.
(I found an .xyz file at:
https://www.researchgate.net/profile/Marco-De-La-Pierre/publication/308325208_Coordinates_of_nn_fullerenes_with_n_1-10_
xyz_format/data/57e0cdc608ae3f2d793ebb43/fulle-xyz.zip
)

Since Buckminsterfullerene is a truncated icosahedron, I used the description of
the vertices here:
https://en.wikipedia.org/wiki/Truncated_icosahedron
and once I puzzled out the meaning of the "even permutations" part, I think I
have all the vertices plotted.  (without having them all connected it's hard to
tell)
(I was really hoping that someone had invented some sort of amazing parametric
equation that would give the vertex locations as the result!  :D )

Maybe once I have it all worked out and connected with bonds, I can compare the
positions of atoms in each model.

It's interesting that you do almost all of your work with blobs.
First, blobs were developed by James Blinn to model DNA for Carl Sagan's
_Cosmos_.  So, there's some wicked cool history there.
One of my very first renders in the early 2000's was a DNA double-helix!  :)

Second, jr was just asking about blobs, and I found a lot of interesting
information about how metaballs can be implemented, with different shapes other
than spheres, and using different smoothing functions.  Pixar's Renderman has
some pretty impressive stuff in that area.

I noticed that you had some interesting creases in the contours of your blobs -
I'm wondering if we can improve on POV-Ray's stock blob implementation...

Overall, a nice video, showing how to build up a complex structure, layer by
layer, and using symmetry to simplify the task.

Another interesting way to model the 2nd half of the structure would be to use
the symmetry through the center of inversion.  And maybe the lower half could be
simplified into 5 sections that could be copied by rotation.
http://www.creative-science.org.uk/c60group.html

I'm looking forward to seeing what your future ideas for the series are!

- Bill


Post a reply to this message

From: Bald Eagle
Subject: Re: <no subject>
Date: 28 Jan 2024 17:20:00
Message: <web.65b6d29e6f92e8561f9dae3025979125@news.povray.org>
So, I hunted down a typo in one of my array definitions, and then figured out a
simple 3-line method for skipping 12 redundant vertices.

Since the entire molecule is sp2-hybridized, there are only 3 bonds to any atom.
 It's also easy to just do a distance check to see where to connect atoms.  So
the placement of all 90 cylinders in this scene is fully automated.
(thankin' my lucky stars ...)

So all of that takes 100 lines of code.
Of course, to adapt and paraphrase what someone once said about optimization, if
one method takes a week to write, and another method only takes a day to write,
but needs 6 days of research - then they're both equally efficient.  :D

Aside from differences in orientation, my model looks identical to Thomas'.

I thought it would be interesting to visualize the permutations of the "basis
vertices" of the truncated icosahedron, and with 8 permutations of sign change,
that would give me the vertices of a cube for each basis vertex.
Each vertex has 3 vector components, with a total number of permutations
equaling factorial (3) = 6, and the even permutations is only half that, so
there are 3.
3 basis vertices x 3 permutations each = 9 "expanded basis vertices"

Each of these vertices just get moved around the signed permutations of the unit
vector, so I can just multiply each vertex by <-1, -1 -1> and <1, 1, 1> to get
the corners of each box {}

Using the color array from my permutations scene and adding rgb 0.5 to get a
ninth color let me assign each box a color using the index value of my loop.

Then I just use a pared-down copy of my atom-connecting loop to join the
vertices.

I'd like to get an even-permutation routine that I found working for SDL, and
also maybe find a way to highlight the symmetry groups.  Perhaps then I can trim
down the structure to the smallest repeating unit and assemble the whole thing
with nothing but rotations of that one unit.  Assigning a transform matrix to
orient the fullerene to any of the 4 basic views would be nice as well.
https://www.qfbox.info/4d/buckyball

I'm also NOT enamored by POV-Ray's blob function, and might see about working
out something with functions and an isosurface to see if I can get a smoother,
more pleasing result.

I don't see myself solving the Schrodinger equation for the hybridized orbitals
any time soon (<--- never), but maybe someone has a nice approximation function
posted somewhere.

- BW


Post a reply to this message


Attachments:
Download 'fullerene.png' (248 KB)

Preview of image 'fullerene.png'
fullerene.png


 

From: Cousin Ricky
Subject: Re: <no subject>
Date: 29 Jan 2024 11:59:08
Message: <65b7d95c@news.povray.org>
On 2024-01-28 18:18 (-4), Bald Eagle wrote:
> 
> I'm also NOT enamored by POV-Ray's blob function, and might see about working
> out something with functions and an isosurface to see if I can get a smoother,
> more pleasing result.

The tutorial has an isosurface technique that I am not enamored with,
but you might want to try it anyway:


https://wiki.povray.org/content/Documentation:Tutorial_Section_3.2#Combining_isosurface_functions

I published an alternative isosurface function RE_fn_Blob2() in
RoundEdge.  See the user manual for how to use it:

  https://github.com/CousinRicky/POV-RoundEdge

I once came up with a couple of trig-based formulas, but I haven't
looked at them in almost 20 years.  If I find that they eliminate 1st
derivative discontinuities, I might resurrect them.


Post a reply to this message

From: Bald Eagle
Subject: Re: <no subject>
Date: 29 Jan 2024 15:00:00
Message: <web.65b802f96f92e8561f9dae3025979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:

> The tutorial has an isosurface technique that I am not enamored with,
> but you might want to try it anyway:

Yes, I've done that before, and if memory serves me correctly, it was SLOW.

> I published an alternative isosurface function RE_fn_Blob2() in
> RoundEdge.  See the user manual for how to use it:
>
>   https://github.com/CousinRicky/POV-RoundEdge

Good to know - I'll have a look.  :)

> I once came up with a couple of trig-based formulas, but I haven't
> looked at them in almost 20 years.  If I find that they eliminate 1st
> derivative discontinuities, I might resurrect them.

I went a-looking for alternative metaball equations, as I came across some
websites essentially claiming that people use superquadratic ellipsoids as
blobbable objects, and that immediately caught my interest.

I may very well take a more detailed look into the subject, and I think that
maybe some simple changes to the primitives themselves might be the key.   Using
bounded SDF's, or something to that effect.

I've always wanted to blob an infinite hexagonal grid, and I've gotten pretty
close to what I've wanted.  I think I started off trying to blob tori spaced out
on a hex grid...


Thanks for the ideas - it's right along the lines of what I've been thinking
about.

- BW


Post a reply to this message

From: Thomas Fester
Subject: Re: <no subject>
Date: 31 Jan 2024 17:45:00
Message: <web.65bacc3b6f92e85691f41fb48a2a825f@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> Hi Thomas,
>
> Buckminsterfullerene (BF) is quite interesting - I remember clearly when they
> were discovered in 1985 - it was a big deal, even though I was only in HS and
> didn't understand why (yet).
>
> From a didactic point, you should have started with basic bonding,
> Hund/Aufbau/orbital-filling, VSEPR, and orbital hybridization to show how atoms
> bond, why they adopt the shapes that they do, and explain why certain atoms have
> the number of bonds that they do.  And of course, since we're talking about
> Buckminsterfullerene, you should probably mention aromaticity, and what makes BF
> interesting and why its discovery was so important, and why 3 people won the
> Nobel prize for its discovery...
> (Even if you only do so VERY briefly.  You could also just talk about it and
> provide links in your video description / GitHub)
> I know, I know....
>
> Although I'm personally happy that you covered the topic, I think you might
> scare off some people by diving right into the geometry of dihedral angles, etc.
>
> "Reflecting all the time I invested in this molecule, it seems pretty easy to
> model, ..."  Maybe.  I haven't tried your way yet, and when I looked at your
> code on GitHub, it's 1134 lines.  I think it might be time to introduce arrays
> and macros, and the blessings of shorter code.  :)
> Also, if you're thinking of modeling larger molecules, maybe #read from ASCII
> CSV file would be a good topic to cover in advance.
> (I found an .xyz file at:
>
https://www.researchgate.net/profile/Marco-De-La-Pierre/publication/308325208_Coordinates_of_nn_fullerenes_with_n_1-1
0_
> xyz_format/data/57e0cdc608ae3f2d793ebb43/fulle-xyz.zip
> )
>
> Since Buckminsterfullerene is a truncated icosahedron, I used the description of
> the vertices here:
> https://en.wikipedia.org/wiki/Truncated_icosahedron
> and once I puzzled out the meaning of the "even permutations" part, I think I
> have all the vertices plotted.  (without having them all connected it's hard to
> tell)
> (I was really hoping that someone had invented some sort of amazing parametric
> equation that would give the vertex locations as the result!  :D )
>
> Maybe once I have it all worked out and connected with bonds, I can compare the
> positions of atoms in each model.
>
> It's interesting that you do almost all of your work with blobs.
> First, blobs were developed by James Blinn to model DNA for Carl Sagan's
> _Cosmos_.  So, there's some wicked cool history there.
> One of my very first renders in the early 2000's was a DNA double-helix!  :)
>
> Second, jr was just asking about blobs, and I found a lot of interesting
> information about how metaballs can be implemented, with different shapes other
> than spheres, and using different smoothing functions.  Pixar's Renderman has
> some pretty impressive stuff in that area.
>
> I noticed that you had some interesting creases in the contours of your blobs -
> I'm wondering if we can improve on POV-Ray's stock blob implementation...
>
> Overall, a nice video, showing how to build up a complex structure, layer by
> layer, and using symmetry to simplify the task.
>
> Another interesting way to model the 2nd half of the structure would be to use
> the symmetry through the center of inversion.  And maybe the lower half could be
> simplified into 5 sections that could be copied by rotation.
> http://www.creative-science.org.uk/c60group.html
>
> I'm looking forward to seeing what your future ideas for the series are!
>
> - Bill

Hi Bill,

thanks for all the constructive comments - also in the subsequent discussion! I
will not cover everything here, but rather implement a few things in later
videos/scripts.

Referring to basic chemistry, I am a bit unsure to which extent people are
really interested in this. Anyway, the fullerene was not thought as the starting
structure of my chemistry part and I will use the initial structures to talk a
bit more about theory. Maybe above all we should discuss what we are actually
visualizing when presenting atoms and bonds...

Admittedly my script is quite lengthy and I could have shortened by using loops
and arrays. I already introduced loops and arrays in other scripts and I will
use them later at other opportunities, but I thought for people unexperienced in
Pov-Ray this lengthy form might be easier to understand. (In addition I wanted
to avoid the work necessary to implement this here...)

I had a look at the wiki file for truncated isoahedrons and, o.k., this is also
possible. Even superior, when it is about elegance/shortness of code. The
advantage of my code is a) that I completely understand the approach (...) and
b) that after this lengthy definition of points I can now address each point
separately, knowing which point is where. So I could take this structure as a
basis for something else. (O.k., currently I have no idea what I actually could
do, in particular since fullerenes are not very reactive I guess...)

Anyway, there are always several pathways to a given problem.

I have to admit that I can't really follow the technical discussion about blobs.
It only came to my mind that blobs are somewhat similar to electron orbitals.
Orbitals as far as I understand are clouds of probability to encounter an
electron with, if I remember correctly, increasing probability towards the
center of the cloud. This is actually quite similar to metaballs. I'm not
claiming, of course that the blobs I have been using are somehow resembling the
actual fullerene orbitals.

It was interesting to look at the read-function - I never used it... I extracted
data for small molecules always by hand from xyz-files. In the case of large
molecules I wrote my own Perl-scripts for transforming pdb-data into pov-files.
As a teaser for these larger molecules, here comes a detail from the active
center of an endoglucanase with its substrate.

Btw, I apologize for posting so rarely and that it will also take some more time
until my next video...

Thomas


Post a reply to this message


Attachments:
Download 'endoglucanasej.jpg' (150 KB)

Preview of image 'endoglucanasej.jpg'
endoglucanasej.jpg


 

From: Bald Eagle
Subject: Re: <no subject>
Date: 1 Feb 2024 07:05:00
Message: <web.65bb887c6f92e8561f9dae3025979125@news.povray.org>
"Thomas Fester" <tfe### [at] scivitde> wrote:

> Hi Bill,

> Referring to basic chemistry, I am a bit unsure to which extent people are
> really interested in this.

It's just like anything else - people may not be interested .... until they are.
And they may be interested for different reasons.  So include some variety.

> Admittedly my script is quite lengthy and I could have shortened by using loops
> and arrays. I already introduced loops and arrays in other scripts and I will
> use them later at other opportunities, but I thought for people unexperienced in
> Pov-Ray this lengthy form might be easier to understand.

Of course - and like I said, it was a great overview of how to go about making
such a thing from the dihedral angle values.  Not a trivial task.
Of course, now you have an example of the long way to do it, and can compare and
contrast hand-coding every primitive with using loops, arrays, and equations to
take advantage of _patterns_ and symmetry and repetition.  I think that if you
chose your next large structure carefully, you would have a topic that a lot of
people would be very interested in.


> I had a look at the wiki file for truncated isoahedrons and, o.k., this is also
> possible. Even superior, when it is about elegance/shortness of code. The
> advantage of my code is a) that I completely understand the approach (...) and
> b) that after this lengthy definition of points I can now address each point
> separately, knowing which point is where. So I could take this structure as a
> basis for something else. (O.k., currently I have no idea what I actually could
> do, in particular since fullerenes are not very reactive I guess...)

Yes, having designed many spreadsheets and databases, there is much to be said
for keeping everything separate.  Of course, you can again show how you can
generate the same data programmatically, and store that data in arrays with
labels, etc.
And if you wanted to try using the #read function (and #write), you could try an
approach that folks here have used with complicated scenes: The first thing your
povray script does is check for the existence of the data file.  If it's NOT
there, it generates on with algorithms and #write.  Then when the scene is run a
second time, the data file exists, and it skips the algorithm part, and either
uses #read, or #include to import the data into the scene. (You could also just
set a flag to turn on/off the calculations in case you wanted to overwrite
something)


> I have to admit that I can't really follow the technical discussion about blobs.
> It only came to my mind that blobs are somewhat similar to electron orbitals.
> Orbitals as far as I understand are clouds of probability to encounter an
> electron with, if I remember correctly, increasing probability towards the
> center of the cloud. This is actually quite similar to metaballs. I'm not
> claiming, of course that the blobs I have been using are somehow resembling the
> actual fullerene orbitals.

Metaballs are essentially just the sum of the distances from the centers, but
there are other functions that provide a smoother, crease-free surface, which
gives a much better result when used with shiny surfaces due to the
discontinuous nature of the tangent / curvature at the overlap points.
Also, orbitals have the greatest density at the center of the _cloud_, not the
nucleus.  And so I hunted down a few threads that might interest you.
Also, I thought that somewhre POV-Ray had an internal function that approximated
the orbitals...  I looked in functions.inc, but didn't see anything.


http://news.povray.org/povray.binaries.images/thread/%3C57a67a03%241%40news.povray.org%3E/

http://news.povray.org/povray.binaries.images/message/%3C3d3c3a67%40news.povray.org%3E/#%3C3d3c3a67%40news.povray.org%3
E

http://news.povray.org/povray.binaries.scene-files/thread/%3C3e21fcb6%241%40news.povray.org%3E/

http://news.povray.org/povray.binaries.images/thread/%3C4140a2e7@news.povray.org%3E/

https://news.povray.org/povray.general/thread/%3Cweb.52225ef7bb284a12b26079110%40news.povray.org%3E/



> As a teaser for these larger molecules, here comes a detail from the active
> center of an endoglucanase with its substrate.

Excellent!  That's a beauty.  Youm ight also just try image searching the web
for journal covers made using povray - it might give you some ideas.


> Btw, I apologize for posting so rarely and that it will also take some more time
> until my next video...


No worries - it takes a lot of time to focus, write code, and organize
everything to make a video.

- Bill


Post a reply to this message

From: Cousin Ricky
Subject: Re: <no subject>
Date: 1 Feb 2024 10:01:47
Message: <65bbb25b$1@news.povray.org>
On 2024-02-01 08:03 (-4), Bald Eagle wrote:
> 
> Also, I thought that somewhre POV-Ray had an internal function that approximated
> the orbitals...  I looked in functions.inc, but didn't see anything.

f_quantum()?  f_torus_gumdrop()?  f_lemniscate_of_gerono()?
f_piriform()?  Or are these not exact enough?


Post a reply to this message

From: Bald Eagle
Subject: Re: <no subject>
Date: 1 Feb 2024 11:55:00
Message: <web.65bbcc956f92e8561f9dae3025979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2024-02-01 08:03 (-4), Bald Eagle wrote:
> >
> > Also, I thought that somewhre POV-Ray had an internal function that approximated
> > the orbitals...  I looked in functions.inc, but didn't see anything.
>
> f_quantum()?  f_torus_gumdrop()?  f_lemniscate_of_gerono()?
> f_piriform()?  Or are these not exact enough?

I must have somehow missed f_quantum, which is probably what I'm remembering.

I suppose I must have thought that there was one function that encompassed all
of the s through d orbitals, but I must have just been thinking of scenes where
people were rendering their own functions.


But good search-fu! And fast! I'm sure that those ought to make nice isosurfaces
with a blobbing function.

- BW


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.