37#define SCULPT_GEODESIC_VERTEX_NONE -1
54 if (dists[v0] <= dists[v1]) {
61 if (dists[v0] <= dists[
v2]) {
65 vert_positions[v0], vert_positions[v1], vert_positions[
v2], dists[v1], dists[
v2]);
69 sub_v3_v3v3(vec, vert_positions[v1], vert_positions[v0]);
70 dist0 = dists[v1] +
len_v3(vec);
73 if (dist0 < dists[v0]) {
89 const float limit_radius)
91 const float limit_radius_sq = limit_radius * limit_radius;
119 affected_vert.
fill(
true);
125 for (
const int v : initial_verts) {
126 const float *v_co = vert_positions[
v];
129 affected_vert[i].set();
136 for (
const int i : edges.index_range()) {
137 const int v1 = edges[i][0];
138 const int v2 = edges[i][1];
139 if (!affected_vert[v1] && !affected_vert[
v2]) {
150 int v1 = edges[
e][0];
151 int v2 = edges[
e][1];
154 if (dists[v1] > dists[
v2]) {
161 for (
const int face : edge_to_face_map[
e]) {
162 if (!hide_poly.
is_empty() && hide_poly[face]) {
165 for (
const int v_other : corner_verts.
slice(faces[face])) {
166 if (
ELEM(v_other, v1,
v2)) {
170 vert_positions, v_other, v1,
v2, dists, initial_verts))
172 for (
const int e_other : vert_to_edge_map[v_other]) {
174 if (edges[e_other][0] == v_other) {
175 ev_other = edges[e_other][1];
178 ev_other = edges[e_other][0];
181 if (e_other !=
e && !edge_tag[e_other] &&
182 (edge_to_face_map[e_other].is_empty() || dists[ev_other] !=
FLT_MAX))
184 if (affected_vert[v_other] || affected_vert[ev_other]) {
185 edge_tag[e_other].set();
195 for (
LinkNode *lnk = queue_next; lnk; lnk = lnk->
next) {
General operations, lookup, etc. for blender objects.
A BVH for high poly meshes.
BLI_LINKSTACK_*** wrapper macros for using a LinkNode to store a stack of pointers,...
#define BLI_LINKSTACK_PUSH(var, ptr)
#define BLI_LINKSTACK_DECLARE(var, type)
#define BLI_LINKSTACK_SIZE(var)
#define BLI_LINKSTACK_FREE(var)
#define BLI_LINKSTACK_INIT(var)
#define BLI_LINKSTACK_POP(var)
#define BLI_LINKSTACK_SWAP(var_a, var_b)
float geodesic_distance_propagate_across_triangle(const float v0[3], const float v1[3], const float v2[3], float dist1, float dist2)
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float len_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
bool contains(const Key &key) const
constexpr Span slice(int64_t start, int64_t size) const
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
void fill(const bool value)
Array< float > distances_create(const Span< float3 > vert_positions, const Span< int2 > edges, const OffsetIndices< int > faces, const Span< int > corner_verts, const GroupedSpan< int > vert_to_edge_map, const GroupedSpan< int > edge_to_face_map, const Span< bool > hide_poly, const Set< int > &initial_verts, const float limit_radius)
static bool sculpt_geodesic_mesh_test_dist_add(Span< float3 > vert_positions, const int v0, const int v1, const int v2, MutableSpan< float > dists, const Set< int > &initial_verts)
#define SCULPT_GEODESIC_VERTEX_NONE