vasemesh5  by

Trick or treat meshing from Mathematica example data: This idea came out of trying to get ListSurfacePlot3d to work on example data models. Here I take a vertex array for a vase and perform a nonlinear deformation on it and get a cuboid model back out. The trick was not to deform the data too much...

( model data built into Mathematica) ExampleData["Geometry3D"] ( getting vertex data of a Mathematica data model) g = ExampleData[{"Geometry3D", "Vase"}, "VertexData"] g0 = ListSurfacePlot3D[g, MaxPlotPoints -> 50, Mesh -> 30, Axes -> None, MeshFunctions -> (#1 - #2 + #3 &), MeshShading -> {Purple, Yellow}, Boxed -> False] ( making a colored Cuboid version)

g1 = Table[{Hue[n/Length[g], .8], EdgeForm[], Cuboid[{g[[n]] - {0.0012, 0.0012, 0.0012}, g[[n]] + {0.0012, 0.0012, 0.0012}}]}, {n, 1, Length[g]}]; ga = Graphics3D[g1, Boxed -> False, PlotRange -> All] Show[{g0, ga}] Sum[g[[n]], {n, 1, Length[g]}]/Length[g] ( making a nonlinear deformation of the data) a = Table[{g[[n, 1]](1 + Sin[22Pin/6837]/6), g[[n, 2]](1 + Cos[22Pin/6837]/6), g[[n, 3]]}, {n, 1, Length[g]}] (Looking at the array data in 2d) ListPlot[ Table[{g[[n, 1]], g[[n, 2]]}, {n, 1, Length[g]}]] ListPlot[Table[{g[[n, 1]], g[[n, 3]]}, {n, 1, Length[g]}]] ListPlot[Table[{g[[n, 2]], g[[n, 3]]}, {n, 1, Length[g]}]] aa = ListSurfacePlot3D[a, MaxPlotPoints -> 50, Mesh -> False, Axes -> False, Boxed -> False] Length[g] g1 = Table[{Hue[n/Length[a], .8], EdgeForm[], Cuboid[{a[[n]] - {0.0022, 0.0022, 0.0022}, a[[n]] + {0.0022, 0.0022, 0.0022}}]}, {n, 1, Length[a]}]; ga = Graphics3D[g1, Boxed -> False, PlotRange -> All] g2 = Table[{Hue[n/Length[a], .8], EdgeForm[], Sphere[a[[n]], 0.005]}, {n, 1, Length[g]}]; ga1 = Graphics3D[g2, Boxed -> False, PlotRange -> All] g3 = ListSurfacePlot3D[a, MaxPlotPoints -> 50, Mesh -> 30, Axes -> None, MeshFunctions -> (#1 + #2 + #1#2 + #3 &), MeshShading -> {LightBlue, Purple}] gg = Show[{ga, g3}] (Export["vasemesh5.3ds",gg] Export["vasemesh5.obj",gg] Export["vasemesh5.stl",gg]*)