Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_laplaciandeform.c
| Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | typedef struct LaplacianSystem { | ||||
| int total_edges; | int total_edges; | ||||
| int total_tris; | int total_tris; | ||||
| int total_anchors; | int total_anchors; | ||||
| int repeat; | int repeat; | ||||
| char anchor_grp_name[64]; /* Vertex Group name */ | char anchor_grp_name[64]; /* Vertex Group name */ | ||||
| float (*co)[3]; /* Original vertex coordinates */ | float (*co)[3]; /* Original vertex coordinates */ | ||||
| float (*no)[3]; /* Original vertex normal */ | float (*no)[3]; /* Original vertex normal */ | ||||
| float (*delta)[3]; /* Differential Coordinates */ | float (*delta)[3]; /* Differential Coordinates */ | ||||
| unsigned int (*tris)[3]; /* Copy of MLoopTri (tesselation triangle) v1-v3 */ | unsigned int (*tris)[3]; /* Copy of MLoopTri (tessellation triangle) v1-v3 */ | ||||
| int *index_anchors; /* Static vertex index list */ | int *index_anchors; /* Static vertex index list */ | ||||
| int *unit_verts; /* Unit vectors of projected edges onto the plane orthogonal to n */ | int *unit_verts; /* Unit vectors of projected edges onto the plane orthogonal to n */ | ||||
| int *ringf_indices; /* Indices of faces per vertex */ | int *ringf_indices; /* Indices of faces per vertex */ | ||||
| int *ringv_indices; /* Indices of neighbors(vertex) per vertex */ | int *ringv_indices; /* Indices of neighbors(vertex) per vertex */ | ||||
| LinearSolver *context; /* System for solve general implicit rotations */ | LinearSolver *context; /* System for solve general implicit rotations */ | ||||
| MeshElemMap *ringf_map; /* Map of faces per vertex */ | MeshElemMap *ringf_map; /* Map of faces per vertex */ | ||||
| MeshElemMap *ringv_map; /* Map of vertex per vertex */ | MeshElemMap *ringv_map; /* Map of vertex per vertex */ | ||||
| } LaplacianSystem; | } LaplacianSystem; | ||||
| ▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | static void createVertRingMap( | ||||
| } | } | ||||
| *r_map = map; | *r_map = map; | ||||
| *r_indices = indices; | *r_indices = indices; | ||||
| } | } | ||||
| /** | /** | ||||
| * This method computes the Laplacian Matrix and Differential Coordinates for all vertex in the mesh. | * This method computes the Laplacian Matrix and Differential Coordinates for all vertex in the mesh. | ||||
| * The Linear system is LV = d | * The Linear system is LV = d | ||||
| * Where L is Laplacian Matrix, V as the vertexes in Mesh, d is the differential coordinates | * Where L is Laplacian Matrix, V as the vertices in Mesh, d is the differential coordinates | ||||
| * The Laplacian Matrix is computes as a | * The Laplacian Matrix is computes as a | ||||
| * Lij = sum(Wij) (if i == j) | * Lij = sum(Wij) (if i == j) | ||||
| * Lij = Wij (if i != j) | * Lij = Wij (if i != j) | ||||
| * Wij is weight between vertex Vi and vertex Vj, we use cotangent weight | * Wij is weight between vertex Vi and vertex Vj, we use cotangent weight | ||||
| * | * | ||||
| * The Differential Coordinate is computes as a | * The Differential Coordinate is computes as a | ||||
| * di = Vi * sum(Wij) - sum(Wij * Vj) | * di = Vi * sum(Wij) - sum(Wij * Vj) | ||||
| * Where : | * Where : | ||||
| * di is the Differential Coordinate i | * di is the Differential Coordinate i | ||||
| * sum (Wij) is the sum of all weights between vertex Vi and its vertexes neighbors (Vj) | * sum (Wij) is the sum of all weights between vertex Vi and its vertices neighbors (Vj) | ||||
| * sum (Wij * Vj) is the sum of the product between vertex neighbor Vj and weight Wij for all neighborhood. | * sum (Wij * Vj) is the sum of the product between vertex neighbor Vj and weight Wij for all neighborhood. | ||||
| * | * | ||||
| * This Laplacian Matrix is described in the paper: | * This Laplacian Matrix is described in the paper: | ||||
| * Desbrun M. et.al, Implicit fairing of irregular meshes using diffusion and curvature flow, SIGGRAPH '99, pag 317-324, | * Desbrun M. et.al, Implicit fairing of irregular meshes using diffusion and curvature flow, SIGGRAPH '99, pag 317-324, | ||||
| * New York, USA | * New York, USA | ||||
| * | * | ||||
| * The computation of Laplace Beltrami operator on Hybrid Triangle/Quad Meshes is described in the paper: | * The computation of Laplace Beltrami operator on Hybrid Triangle/Quad Meshes is described in the paper: | ||||
| * Pinzon A., Romero E., Shape Inflation With an Adapted Laplacian Operator For Hybrid Quad/Triangle Meshes, | * Pinzon A., Romero E., Shape Inflation With an Adapted Laplacian Operator For Hybrid Quad/Triangle Meshes, | ||||
| ▲ Show 20 Lines • Show All 557 Lines • Show Last 20 Lines | |||||