Define some point data
Define some point data
In[]:=
pts=;ListPointPlot3D[pts,ImageSizeMedium]
Out[]=
Get a concave hull mesh
Get a concave hull mesh
In[]:=
Show[concaveHullMesh=ConcaveHullMesh[Most/@pts,115],pointPlot=ListPlot[Most/@pts,PlotStyle->Blue]]
Out[]=
Corresponding concave hull boundary mesh
Corresponding concave hull boundary mesh
In[]:=
Show[boundaryMesh=BoundaryMesh[concaveHullMesh,MeshCellStyle->{{1}->{Thickness@Large,Red},{2}->None}],pointPlot]
Out[]=
Display contour plot
Display contour plot
Note : the value of the optional argument MaxPlotPoints is key to constraining contours to lie inside the defined boundary.
In[]:=
rmfun=RegionMember[boundaryMesh]
Out[]=
RegionMemberFunction
In[]:=
Manipulate[ListContourPlot[pts,InterpolationOrder->interpolationOrder,MaxPlotPoints->maxPlotPoints,Mesh->mesh,RegionFunction->Function[{x,y,z},rmfun[{x,y}]],Epilog->boundaryMesh],{{maxPlotPoints,All},Join[{All},Range[2,100,1]],ControlType->Slider,Appearance->"Labeled"},{{mesh,All},{All,None}},{{interpolationOrder,1},{0,1,2,3}}]
Out[]=
What about contouring face-by-face?
What about contouring face-by-face?
Function for scaling BoxRatios
Function for scaling BoxRatios
In[]:=
showScaled[g3d_Graphics3D,scaling_List:{1,1,1}]:=Module[{br},br=AbsoluteOptions[g3d,BoxRatios]//First//Values;Show[g3d,BoxRatios->br*scaling]]showScaled[mr_MeshRegion,scaling_List:{1,1,1}]:=showScaled[Show@mr,scaling]/;RegionEmbeddingDimension[mr]3showScaled[scaling_List:{1,1,1}][x_]:=showScaled[x,scaling]
3D mesh region
3D mesh region
In[]:=
mr3d=MeshRegion[pts,MeshCells[concaveHullMesh,2]];mr3d//showScaled[{1,1,10}]
Out[]=
Get list of all polygons that define the mesh
Get list of all polygons that define the mesh
In[]:=
polys=MeshPrimitives[mr3d,2];polys//Short
Range of z coordinate values
Range of z coordinate values
Desired contour interval
Desired contour interval
Contour range
Contour range
Contour values
Contour values
ListContourPlot for each mesh cell
ListContourPlot for each mesh cell
Show first to All contoured mesh cells
Show first to All contoured mesh cells
Show individual mesh cells
Show individual mesh cells
