Blender V5.3
BKE_volume_to_mesh.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
12#include "BLI_span.hh"
13
14#include "DNA_modifier_types.h"
15
16#ifdef WITH_OPENVDB
17# include <openvdb/openvdb.h>
18#endif
19
20namespace blender {
21
22struct Mesh;
23
24namespace bke {
25
33
34#ifdef WITH_OPENVDB
35
39struct OpenVDBMeshData {
40 std::vector<openvdb::Vec3s> verts;
41 std::vector<openvdb::Vec3I> tris;
42 std::vector<openvdb::Vec4I> quads;
43 bool is_empty() const
44 {
45 return verts.empty();
46 }
47};
48
49Mesh *volume_to_mesh(const openvdb::GridBase &grid,
50 const VolumeToMeshResolution &resolution,
51 float threshold,
52 float adaptivity);
53
54Mesh *volume_grid_to_mesh(const openvdb::GridBase &grid, float threshold, float adaptivity);
55
56struct VolumeToMeshDataResult {
57 OpenVDBMeshData data;
58 std::string error;
59};
60
65VolumeToMeshDataResult volume_to_mesh_data(const openvdb::GridBase &grid,
66 const VolumeToMeshResolution &resolution,
67 float threshold,
68 float adaptivity);
69
75void fill_mesh_from_openvdb_data(Span<openvdb::Vec3s> vdb_verts,
76 Span<openvdb::Vec3I> vdb_tris,
77 Span<openvdb::Vec4I> vdb_quads,
78 int vert_offset,
79 int face_offset,
80 int loop_offset,
81 MutableSpan<float3> vert_positions,
82 MutableSpan<int> face_offsets,
83 MutableSpan<int> corner_verts);
84
85#endif
86
87} // namespace bke
88} // namespace blender
BMesh Iterators.
BMesh const char void * data
union blender::bke::VolumeToMeshResolution::@031223152017106026267031022005313173146132011170 settings