2

enter image description here

I was working on some geometric manipulation and hoping to further process this graphic's isolines however I was stumped as how best to do that when I looked at the object's GraphicsComplex. I was expecting to see something similar to a question I asked last year about Mesh lines.

c = RevolutionPlot3D[{ x-0.2,-2 x},{x,0.7,1},
  Boxed->False,
  Axes->False,
  Mesh->{8,4}
]
c[[1,1,1,2]]

enter image description here

I'm using Mathematica 12.1 and tired the older function in the other thread too and it returns a similarly confusing GraphicComplex. 5 Dimensional polygons? Lines with one list for it's coordinates? I don't remember how I extracted the isolines.

Can someone describe to me how to extract the Mesh lines from a GraphicsComplex?

BBirdsell
  • 1,196
  • 8
  • 21

3 Answers3

6

If you just need lines, you can take Normal and extract lines from it:

lines = Cases[Normal[c], _Line, Infinity];

Graphics3D[lines]

mesh lines

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
halmir
  • 15,082
  • 37
  • 53
5

To add to halmir's answer: if you don't need the surface, just use PlotStyle -> None:

RevolutionPlot3D[{x - 0.2, -2 x}, {x, 0.7, 1}, Axes -> None, Boxed -> False,
                 Mesh -> {8, 4}, PlotStyle -> None]

which should give the same picture.

Note that this also includes the setting of BoundaryStyle; if you set it to None, you get this instead:

mesh without boundary

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
3

Another way:

plot /. GraphicsComplex[p_, g_, o___] :> 
  GraphicsComplex[p, Cases[g, _Line, Infinity]]

enter image description here

Michael E2
  • 235,386
  • 17
  • 334
  • 747