This repository has been archived on 2024-12-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2024CG-project-render/include/per_corner_normals.h
github-classroom[bot] 5985bb8445
Initial commit
2024-10-24 10:26:51 +00:00

21 lines
699 B
C

#ifndef PER_CORNER_NORMALS_H
#define PER_CORNER_NORMALS_H
#include <Eigen/Core>
// Compute per corner normals for a triangle mesh by computing the area-weighted
// average of normals at incident faces whose normals deviate less than the
// provided threshold.
//
// Inputs:
// V #V by 3 list of vertex positions
// F #F by 3 list of mesh triangle indices into V
// corner_threshold threshold in degrees on sharp angles
// Outputs:
// N #F*3 by 3 list of mesh vertex 3D normals, where the normal
// for corner F(i,j) is at N.row(i*3+j)
void per_corner_normals(
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const double corner_threshold,
Eigen::MatrixXd & N);
#endif