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();
37 .supported_type({GeometryComponent::Type::PointCloud, GeometryComponent::Type::Mesh})
38 .description(
"Point cloud or mesh to merge points of");
39 b.add_output<
decl::Geometry>(
"Geometry").propagate_all().align_with_previous();
52 const float merge_distance,
58 evaluator.
add(selection_field);
67 src_points, merge_distance, selection, attribute_filter);
71 const float merge_distance,
84 const float merge_distance,
89 evaluator.
add(selection_field);
105 const float merge_distance =
params.extract_input<
float>(
"Distance");
110 *pointcloud, merge_distance, selection,
params.get_attribute_filter(
"Geometry"));
116 std::optional<Mesh *>
result;
133 params.set_output(
"Geometry", std::move(geometry_set));
141 ntype.
ui_name =
"Merge by Distance";
142 ntype.
ui_description =
"Merge vertices or points within a given distance";
147 "NodeGeometryMergeByDistance",
#define NODE_STORAGE_FUNCS(StorageT)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_MERGE_BY_DISTANCE
#define BLI_assert_unreachable()
GeometryNodeMergeByDistanceMode
@ GEO_NODE_MERGE_BY_DISTANCE_MODE_ALL
@ GEO_NODE_MERGE_BY_DISTANCE_MODE_CONNECTED
#define NOD_REGISTER_NODE(REGISTER_FUNC)
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)
void * MEM_callocN(size_t len, const char *str)
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))
std::optional< Mesh * > mesh_merge_by_distance_connected(const Mesh &mesh, Span< bool > selection, float merge_distance, bool only_loose_edges)
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_all(const Mesh &mesh, const IndexMask &selection, float merge_distance)
static std::optional< Mesh * > mesh_merge_by_distance_connected(const Mesh &mesh, const float merge_distance, const Field< bool > &selection_field)
static void node_declare(NodeDeclarationBuilder &b)
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 EnumPropertyItem mode_items[]
static std::optional< Mesh * > mesh_merge_by_distance_all(const Mesh &mesh, const float merge_distance, const Field< bool > &selection_field)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
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
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare