#include <normalshelper.h>
Normal generation utilities for shading of meshes.
Static Public Member Functions | |
static MAXON_METHOD Result< void > | CalculatePolygonNormals (const Block< const Vector > &points, const Block< const SimplePolygon > &polygons, Bool normalized, Block< Vector32 > &polygonNormals) |
static MAXON_METHOD Result< void > | CalculatePolygonNormals (const Block< const Vector > &points, const Block< const SimplePolygon > &polygons, Bool normalized, Block< Vector > &polygonNormals) |
static MAXON_METHOD Result< void > | CalculatePolygonNormals (const Block< const Vector32 > &points, const Block< const SimplePolygon > &polygons, Bool normalized, Block< Vector32 > &polygonNormals) |
static MAXON_METHOD Result< void > | CalculatePointNormalsAveraged (NORMALS_STYLE style, const Block< const Vector > &points, const Block< const SimplePolygon > &polygons, const Block< const Vector32 > &polygonNormals, Block< Vector32 > &pointNormals) |
static MAXON_METHOD Result< void > | CalculateShadingNormalsAveraged (NORMALS_STYLE style, const Block< const Vector > &points, const Block< const SimplePolygon > &polygons, const Block< const Vector32 > &polygonNormals, Block< Vector32 > &shadingNormals) |
static MAXON_METHOD Result< void > | CalculateShadingNormals (NORMALS_STYLE style, const Block< const Vector > &points, const Block< const SimplePolygon > &polygons, const Block< const Vector32 > &polygonNormals, Float32 angle, const Block< const UChar > &shadingBreaks, Block< Vector32 > &shadingNormals) |
Private Member Functions | |
MAXON_INTERFACE_NONVIRTUAL (NormalsHelperInterface, MAXON_REFERENCE_STATIC, "net.maxon.geom.normalshelper") | |
|
private |
|
static |
Computes the polygon normals for the given polygons and points. If normalized is set to True, the output polygon normals will be normalized to range [0-1]. Otherwise, the normals will be scaled with the polygon area. If using the UNIFORM or ANGLE_WEIGHTED normals style, one should normalize the normals.
[in] | points | Block containing the points of the mesh. |
[in] | polygons | Block containing the polygons of the mesh. For triangles, polygon.c == polygon.d |
[in] | normalized | Whether the output normals should be normalized to [0-1] range. |
[out] | polygonNormals | The generated polygon normals. This block should be resized before, such that the size of the block equals the number of polygons. |
|
static |
Computes the polygon normals for the given polygons and points. If normalized is set to True, the output polygon normals will be normalized to range [0-1]. Otherwise, the normals will be scaled with the polygon area. If using the UNIFORM or ANGLE_WEIGHTED normals style, one should normalize the normals.
[in] | points | Block containing the points of the mesh. |
[in] | polygons | Block containing the polygons of the mesh. For triangles, polygon.c == polygon.d |
[in] | normalized | Whether the output normals should be normalized to [0-1] range. |
[out] | polygonNormals | The generated polygon normals. This block should be resized before, such that the size of the block equals the number of polygons. |
|
static |
Computes the polygon normals for the given polygons and points. If normalized is set to True, the output polygon normals will be normalized to range [0-1]. Otherwise, the normals will be scaled with the polygon area. If using the UNIFORM or ANGLE_WEIGHTED normals style, one should normalize the normals.
[in] | points | Block containing the points of the mesh. |
[in] | polygons | Block containing the polygons of the mesh. For triangles, polygon.c == polygon.d |
[in] | normalized | Whether the output normals should be normalized to [0-1] range. |
[out] | polygonNormals | The generated polygon normals. This block should be resized before, such that the size of the block equals the number of polygons. |
|
static |
Computes the point normals (average normal of all adjacent polygons) using the style specified. Polygons will share the same normal for each point. This version does not take into consideration the shading break angle, or the shading break edges. If style is set to UNIFORM or ANGLE_WEIGHTED, the given polygon normals should be normalized. Note that ANGLE_WEIGHTED style can have a significant performance impact.
[in] | style | The style of the normals to generate. |
[in] | points | Block containing the points of the mesh. |
[in] | polygons | Block containing the polygons of the mesh. For triangles, polygon.c == polygon.d |
[in] | polygonNormals | The input array of polygon normals, size of which will correspond to the number of polygons. Depending on the style, the normals may or may not need to be normalized. |
[out] | pointNormals | The generated point normals. The size of this block should correspond to the point count. |
|
static |
Computes the shading (per polygon vertex) normals Each polygon will have four resulting normals, one for each point in the polygon. Polygons will share the same normal for each point. This version does not take into consideration the shading break angle, or the shading break edges. If style is set to UNIFORM or ANGLE_WEIGHTED, the given polygon normals should be normalized. Note that ANGLE_WEIGHTED style can have a significant performance impact.
[in] | style | The style of the normals to generate. |
[in] | points | Block containing the points of the mesh. |
[in] | polygons | Block containing the polygons of the mesh. For triangles, polygon.c == polygon.d |
[in] | polygonNormals | The input array of polygon normals, size of which will correspond to the number of polygons. Depending on the style, the normals may or may not need to be normalized. |
[out] | shadingNormals | The generated shading normals. The size of this block should correspond to 4 * polygonCount. |
|
static |
Computes the shading (per polygon vertex) normals Each polygon will have four resulting normals, one for each point in the polygon. This version takes into consideration the shading break angle, as well as the shading break edges. If style is set to UNIFORM or ANGLE_WEIGHTED, the given polygon normals should be normalized. Note that ANGLE_WEIGHTED style can have a significant performance impact.
[in] | style | The style of the normals to generate. |
[in] | points | Block containing the points of the mesh. |
[in] | polygons | Block containing the polygons of the mesh. For triangles, polygon.c == polygon.d |
[in] | polygonNormals | The input array of polygon normals, size of which will correspond to the number of polygons. Depending on the style, the normals may or may not need to be normalized. |
[in] | angle | The angle threshold at which to break the shading. |
[in] | shadingBreaks | The Compacted array which denotes the shading break edges. for each polygon, the individual bits correspond to the individual edges of that polygon. An empty block can be given, to avoid checking the edges. |
[out] | shadingNormals | The generated shading normals. The size of this block should correspond to 4 * polygonCount. |