Blender  V2.93
BKE_mesh_fair.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Mesh Fairing algorithm designed by Brett Fedack, used in the addon "Mesh Fairing":
17  * https://github.com/fedackb/mesh-fairing.
18  */
19 
20 #pragma once
21 
26 #include "BLI_utildefines.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /* Mesh Fairing. */
33 /* Creates a smooth as possible geometry patch in a defined area. Different values of depth allow
34  * to minimize changes in the vertex positions or tangency in the affected area. */
35 
36 typedef enum eMeshFairingDepth {
40 
41 /* affect_vertices is used to define the fairing area. Indexed by vertex index, set to true when
42  * the vertex should be modified by fairing. */
44  bool *affect_vertices,
45  const eMeshFairingDepth depth);
46 
47 /* This function can optionally use the MVert coordinates of deform_mverts to read and write the
48  * fairing result. When NULL, the function will use mesh->mverts directly. */
50  struct MVert *deform_mverts,
51  bool *affect_vertices,
52  const eMeshFairingDepth depth);
53 
54 #ifdef __cplusplus
55 }
56 #endif
void BKE_mesh_prefair_and_fair_vertices(struct Mesh *mesh, struct MVert *deform_mverts, bool *affect_vertices, const eMeshFairingDepth depth)
Definition: mesh_fair.cc:486
eMeshFairingDepth
Definition: BKE_mesh_fair.h:36
@ MESH_FAIRING_DEPTH_POSITION
Definition: BKE_mesh_fair.h:37
@ MESH_FAIRING_DEPTH_TANGENCY
Definition: BKE_mesh_fair.h:38
void BKE_bmesh_prefair_and_fair_vertices(struct BMesh *bm, bool *affect_vertices, const eMeshFairingDepth depth)
Definition: mesh_fair.cc:496
ATTR_WARN_UNUSED_RESULT BMesh * bm