Blender  V3.3
BKE_subdiv_mesh.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2018 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "BLI_sys_types.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 struct Mesh;
17 struct MEdge;
18 struct Subdiv;
19 
20 typedef struct SubdivToMeshSettings {
21  /* Resolution at which regular ptex (created for quad polygon) are being
22  * evaluated. This defines how many vertices final mesh will have: every
23  * regular ptex has resolution^2 vertices. Special (irregular, or ptex
24  * created for a corner of non-quad polygon) will have resolution of
25  * `resolution - 1`.
26  */
28  /* When true, only edges emitted from coarse ones will be displayed. */
31 
32 /* Create real hi-res mesh from subdivision, all geometry is "real". */
33 struct Mesh *BKE_subdiv_to_mesh(struct Subdiv *subdiv,
34  const SubdivToMeshSettings *settings,
35  const struct Mesh *coarse_mesh);
36 
37 /* Interpolate a position along the `coarse_edge` at the relative `u` coordinate. If `is_simple` is
38  * false, this will perform a B-Spline interpolation using the edge neighbors, otherwise a linear
39  * interpolation will be done base on the edge vertices. */
40 void BKE_subdiv_mesh_interpolate_position_on_edge(const struct Mesh *coarse_mesh,
41  const struct MEdge *coarse_edge,
42  bool is_simple,
43  float u,
44  float pos_r[3]);
45 #ifdef __cplusplus
46 }
47 #endif
struct Mesh * BKE_subdiv_to_mesh(struct Subdiv *subdiv, const SubdivToMeshSettings *settings, const struct Mesh *coarse_mesh)
void BKE_subdiv_mesh_interpolate_position_on_edge(const struct Mesh *coarse_mesh, const struct MEdge *coarse_edge, bool is_simple, float u, float pos_r[3])
struct SubdivToMeshSettings SubdivToMeshSettings