Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Sam Bryfczynski <sbryfcz@gm...>  20090718 19:52:45
Attachments:
Message as HTML

Hello,I like how compact the jvxl format is and would like to use it in my own software. However, I am having a bit of trouble wrapping my head around how to uncompress it. I've read over the JVXL file pdf which describes the format but am left scratching my head a bit. I am mainly confused about what the surface voxel bitmap data is. It says you can use it to find the "critical edges" but I don't know how. When the document says "We simply list the number of voxels found sequentially on each side: 115922 outside, 2 inside, 6333 outside, 4 inside…" what does "on each side" mean? The bottom line is I am trying to just get the polygons needed to render the isosurface from the jvxl data. Ive been looking at the source code and the JvxlReader class and trying to figure out how to best approach this. Any suggestions? Thanks,  Sam Bryfczynski Computer Science Clemson University 
From: <jasonsage@cr...>  20090718 20:33:50

Sam Bryfczynski wrote: > Hello, > I like how compact the jvxl format is and would like to use it in my > own software. However, I am having a bit of trouble wrapping my head > around how to uncompress it. I've read over the JVXL file pdf which > describes the format but am left scratching my head a bit. I am > mainly confused about what the surface voxel bitmap data is. It says > you can use it to find the "critical edges" but I don't know how. > When the document says "We simply list the number of voxels found > sequentially on each side: 115922 outside, 2 inside, 6333 outside, 4 > inside…" what does "on each side" mean? The bottom line is I am trying > to just get the polygons needed to render the isosurface from the jvxl > data. Ive been looking at the source code and the JvxlReader class > and trying to figure out how to best approach this. Any suggestions? A few months ago a JVXL interpreter written in Python was added to Sage. From working with that, I think the general procedure might be explained as: Split 3d space up into lots of regions (voxels). Now traverse the edges of these voxels in a predetermined order. You will cross your isosurface a number of times during this traversal. Every time you cross your isosurface, you go from the "inside" to the "outside" or the "outside" to the "inside". The JVXL format records how many steps you must take before crossing the isosurface. So the numbers above mean that in your traversal of 3d space, you take 115922 steps, and then on the next step, you cross the isosurface. You take two more steps in your traversal and you cross your isosurface again, etc. Basically, since the traversal pattern is already known (specified in the format), just counting the number of steps until you cross the surface tells you approximately where a point on the surface is in 3d space. I believe the Sage Python/Cython implementation is here: http://hg.sagemath.org/sagemain/file/285a89ed5dc7/sage/plot/plot3d/implicit_surface.pyx Anyone, feel free to correct me if I'm saying something wrong! Thanks, Jason 
From: <jasonsage@cr...>  20090718 20:50:28

Sam Bryfczynski wrote: > Hello, > I like how compact the jvxl format is and would like to use it in my > own software. However, I am having a bit of trouble wrapping my head > around how to uncompress it. I've read over the JVXL file pdf which > describes the format but am left scratching my head a bit. I am > mainly confused about what the surface voxel bitmap data is. It says > you can use it to find the "critical edges" but I don't know how. > When the document says "We simply list the number of voxels found > sequentially on each side: 115922 outside, 2 inside, 6333 outside, 4 > inside…" what does "on each side" mean? The bottom line is I am trying > to just get the polygons needed to render the isosurface from the jvxl > data. Ive been looking at the source code and the JvxlReader class > and trying to figure out how to best approach this. Any suggestions? > Thanks, > In a previous message, I wrote the wrong link to the Sage implementation of a JVXL interpreter, because we don't have it in Sage yet. An early version of it is here: http://trac.sagemath.org/sage_trac/attachment/ticket/5249/implicitsurface.patch (search for jvxl to see various classes). Another way to think about JVXL is that it is the runlength encoding of a string 0 0 0 0 1 1 1 1 1 0 0 (0 means you are on one side of the surface, 1 means you are on the other side, each number represents a position in your 3d traversal of space) which encodes down to 4 5 2 Unlike usual runlength encoding, you don't have to specify the value since you know that the values alternate between 0 and 1. So you only need to encode the number of steps you take before crossing the surface again. Thanks, Jason  Jason Grout 
From: Robert Hanson <hansonr@st...>  20090718 23:10:42
Attachments:
Message as HTML

That's basically it. Sam, the key is that the method uses the Marching Cubes algorithm with a VERY specific sequence of checking vertices. No vertex is ever checked twice, but you have to get it exactly right. My Jmol Java implementation of Marching Cubes is at http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/src/org/jmol/jvxl/calc/MarchingCubes.java That expects a BitSet indicating the in/out nature of the vertices coming from the decoder. The decoding is done in http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/src/org/jmol/jvxl/readers/JvxlReader.java where the actual decoding from integers in the file to a BitSet is in the following method. nPoints integers are expected in the file. protected BitSet getVoxelBitSet(int nPoints) throws Exception { BitSet bs = new BitSet(); int bsVoxelPtr = 0; if (surfaceDataCount <= 0) return bs; //unnecessary  probably a plane int nThisValue = 0; while (bsVoxelPtr < nPoints) { nThisValue = parseInt(); if (nThisValue == Integer.MIN_VALUE) { line = br.readLine(); // note  does not allow for empty lines; // must be a continuous block of numbers. if (line == null  (nThisValue = parseInt(line)) == Integer.MIN_VALUE) { if (!endOfData) Logger.error("end of file in JvxlReader?" + " line=" + line); endOfData = true; nThisValue = 10000; //throw new NullPointerException(); } } thisInside = !thisInside; ++jvxlNSurfaceInts; if (thisInside) bs.set(bsVoxelPtr, bsVoxelPtr + nThisValue); bsVoxelPtr += nThisValue; } return bs; } This method is being called by readSurfaceData(boolean isMapData). Let us know if you still need help there. (Please use jmoldevelopers list for programming issues like this.) Bob On Sat, Jul 18, 2009 at 2:52 PM, Sam Bryfczynski <sbryfcz@...> wrote: > Hello,I like how compact the jvxl format is and would like to use it in my > own software. However, I am having a bit of trouble wrapping my head around > how to uncompress it. I've read over the JVXL file pdf which describes the > format but am left scratching my head a bit. I am mainly confused about > what the surface voxel bitmap data is. It says you can use it to find the > "critical edges" but I don't know how. When the document says "We simply > list the number of voxels found sequentially on each side: 115922 outside, 2 > inside, 6333 outside, 4 inside…" what does "on each side" mean? The bottom > line is I am trying to just get the polygons needed to render the isosurface > from the jvxl data. Ive been looking at the source code and the JvxlReader > class and trying to figure out how to best approach this. Any suggestions? > Thanks, > >  > Sam Bryfczynski > Computer Science > Clemson University > > >  > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Jmolusers mailing list > Jmolusers@... > https://lists.sourceforge.net/lists/listinfo/jmolusers > >  Robert M. Hanson Professor of Chemistry St. Olaf College 1520 St. Olaf Ave. Northfield, MN 55057 http://www.stolaf.edu/people/hansonr phone: 5077863107 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 
Sign up for the SourceForge newsletter:
No, thanks