I need to find a normal pointing outside for every face / cell of a closed Mesh Region.
How can I do this?
Here's what I have now - mesh + mesh cells centers and I'm stuck and puzzled.
There's VertexNormals
, but there's no "CellNormals" or whatever else.
(* import OBJ *)
input = Import["torus.obj"];
(* Faces & Points *)
coords = MeshCoordinates[input]; (* вершины *)
cells = MeshCells[input, 2]; (* грани *)
(* Boundary Mesh Region *)
torus = BoundaryMeshRegion[coords, cells,
MeshCellStyle -> Opacity[0.3]];
(* Cell Centers *)
meshprimitives = MeshPrimitives[torus, 2];
cellcenters =
Table[RegionCentroid[meshprimitives[[i]]], {i,
meshprimitives // Length}];
ссPoints = ListPointPlot3D[cellcenters, PlotStyle -> Red];
(* Graph *)
Show[torus, ссPoints]
Here's what I need:
NB! The normals need to be pointed outside.
Please help!
Sphere[]
??? $\endgroup$Region`Mesh`MeshCellNormals
. See mathematica.stackexchange.com/questions/130226/… etc. from searching the site for MeshCellNormals. $\endgroup$