23 N_(
"Merge all close selected points, whether or not they are connected")},
28 N_(
"Only merge mesh vertices along existing edges. This method can be much faster")},
29 {0,
nullptr, 0,
nullptr,
nullptr},
34 b.use_custom_socket_order();
35 b.allow_any_socket_order();
38 .description(
"Point cloud or mesh to merge points of");
39 b.add_output<
decl::Geometry>(
"Geometry"_ustr).propagate_all_geometry().align_with_previous();
43 .evaluated_geometry_field();
51 node->storage = MEM_new<NodeGeometryMergeByDistance>(__func__);
55 const float merge_distance,
61 evaluator.
add(selection_field);
70 src_points, merge_distance, selection, attribute_filter);
75 const float merge_distance,
86 mesh, selection, merge_distance,
false, attribute_filter);
90 const float merge_distance,
96 evaluator.
add(selection_field);
112 const float merge_distance = params.
extract_input<
float>(
"Distance"_ustr);
119 *pointcloud, merge_distance, selection, attribute_filter);
126 std::optional<Mesh *>
result;
133 *
mesh, merge_distance, selection, attribute_filter);
144 params.
set_output(
"Geometry"_ustr, std::move(geometry_set));
152 ntype.
ui_name =
"Merge by Distance";
153 ntype.
ui_description =
"Merge vertices or points within a given distance";
158 "NodeGeometryMergeByDistance",
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_MERGE_BY_DISTANCE
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define BLI_assert_unreachable()
MutableSpan< T > as_mutable_span()
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_as_mask(int field_index)
int add_with_destination(GField field, GVMutableArray dst)
NodeAttributeFilter get_attribute_filter(const UString output_identifier) const
T extract_input(const UString identifier)
T get_input(const UString identifier) const
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
PointCloud * point_merge_by_distance(const PointCloud &src_points, const float merge_distance, const IndexMask &selection, const bke::AttributeFilter &attribute_filter)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
std::optional< Mesh * > mesh_merge_by_distance_connected(const Mesh &mesh, Span< bool > selection, float merge_distance, bool only_loose_edges, const bke::AttributeFilter &attribute_filter=bke::AttributeFilter::default_filter())
std::optional< Mesh * > mesh_merge_by_distance_all(const Mesh &mesh, const IndexMask &selection, float merge_distance, const bke::AttributeFilter &attribute_filter=bke::AttributeFilter::default_filter())
static void node_declare(NodeDeclarationBuilder &b)
static std::optional< Mesh * > mesh_merge_by_distance_all(const Mesh &mesh, const float merge_distance, const Field< bool > &selection_field, const AttributeFilter &attribute_filter)
static PointCloud * pointcloud_merge_by_distance(const PointCloud &src_points, const float merge_distance, const Field< bool > &selection_field, const AttributeFilter &attribute_filter)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void node_init(bNodeTree *, bNode *node)
static std::optional< Mesh * > mesh_merge_by_distance_connected(const Mesh &mesh, const float merge_distance, const Field< bool > &selection_field, const AttributeFilter &attribute_filter)
static EnumPropertyItem mode_items[]
GeometryNodeMergeByDistanceMode
@ GEO_NODE_MERGE_BY_DISTANCE_MODE_ALL
@ GEO_NODE_MERGE_BY_DISTANCE_MODE_CONNECTED
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_free_standard_storage(bNode *node)
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const PointCloud * get_pointcloud() const
const Mesh * get_mesh() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare