Suppose I have a graphical output like this:
Is it possible to obtain the shading data (generated by lighting simulation) at each point on the surface with respect to the local co-ordinate chart of each surface?
The code for each surface part:
Spherical part:
ParametricPlot3D[{2 Sqrt[1 - u^2 Sin[v]^2 (1 + Cos[v]^2)], u Sin[2 v],
2 u Sin[v]}, {u, 0, 1}, {v, -\[Pi], \[Pi]}, PlotRange -> Full,
Mesh -> None]
Cylindrical part:
ParametricPlot3D[{1 + Cos[u],
Sin[u], (1 + Floor[-v/(Abs[-v] + 1)] -
Floor[v/(Abs[v] + 1)]) Max[-Sqrt[4 - 2 (1 + Cos[u])], v]/
2 + (1 + Floor[v/(Abs[v] + 1)] - Floor[-v/(Abs[-v] + 1)]) Min[
Sqrt[4 - 2 (1 + Cos[u])], v]/2}, {u, -2, 2}, {v, -4 \[Pi],
4 \[Pi]}, PlotRange -> Full, PlotPoints -> 100, Exclusions -> None,
Mesh -> None]
Note: I am primarily after the shading data of the spherical part, as the cylindrical part is extremely easy to guess (the shading is constant along the vertical)
pp = ParametricPlot3D[{2 Sqrt[1 - u^2 Sin[v]^2 (1 + Cos[v]^2)], u Sin[2 v], 2 u Sin[v]}, {u, 0, 1}, {v, -\[Pi], \[Pi]}, PlotRange -> Full, Mesh -> None]; verticesAndNormals = Cases[Normal[pp], Polygon[a_, VertexNormals -> b_] :> Transpose[{a, b}], {0, Infinity}]
give what you need? $\endgroup$ – kglr Oct 3 '19 at 17:21