20#define SCULPT_GEODESIC_VERTEX_NONE -1
37 if (dists[v0] <= dists[v1]) {
44 if (dists[v0] <= dists[
v2]) {
48 vert_positions[v0], vert_positions[v1], vert_positions[
v2], dists[v1], dists[
v2]);
52 sub_v3_v3v3(vec, vert_positions[v1], vert_positions[v0]);
53 dist0 = dists[v1] +
len_v3(vec);
56 if (dist0 < dists[v0]) {
72 const float limit_radius)
74 const float limit_radius_sq = limit_radius * limit_radius;
102 affected_vert.
fill(
true);
108 for (
const int v : initial_verts) {
109 const float *v_co = vert_positions[
v];
112 affected_vert[
i].set();
120 const int v1 = edges[
i][0];
121 const int v2 = edges[
i][1];
122 if (!affected_vert[v1] && !affected_vert[
v2]) {
133 int v1 = edges[
e][0];
134 int v2 = edges[
e][1];
137 if (dists[v1] > dists[
v2]) {
144 for (
const int face : edge_to_face_map[
e]) {
145 if (!hide_poly.
is_empty() && hide_poly[face]) {
148 for (
const int v_other : corner_verts.
slice(
faces[face])) {
149 if (
ELEM(v_other, v1,
v2)) {
153 vert_positions, v_other, v1,
v2, dists, initial_verts))
155 for (
const int e_other : vert_to_edge_map[v_other]) {
157 if (edges[e_other][0] == v_other) {
158 ev_other = edges[e_other][1];
161 ev_other = edges[e_other][0];
164 if (e_other !=
e && !edge_tag[e_other] &&
165 (edge_to_face_map[e_other].is_empty() || dists[ev_other] !=
FLT_MAX))
167 if (affected_vert[v_other] || affected_vert[ev_other]) {
168 edge_tag[e_other].set();
178 for (
LinkNode *lnk = queue_next; lnk; lnk = lnk->
next) {
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)
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