need to fill area under a path in Gizmo plot

Hi,

I have a path which located inside x=6 plane (i.e, this path is a 2D curve) in a Gizmo plot (of course, with some other 3D surfaces, etc.). Question is, how to fill the area between this path and a straight line (x=6,z=0) with color?

Thanks

XS
Hello XS,

Depending on the shape of the path you might solve the problem differently. Without access to the full details...

Method 1: you can create a parametric surface that is bound by the path and the line and then give it the fill color. For example, suppose your path (pathWave) has 100 points. You can then create a 3D wave paramWave that has dimensions (100,4,3) with:
paramWave[][][0]=6    // setting the x value
paramWave[][][1]=pathWave[p][1]       // the y value of the path points
paramWave[][0][2]=pathWave[p][2]      // the z-value of the path
paramWave[][1][2]=pathWave[p][2]/2   // intermediate z-value between the path and z=0
paramWave[][2][2]=pathWave[p][2]/4   // intermediate z-value
paramWave[][3][2]=0                     // the z=0 line


Here I filled the intermediate z-values using the assumption that your path was in positive z territory.

If you now add paramWave as a parametric surface with constant color you should get the equivalent of a "fill".

Method 2: use a Ribbon object. If pathWave has N rows create a tripletWave that has 2N rows.
tripletWave=pathWave[trunc(p/2)][q]    // copy the values to alternating rows.
tripletWave[][0]=mod(p,2)==0? 6 : tripletWave[p][0]  // set the x of the even rows
tripletWave[][2]=mod(p,2)==0? 0 : tripletWave[p][1]  // set the z of the even rows

Now add tripletWave as a ribbon object using a fixed color. This method should be more efficient if your path has many vertices.



I hope this helps,

A.G.
WaveMetrics, Inc.
Thanks for your quick response. I used method 2 and problem solved. Thanks again.

A minor correction, in the method 2, the last command should be

tripletWave[][2]=mod(p,2)==0? 0 : tripletWave[p][2] // set the z of the even rows

XS

Igor wrote:


Method 2: use a Ribbon object. If pathWave has N rows create a tripletWave that has 2N rows.
tripletWave=pathWave[trunc(p/2)][q]    // copy the values to alternating rows.
tripletWave[][0]=mod(p,2)==0? 6 : tripletWave[p][0]  // set the x of the even rows
tripletWave[][2]=mod(p,2)==0? 0 : tripletWave[p][1]  // set the z of the even rows

Now add tripletWave as a ribbon object using a fixed color. This method should be more efficient if your path has many vertices.



I hope this helps,

A.G.
WaveMetrics, Inc.