Message Boards Message Boards

1
|
7354 Views
|
10 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Plot the intersection line of multiple 'ListContourPlot3D' surfaces?

Posted 8 years ago

Hello,

I hope that you can help me with this.

RE and IM are nXnXn matrices (n>100). I am looking for the intersection line between the isosurfaces RE==0 and IM ==0. I am plotting them with

'ListContourPlot3D'

and I am looking for a function similar to

BoundaryStyle -> {{1,2} -> {{Green,Tube[0.5]}}}

BoundaryStyle is not defined for Lists. My attempts with 'RegionFunction' and 'Mesh' failed because I do not know where the intersection lines are. Interpolation is not accurate enough and it takes a long time to be computed.

I will appreciate any type of help or suggestion. Thank you.

Danica

POSTED BY: Danica Sugic
10 Replies

In case you have not figured it out yet, perhaps try something along the lines of:

http://www.wolfram.com/language/11/volume-visualization/use-regions-as-slices.html?product=mathematica

where the surface 'person' is a mesh version of the surface of IM==0, and then use ListSliceContourPlot3D with one contour specification to find RE==0....

POSTED BY: Sander Huisman
Posted 8 years ago

Thanks Sander for your reply. I am not really sure that I understood what you mean. I am still interested in finding a fast way of plotting these intersection lines, since my method crashes most of the time. Would you mind to write the analogous function 'person' for me, please?

Danica

POSTED BY: Danica Sugic

Another method is to use ListContourPlot3D to our use to create some polygons, and use these polygons to plot our ListSliceContourplot3D:

n=5;
pts=Table[x^2+y^2+z^2-1,{x,Subdivide[-2,2,n]},{y,Subdivide[-2,2,n]},{z,Subdivide[-2,2,n]}];
surf=Table[x^3+y^2-z^2,{x,Subdivide[-2,2,n]},{y,Subdivide[-2,2,n]},{z,Subdivide[-2,2,n]}];
lcp=ListContourPlot3D[surf,DataRange->{{-2,2},{-2,2},{-2,2}},Contours->{0},Mesh->None,BoundaryStyle->None];

gc=FirstCase[lcp,GraphicsComplex[__],{},\[Infinity]];
gc[[2]]=Cases[gc[[2]],Polygon[_],\[Infinity]];
gc=Drop[gc,-1];
pols=Normal[gc];

Graphics3D[pols]

ListSliceContourPlot3D[pts,pols,DataRange->{{-2,2},{-2,2},{-2,2}},Contours->{0},BoundaryStyle->None,ContourShading->None]
POSTED BY: Sander Huisman
Posted 8 years ago

Thank you. I will try this method and check whether it is faster than mine. The 3 things I found and work well are

  • reduce the resolution of my matrices (for example 41x41x41 works quite well) because the interpolating functions will smooth everything anyway;

  • plot less points in my graph (with a smaller range of x,y,z) and use the command 'PlotPoints' in the following way

ContourPlot3D[{ReI[x,y,z] == 0, ImI[x,y,z]== 0}, {x, 1, 41}, {y, 1, 41}, {z, 1,41}, ContourStyle -> Opacity[0.1], Mesh -> None,BoundaryStyle -> {{1,2} -> {{Green,Tube[0.5]}}}, AxesLabel->{x,y,z},PlotPoints -> 8]

  • decrease the precision (in this case I use the mesh function method)

ContourPlot3D[{ReI[x,y,z] == 0, ImI[x,y,z]== 0}, {x, 1, 41}, {y, 1, 41}, {z, 1,41}, MeshFunctions -> {Function[{x, y, z}, ReI[x,y,z] - ImI[x,y,z]]}, MeshStyle -> {{Thick, Blue}}, Mesh -> {{0}}, ContourStyle -> Opacity[0.1], AxesLabel->{x,y,z}, WorkingPrecision -> 2]

POSTED BY: Danica Sugic
Posted 8 years ago

Thank you Sander.

I tried to use

ContourPlot3D[{h == 0, g == 0}, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, 
 MeshFunctions -> {Function[{x, y, z, f}, h - g]}, 
 MeshStyle -> {{Thick, Blue}}, Mesh -> {{0}}, 
 ContourStyle -> 
  Directive[Orange, Opacity[0.5], Specularity[White, 30]]]

but in order to build a MeshFunction you have to interpolate the matrices. I have already solved the problem in the following way using Interpolation functions:

ReI=ListInterpolation[RE]

ImI=ListInterpolation[IM]

ContourPlot3D[{ReI[x,y,z] == 0, ImI[x,y,z]== 0},  {x, 25, 65}, {y, 30, 70}, {z, 30,70}, ContourStyle -> Opacity[0.1],   Mesh -> None,BoundaryStyle -> {{1,2} -> {{Green,Tube[0.5]}}}, AxesLabel->{x,y,z},PlotPoints -> 16]

However, as soon as I increase the number of points in 'PlotPoints' (the quality of the graph), the memory used is too much and Mathematica quits after few hours.

POSTED BY: Danica Sugic

Is there any way for you to post the data (save as a "*.m" file and upload to gist.github.com) so that we could give it a try?

POSTED BY: Jason Biggs
Posted 8 years ago

Sorry Jason I cannot publish my matrices as they are the result of my research. I could send them to you in private though.

POSTED BY: Danica Sugic

Perhaps try InterpolationOrder -> 1 in the ListInterpolation to speed things up...

I agree, there should be a faster way, but I can't come up with something...

POSTED BY: Sander Huisman

Now that I think of it, did you try something similar to:

http://reference.wolfram.com/language/example/HighlightTheIntersectionOfTwoSurfaces.html

?

POSTED BY: Sander Huisman

Perhaps try to use SliceContourPlot3D (version 10.2 and up), with the second argument being based on an interpolation function? I have not tried it, but might work.. Surface-surface intersection is not that easy to do 'out of the box' I think...

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract