I just tried out the wrl format for the isosurface of a small
molecule, but I think this may not be the best choice for what I need.
Since .wrl stores color information I would need to convert that back
into the actual electrostatic potential values that I need. Assuming I
reverse Jmol's value-to-color function, there seems to be a bigger
problem too. In my x["vertexValues"] object there are 3317 distinct
values, while only 33 values distinct ones show up in the "color Color
{ color" section of the wrl file. That suggests to me that it's not
possible to recover the original potential values from the wrl color
data.

Embedding Jmol may be the best option for me. I adapter
org.jmol.Integration to compute the sasurface like this:

strScript = "isosurface sasurface 1.4;";

      jmolPanel.viewer.evalString(strScript);
      Map<?, ?> map;
      do {
        map = (Map<?, ?>) jmolPanel.viewer.getProperty("java",
"isosurfaceInfo", null);
        System.out.println("map=" + map);
      } while (map == null);
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {
        // TODO
      }
      map = (Map<?, ?>) jmolPanel.viewer.getProperty("java",
"isosurfaceInfo", null);
      System.out.println("map=" + map);

The above code prints "map=null;" a fair number of times, after which
it prints "map={haveQuads=false, polygonCount=0, vertexCount=0,
id=isosurface1}" and then finally "map={polygons=[[I@35799785,
haveQuads=false, vertices=[Ljavax.vecmath.Point3f;@41cab830,
polygonCount=17188, vertexValues=[F@6402790e, vertexCount=8596,
id=isosurface1}". Is there a way to be notified when the script
finished executing so that the properties of interest can be retrieved
without any data racing issues?

On 25 June 2012 01:48, Robert Hanson <[email protected]> wrote:
>
>
> On Sun, Jun 24, 2012 at 1:02 PM, Daniel Aioanei <[email protected]> wrote:
>>
>> I would like to use to export the surface data and to use it outside
>> jmol. For that I exported the surface with "write mesh isosurface
>> <path.xjvxl>", but now I have a few more questions:
>>
>> 1. Is it true that "write mesh" should put enough information for my
>> needs in the xjvxl file, and that "write isosurface" is not necessary
>> for my goals?
>>
> I don't know that I would  use WRITE MESH. It may be best to write the
> surface to VRML with:
>
> display none;
> write xxx.wrl
>
> This is a nice format that provides all the details in readable format.
>
>>
>> 2. x = getProperty("isosurfaceInfo"); print x["polygons"] seems to
>> show that the polygons have 5 vertices each (i.e., they are
>> pentagons). However in the mesh xjvxl file there is triangle data. Is
>> each pentagon split into 3 triangles to create the triangle data?
>>
>
> The last two numbers relate to the association of points necessary for
> smooth formation of normals and to the pattern of edges that will be
> displayed with the MESH option. You can ignore them.
>
>>
>> 3. What is the difference between jvxlTriangleData and
>> jvxlTriangleEdgeData?
>>
>
> This is a compressed format. I don't think you need to work with that.
>
>
>>
>> 4. Is the vertex data from jvxlVertexData represented in Angstroms?
>> The same also holds for the "min" and "max" attributes? Is the vertex
>> data represented by any chance relative to the "min" position?
>>
>
>
>
>>
>> 5. Why is the number of triangles exactly twice the number of vertices
>> in the xjvxl file?
>>
>> 6. I would like to use the Jmol Reader API to read the .xjvxl files in
>> Java, but I need some help to figure out how to do that. I tried the
>> following:
>>
>>        SurfaceGenerator sg = new SurfaceGenerator();
>>        sg.setParameter("readFile", br);
>>        JvxlData jvxlData = sg.getJvxlData();
>>        System.out.println(jvxlData);
>>
>
> I really think you are way better off with the clearly readable WRL format
> or, especially if you are embedding Jmol into your application and not just
> reading files, the getProperty business. With the latter, you can get the
> whole isosurface structure as a Java Object and never do any translation.
>
>
>>
>> but I'm able to find neither the triangle data nor the vertex data. In
>> particular, JvxlXmlReader.jvxlDecodeTriangleData (latest svn version)
>> executes on line 704 the statement "int[][] triangles = null;" and
>> later on line 773 it executes "return triangles", without changing the
>> mentioned local variable in between. However it does pass further the
>> triangle data using "addTriangleCheck". Any hints about how to get
>> hold of the triangle and vertex data through the Reader API, perhaps
>> transformed into Angstroms, would be highly appreciated.
>>
>> 7. If I could save the x["vertices"], x["polygons"] and
>> x["vertexValues"] to something like a .csv file, or a Java serialized
>> file, or some other simple format, that would work for me. How can I
>> do that?
>
>
> see if that WRL option gets you what you need. That also adds normals.
>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> Chair, Chemistry Department
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> 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
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to