tornavis/source/blender/blenkernel/BKE_mesh_remesh_voxel.hh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
865 B
C++
Raw Normal View History

/* SPDX-FileCopyrightText: 2019 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
2019-09-13 13:12:26 +02:00
#pragma once
/** \file
* \ingroup bke
*/
struct Mesh;
Mesh *BKE_mesh_remesh_voxel_fix_poles(const Mesh *mesh);
Mesh *BKE_mesh_remesh_voxel(const Mesh *mesh, float voxel_size, float adaptivity, float isovalue);
Mesh *BKE_mesh_remesh_quadriflow(const Mesh *mesh,
int target_faces,
int seed,
bool preserve_sharp,
bool preserve_boundary,
bool adaptive_scale,
void (*update_cb)(void *, float progress, int *cancel),
void *update_cb_data);
Mesh: Improve remesh attribute transfer Currently we have options to transfer the paint mask, face sets, and color attributes to the new mesh created by voxel remesh. This doesn't make use of the generic attribute design, where it would be clearer to transfer all attributes with the same methods. That's reflected in the code as well-- we do duplicate work for the mask and vertex colors, for example. This commit replaces the transfer options with a single checkbox for all attributes. All attribute types on all domains are transferred with basically the same method as the "Sample Nearest" node from geometry nodes-- they take the value from the nearest source element of the same domain. Face corners are handled differently than before. Instead of retrieving the mixed value of all the corners from the nearest source vertex, the value from the nearest corner of the nearest face. --- Some timing information, showing that when interpolating the same data, the attribute propagation is significantly faster than before. Edge and corner attributes would add some cost (edges more than corners), but might not always be present. Before ``` voxel_remesh_exec: 3834.63 ms BKE_shrinkwrap_remesh_target_project: 1141.17 ms BKE_mesh_remesh_reproject_paint_mask: 689.35 ms BKE_remesh_reproject_sculpt_face_sets: 257.14 ms BKE_remesh_reproject_vertex_paint: 54.64 ms BKE_mesh_smooth_flag_set: 0.15 ms ``` After ``` voxel_remesh_exec: 3339.32 ms BKE_shrinkwrap_remesh_target_project: 1158.76 ms mesh_remesh_reproject_attributes: 517.52 ms ``` Pull Request: https://projects.blender.org/blender/blender/pulls/115116
2023-11-22 15:21:58 +01:00
namespace blender::bke {
void mesh_remesh_reproject_attributes(const Mesh &src, Mesh &dst);
2023-11-26 23:30:52 +01:00
}