MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/MRMeshNormals.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRId.h"
4#include "MRMeshFwd.h"
5#include "MRVector.h"
6#include "MRVector3.h"
7#include <array>
8
9namespace MR
10{
11
15
16struct [[nodiscard]] MeshNormals
17{
18 FaceNormals faceNormals;
19 VertNormals vertNormals;
20};
21
23[[nodiscard]] MRMESH_API FaceNormals computePerFaceNormals( const Mesh & mesh );
24
26MRMESH_API void computePerFaceNormals4( const Mesh & mesh, Vector4f* faceNormals, size_t size );
27
29[[nodiscard]] MRMESH_API VertNormals computePerVertNormals( const Mesh & mesh );
30
33[[nodiscard]] MRMESH_API VertNormals computePerVertPseudoNormals( const Mesh & mesh );
34
36[[nodiscard]] MRMESH_API MeshNormals computeMeshNormals( const Mesh & mesh );
37
39using TriangleCornerNormals = std::array<Vector3f, 3>;
42[[nodiscard]] MRMESH_API Vector<TriangleCornerNormals, FaceId> computePerCornerNormals( const Mesh & mesh, const UndirectedEdgeBitSet* creases );
43
45
46} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
std::array< Vector3f, 3 > TriangleCornerNormals
normals in three corner of a triangle
Definition MRMesh/MRMeshNormals.h:39
MRMESH_API VertNormals computePerVertNormals(const Mesh &mesh)
returns a vector with vertex normals in every element for valid mesh vertices
MRMESH_API VertNormals computePerVertPseudoNormals(const Mesh &mesh)
MRMESH_API void computePerFaceNormals4(const Mesh &mesh, Vector4f *faceNormals, size_t size)
fills buffer with face-normals as Vector4f for valid mesh faces
MRMESH_API MeshNormals computeMeshNormals(const Mesh &mesh)
computes both per-face and per-vertex normals more efficiently then just calling both previous functi...
MRMESH_API Vector< TriangleCornerNormals, FaceId > computePerCornerNormals(const Mesh &mesh, const UndirectedEdgeBitSet *creases)
MRMESH_API FaceNormals computePerFaceNormals(const Mesh &mesh)
returns a vector with face-normal in every element for valid mesh faces
Definition MRCameraOrientationPlugin.h:8
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:32
Definition MRMesh/MRMeshNormals.h:17
FaceNormals faceNormals
Definition MRMesh/MRMeshNormals.h:18
VertNormals vertNormals
Definition MRMesh/MRMeshNormals.h:19
Definition MRMesh/MRMesh.h:23