Discussion:
[Jmol-users] dimensions of the bounding box?
timothy driscoll
2004-11-20 21:43:02 UTC
Permalink
hi,

does anyone know a way to query the Jmol-applet for the dimensions of
the bounding box?


thanks,

tim
--
Timothy Driscoll
molvisions - see, grasp, learn.
<http://www.molvisions.com/>
usa:north carolina:wake forest
Miguel
2004-11-21 03:04:04 UTC
Permalink
Post by timothy driscoll
does anyone know a way to query the Jmol-applet for the dimensions of
the bounding box?
Hmmm ... don't think so.

I suppose that we could echo them to the MessageCallback when someone says
'boundbox on'


Miguel
timothy driscoll
2004-11-21 16:53:17 UTC
Permalink
Post by Miguel
Post by timothy driscoll
does anyone know a way to query the Jmol-applet for the dimensions
of the bounding box?
Hmmm ... don't think so.
I suppose that we could echo them to the MessageCallback when
someone says 'boundbox on'
... or have a separate script command - boundbox measure, or something
like that...


any way I can access them would be ok with me :-)


regards,

tim
--
Timothy Driscoll
molvisions - see, grasp, learn.
<http://www.molvisions.com/>
usa:north carolina:wake forest
Miguel
2004-12-13 14:43:00 UTC
Permalink
Post by timothy driscoll
does anyone know a way to query the Jmol-applet for the dimensions of
the bounding box?
I think the way we should handle this is by printing out the dimensions
when someone says 'set boundbox on'

We should output both the coordinates of the corners and the lengths of
the sides.

Please recommend an output format.


Miguel
timothy driscoll
2004-12-14 13:10:02 UTC
Permalink
Post by Miguel
Post by timothy driscoll
does anyone know a way to query the Jmol-applet for the dimensions
of the bounding box?
I think the way we should handle this is by printing out the
dimensions when someone says 'set boundbox on'
ok, that sounds great.
Post by Miguel
We should output both the coordinates of the corners and the lengths
of the sides.
can you output values in Angstroms? corner coordinates relative to center of molecule? what are your thoughts?
Post by Miguel
Please recommend an output format.
# height width depth c1 c2 c3 c4 c5 c6 c7 c8


is that ok?


regards,

tim
--
Timothy Driscoll
molvisions - see, grasp, learn.
<http://www.molvisions.com/>
usa:north carolina:wake forest

"I've had a perfectly wonderful evening. But this wasn't it." - Groucho Marx
Miguel
2004-12-14 13:46:01 UTC
Permalink
Post by timothy driscoll
Post by Miguel
We should output both the coordinates of the corners and the lengths
of the sides.
can you output values in Angstroms?
Yes. All coordinates in the scripting language are measured in Angstroms.
Post by timothy driscoll
corner coordinates relative to center of molecule?
corner coordinates are x,y,z tuples
Post by timothy driscoll
what are your thoughts?
Post by Miguel
Please recommend an output format.
# height width depth c1 c2 c3 c4 c5 c6 c7 c8
is that ok?
The boundbox works relative to the cartesian axes. So for the lengths,
lets say

{length-along-the-x-axis} {length-along-the-y-axis} {length-along-the-z-axis}

Now each of the corners is an x,y,z triple. They should certainly be comma
separated. There should not be spaces after the commas ... so that one can
easily parse out the individual components.

Q: Do we want to put the triples in parentheses or not?

x0,y0,z0
OR
(x0,y0,z0)


Lets consider the case where input coordinates are _balanced_ such that
the center of the molecule is at 0,0,0.

We need to choose what the order of the corners is. I suggest that we
order it such that, if the box were centered at 0,0,0, then the
coordinates would be:

x,y,z
x,y,-z
x,-y,z
x,-y,-z
-x,y,z
-x,y,-z
-x,-y,z
-x,-y,-z

And, in this case the lengths reported would be 2x 2y 2z

So, we have a lot of data. the entire line would be

2x 2y 2z x,y,z x,y,-z x,-y,z x,-y,-z -x,y,z -x,y,-z -x,-y,z -x,-y,-z

That is a total of 3+3*8 = 27 numbers. Each one will have
- 1 space or comma
- 1 decimal point
- 1 or more digits (typically 3) to the left of the decimal point
- 3 digits to the right of the decimal point
- typically half will have minus signs
- if we put the triples in parentheses then add 16.

So, we have a absolute minimum of 6 * 27 = 162 chars. For macromolecules a
typical number will be more like 8.5 * 27 = 229.5 chars

So, we are talking between 200 and 250 chars.

I don't think we want to return all this on one line.

Perhaps we should put the lengths on one line and then each of the corners
on a line by itself.

Q: What do you think?

Q: Do you want the triples in (parentheses) ?


Miguel
timothy driscoll
2004-12-14 14:01:03 UTC
Permalink
Post by Miguel
So, we are talking between 200 and 250 chars.
I don't think we want to return all this on one line.
Perhaps we should put the lengths on one line and then each of the
corners on a line by itself.
Q: What do you think?
Q: Do you want the triples in (parentheses) ?
Miguel
while I'm digesting this, a quick question:

are the boundingbox dimensions only calculated when 'set boundingbox on' is called?


tim
--
Timothy Driscoll
molvisions - see, grasp, learn.
<http://www.molvisions.com/>
usa:north carolina:wake forest

"What a man desires, he also imagines to be true." - Demosthenes
Miguel
2004-12-14 14:19:01 UTC
Permalink
Post by timothy driscoll
are the boundingbox dimensions only calculated when 'set boundingbox on' is called?
Good question.

The answer is .... mostly.

But if you want to know the dimensions you can turn it on and then turn it
back off.

*** 2 minutes later ***

Your question spurred a good thing.

Here is the new proposal, because this is essentially the way that I do it
internally.

I could/should return to you the center of the boundbox and then the
*vector* to the corner of the boundbox.

With that vector you can add/subtract from the center to get the corner
points if you want to.

You can also double the components of that vector in order to calculate
the lengths.

(centerX,centerY,centerZ) (cornerVectorX,cornerVectorY,cornerVectorZ)


The length along the x side is 2*cornerVectorX.


You need to do more arithmetic, but you don't have to do nearly as much
parsing.

Q: What do you think?



Miguel
timothy driscoll
2004-12-14 14:28:02 UTC
Permalink
Post by Miguel
Post by timothy driscoll
are the boundingbox dimensions only calculated when 'set boundingbox
on' is called?
Good question.
The answer is .... mostly.
But if you want to know the dimensions you can turn it on and then
turn it back off.
*** 2 minutes later ***
Your question spurred a good thing.
Here is the new proposal, because this is essentially the way that I
do it internally.
I could/should return to you the center of the boundbox and then the
*vector* to the corner of the boundbox.
With that vector you can add/subtract from the center to get the
corner points if you want to.
You can also double the components of that vector in order to
calculate the lengths.
(centerX,centerY,centerZ)
(cornerVectorX,cornerVectorY,cornerVectorZ)
The length along the x side is 2*cornerVectorX.
You need to do more arithmetic, but you don't have to do nearly as
much parsing.
Q: What do you think?
this sounds much better. math is easier/better than parsing. plus it dramatically reduces the length of the returned string.

thanks, Miguel!


tim
--
Timothy Driscoll
molvisions - see, grasp, learn.
<http://www.molvisions.com/>
usa:north carolina:wake forest

"Who, my friend, can scale heaven?" - Sumer (from Gilgamesh)
Loading...