Jason, more thoughts on this on the plane last night....

What you suggest might be possible -- even now -- but I suggest we start
talking about a new object type. Maybe a "plot3d" that is an extended
isosurface. We already have that for molecular orbitals, LCAO cartoons, and
pmesh. The way it works is that the extended object has more capabilities --
in this case, to map more than just contours onto an isosurface. Like you
say, a totally variable mesh, which would just be a set of lines of variable
width, color, and translucency. Possibly annotations. In addition, possibly,
automatic scaling. Right now you have to do some transforms that are
oblivious to Jmol. I'd like the oblivious part to be in the use interface
and let Jmol take care of anisotropic scaling.

As for access to the triangles, if I tell you a few secrets, will you
promise me not to spread it around too much? (yeah, yeah, that's a joke...)

After creating a surface on a web page (say, for example,
http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm
with

load 1crn.pdb;isosurface molecular

then issue from the address line of the browser:

javascript:alert(jmolGetPropertyAsJavaObject("JmolViewer").getModelSet().getShape(22).getMesh("isosurface1").vertices)

or, for example:

javascript:alert(jmolGetPropertyAsJavaObject("JmolViewer").getModelSet().getShape(22).getMesh("isosurface1").polygonIndexes)

That "22" is subject to change at the whim of the developer. But that's all
the information you are looking for, I think. So you could, in principle,
draw any lines now using the DRAW LINE command (which draws any number of
connected segments)

But that's not necessarily that efficient, and we should talk about what you
think would be really great to have. The way we would do this would be to
create a new package called "math" and load it up with the coolest Java you
can find. It would not be a load on any other user, because unless you
accessed the "plot" object or whatever we call it, that package would not be
delivered.

Bob





On Wed, Oct 14, 2009 at 4:51 PM, <jason-s...@creativetrax.com> wrote:

> I've been using jmol quite a bit lately in Sage for drawing 3d
> mathematical surfaces.  One thing I really miss is the ability to have
> nice meshes (including arbitrary meshes) on a surface.  Currently Jmol
> allows a mesh option to pmesh surfaces, but that only draws a specific
> grid that is hard to see (it is the same color as the surface, but
> lighter or something).
>
> Probably the easiest change would be to make the mesh default to black
> lines (like the black lines for contour plots on cut planes).  That
> would make the mesh lines much easier to see.  Seeing the mesh lines
> often really helps us mathematicians (especially those of us teaching).
>
> A very nice functionality to add would be the ability to draw arbitrary
> meshes on surfaces, similar to what is implemented here (but as black
> lines on the surface, rather than the crude approximation constructed
> here):
>
> http://trac.sagemath.org/sage_trac/attachment/ticket/5511/mesh_function.jpeg
> .
>  I think Mathematica has a nice interface to these sorts
> of things: http://reference.wolfram.com/mathematica/ref/MeshFunctions.html
>
> We (Sage) can take care of the interface to draw meshes.  What we'd need
> from jmol is the ability to draw a line *on* a surface and have it look
> like the contour lines look like on a plane.  Maybe for each triangle in
> the surface, we could give a list of lines to draw on that triangle by
> specifying (for each line) the two edges the line crosses and the
> fraction of the distance along the edge to make the intersection between
> the line and the edge of the triangle.
>
> What do you think?
>
> Thanks,
>
> Jason
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to