1
$\begingroup$

I have 3D points above a 2D regular grid. At those points I know the normal vector of the surface. I am looking a command or function in Mathematica, like ListPlot3D or ListInterpolation to help to display the surface corresponding to the given points and normals at those points.

$\endgroup$
  • 2
    $\begingroup$ Try ListPlot3D with the VertexNormals option. $\endgroup$ – Rahul Jul 12 '15 at 0:59
1
$\begingroup$

In the meantime I found one way to do it. Let's say my 3d grid points are in an array grid3d[[k,i,j]], where i and j go from 1 to 8 and every element of grid3d is a triplet of {x,y,z} data, for example grid3d[[1,1,1]] is {16,16,2.3395}. My normal vectors are similarly in a norm[[k,i,j]] array and norm[[1,1,1] is {0.351765,0.113248,3.98289}, so they are not normalized. Because it is a regular grid, from grid3D[[k,i,j]] I need only the "k" component and from the norm array I need only the tangential vectors, that is the "i" and "j" components. So, I created an inData table:

inData=ParallelTable[Table[{grid3d[[k,i,j]][[3]],{norm[[k,i,j]][[1]],norm[[k,i,j]][[2]]}},{i,1,8},{j,1,8}],{k,1,Length[norm]}];

Then I created another table containing ListInterpolations:

listInt=ParallelTable[ListInterpolation[inData[[k,All,All]],{k,1,Length[inData]}];

Now I am able to see the surfaces with:

Plot3D[listInt[[k]][x,y],{x,1,8},{y,1,8}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.