Blender  V3.3
BKE_volume_to_mesh.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
5 #include "BLI_span.hh"
6 
7 #include "DNA_modifier_types.h"
8 
9 #ifdef WITH_OPENVDB
10 # include <openvdb/openvdb.h>
11 #endif
12 
13 struct Mesh;
14 
15 namespace blender::bke {
16 
19  union {
20  float voxel_size;
21  float voxel_amount;
23 };
24 
25 #ifdef WITH_OPENVDB
26 
30 struct OpenVDBMeshData {
31  std::vector<openvdb::Vec3s> verts;
32  std::vector<openvdb::Vec3I> tris;
33  std::vector<openvdb::Vec4I> quads;
34  bool is_empty() const
35  {
36  return verts.empty();
37  }
38 };
39 
40 struct Mesh *volume_to_mesh(const openvdb::GridBase &grid,
41  const VolumeToMeshResolution &resolution,
42  float threshold,
43  float adaptivity);
44 
49 struct OpenVDBMeshData volume_to_mesh_data(const openvdb::GridBase &grid,
50  const VolumeToMeshResolution &resolution,
52  float adaptivity);
53 
59 void fill_mesh_from_openvdb_data(const Span<openvdb::Vec3s> vdb_verts,
60  const Span<openvdb::Vec3I> vdb_tris,
61  const Span<openvdb::Vec4I> vdb_quads,
62  int vert_offset,
63  int poly_offset,
64  int loop_offset,
65  MutableSpan<MVert> verts,
66  MutableSpan<MPoly> polys,
67  MutableSpan<MLoop> loops);
68 
69 #endif
70 
71 } // namespace blender::bke
typedef float(TangentPoint)[2]
VolumeToMeshResolutionMode
SyclQueue void void size_t num_bytes void
static float verts[][3]
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
union blender::bke::VolumeToMeshResolution::@78 settings