# How can I specify the output mesh resolution for ListPlot3D?

I am using a grayscale image to generate a 3D topology, with the help of ListPlot3D. However, the output mesh resolution is far too high for my purposes. I need to find a way to reduce the output mesh resolution generated by ListPlot3D[].

I have searched extensively through the documentation and this site for a way to resolve this, but I haven't figured it out yet. Currently, this is my code:

currentImData = ImageData[image];
mesh = ListPlot3D[currentImData*50, PlotRange -> All,
Filling -> Bottom, FillingStyle -> Orange]


Is there a simple argument that I've been missing that allows me to specify the resolution of the output mesh?

Edit: Here are some images to better demonstrate. The first is the input image, and the second is the output given:

It can be seen that the poly count is very high for the output. I would like to have a much lower poly count so that, when exported, the 3D file (.stl) takes up less memory.

• Your added example doesn't evaluate in Mathemetica v12 – Ulrich Neumann Jul 14 at 20:53
• Thanks, I must've accidentally deleted a part of the code. I simplified it and verified the updated code is working in 12.1. – Jmeeks29ig Jul 14 at 23:20
• It's still not running on v12.0 – Ulrich Neumann Jul 15 at 7:05

Try to use the options MeshFunctions and Mesh

For example

image = Import["ExampleData/ocelot.jpg"]


currentImData = ImageData[ImageResize[image, 30]];
mesh = ListPlot3D[currentImData, InterpolationOrder -> 2,AspectRatio -> 1,
PlotRange -> {{0, Dimensions[currentImData][[1]]}, {0,Dimensions[currentImData][[2]]}, {0, 1 }}, Filling -> Bottom,FillingStyle -> Orange,
Mesh ->  {Range[0, 1, .1]} ,MeshFunctions -> {#3 &}]


Perhaps that's what you are looking for?

• Thanks, that looks good, however it still seems to have a pretty high poly count. I tried uploading an image to demonstrate what I meant but it wasn't working, so I'll try and update my question with some images. Basically, I just want to have a lower poly count for exporting to a 3D .stl file. – Jmeeks29ig Jul 14 at 20:03