Is it possible to get a cross-section along an axis for ConvexHullMesh? I've previously done it using RegionPlot for an equation, but am not sure how to do it for a list of values.
Previously I had an equation and used RegionPlot, but for this new analysis I have a set of data in a list in the format {x,y,z} that I'm visualising using ConvexHullMesh, and I'm trying to find a way to get a 2d cross-section along a specific point along the x, y or z axis. I was unable to adapt the RegionPlot solution since the previous solution relied on an equation instead of a list of points.
Previous code that could not be adapted for ConvexHullMesh:
plot2dz0[f_, range_, contour_, opt : OptionsPattern[], mod_] := RegionPlot[
Evaluate[Abs[f[mod*r, \[Theta], \[Phi]] /. sphericalToCartesian]^2 >
contour] /. z -> 0, {x, -range, range}, {y, -range, range}, PlotRange ->
{{-1, 1}, {-1, 1}}]
I have gotten something workable in part by adapting from here. Would this be the best solution?
testdata = Flatten[RandomReal[{0, 1}, {3, 3, 3}], 1];
testPlot1 = ConvexHullMesh[%];
plane = InfinitePlane[{{1, 0, 1}, {1, 0, 0}, {1, 1, 1}}];
Show[Graphics3D[plane], testPlot1]
crossSection = RegionIntersection[plane, #] & /@ MeshPrimitives[testPlot1, 2] // DeleteCases[_EmptyRegion] // ReplaceAll[Line :> Sequence] // Flatten[#, 1] & // (#[[Last@FindShortestTour[#]]] &) // Polygon;
Graphics3D[crossSection]




RegionPlot? What have you tried? – b3m2a1 Oct 01 '17 at 22:06ClipPlanesandShowand that might be easier. – b3m2a1 Oct 01 '17 at 22:48