NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: cross-sections of 3D objects

Hi John,

VisAD doesn't currently include operations for computing
the intersections of surfaces and planes in 3-D. However,
you might hack it as follows. Your plance can be defined by:

  ax + by + cz = d

So define a FlatField with MathType:

  ((x, y, z) -> plane)

and with your mainfold dimension = 2 Gridded3DSet as its
domain Set. Compute the 'plane' value at each sample
location as:

  ax + by + cz

Then create the ScalarMap plane -> IsoContour and set the
base contour = d (with a very large contour interval so you
only get one contour curve). That is, the IsoContour will
be a set of iso-lines on the surface (not an iso-surface),
but you only want one iso-line.

Good luck,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


On Sat, 25 May 2002, johnyao wrote:

> Hello,
>
> I have created 3D shapes with the gridded3DSet with manifold dimension=2.
> Therefore, the 3D objects are not solids, but are more like closed surfaces.
> I understand that VisAD can do volume rendering with cross-sections with
> resampling based on several earlier messages including one with sample code by
> Bill.  But I am wondering what's the best way to get a cross-section of my
> shape if they are not true solids with volume.  As a simple example, if a
> cross-section of my sphere is taken, the 2D plane should only show the rim
> (the circumference) of the circle.
>
> I have also tried the following code from one of earlier message to resample:
>
> if (w == null) w = new RealType("testing", null, null);
> float[][] plane2D = new float[3][num*num];
>     int k = 0;
>     for (int i=0; i<num; i++){
>         for (int j=0; j<num; j++){
>             plane2D[0][k] = xmin+(xmax-xmin)*j/(num-1.0f);
>             plane2D[1][k] = ymin+(ymax-ymin)*j/(num-1.0f);
>             plane2D[2][k++] = (float)zplane;
>         }
>     }
> // construct a Gridded3Dset with manifold dimension = 2
> // whose N * N samples lie on a plane at z = zplane
>     Gridded3DSet plane_set = new Gridded3DSet(xyz, plane2D, num, num);
>     FlatField fplane = (FlatField)field.resample(plane_set,
> Data.WEIGHTED_AVERAGE, Data.NO_ERRORS);
>
> However, I got this error message when I ran my program:
>
> VisADProbeMaker:visad.SetException: Gridded3DSet.valueToGrid:
> ManifoldDimension must be 3
>
> I am not sure how this works because the Set in field is a Gridded3DSet with
> manifold dimension of 2.
>
> How should this be done in VisAD?
>
> Thanks very much,
> john
>
>


  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: