Link Search Menu Expand Document

Refine

PCGEx | Cluster : Refine

One-stop node for pruning edges

The Refine node algorithmically prunes edges in a graph to enforce specific properties, allowing selection of refinement type and optional sanitization to restore edges based on predefined conditions.


Vtx
Endpoints of the input Edges
Edges
Edges associated with the input Vtxs
Heuristics
Heuristic nodes, if required by the selected refinement.
Edge Filters
Point filter input used by some refinements
Sanitization Filters
Point filter input used to preserve edges as a sanitization step
Vtx
Endpoints of the output Edges
Edges
Edges associated with the output Vtxs
Kept Edges
Edges kept by the filter
Removed Edges
Edges removed by the filter

Table of content


The Cluster Refine node lets you refine connections inside individual clusters, a.k.a Edge pruning.

Refining only removes edges and does not create new ones.

details/edges-refine/edges-refine-lead.png

The filters determine which edge can be pruned. Any filter that doesn’t pass will ensure the edge is preserved.

Properties


Property Description
Settings
Refinement This property lets you select which kind of refinement you want to apply to the input clusters.
Specifics of the instanced module will be available under its inner Settings section, if any.
Output Edges Only If enabled, this node will output edges as raw points, without the usually associated cluster.
This can be significantly faster and less greedy depending on your need for the output edges.
Restore Edges that connects to Valid Nodes If enabled, any removed edge that connects valid nodes will be restored.
This happens after the initial refinement and before sanitization.

Sanitization

The sanitization property lets you enforce some general conditions within the graph. Note that is applied after the refinement.
Note that this is not mutually exclusive with filters: sanitization happens has a post-process after the “raw” refinement is completed.

Sanitization Description
None No sanitization.
Shortest If a node has no edge left, restore the shortest one.
Longest If a node has no edge left, restore the longest one.
Filters Use per-point filters to ensure edge preservation.

Note that the sanitization options offer no guarantee that the initial interconnectivity will be preserved! – It’s more of a “whatever happens, keep those edges” pass.


Available Refining modules


🝔 Minimum Spanning Tree

Modified Prim’s Minimum Spanning Tree algorithm that supports heuristics.

🝔 Refine by Filter

Keeps edges that pass the input filters, or vice-versa.

🝔 Line Trace

Removes edges by doing linetrace and checking for collisions.

🝔 Gabriel

Applies Gabrield Graph transformation

🝔 Remove Overlap

Removes overlapping edges

🝔 Keep Highest Score

Keeps edges with the highest heuristic scores

🝔 Keep Lowest Score

Keeps edges with the lowest heuristic scores

🝔 Remove Highest Score

Removes edges with the highest heuristic scores

🝔 Remove Lowest Score

Removes edges with the lowest heuristic scores

🝔 Keep Longest

Keeps the longest edge of each node

🝔 Keep Shortest

Keeps the shortest edge of each node

🝔 Remove Longest

Removes the longest edge of each node

🝔 Remove Shortest

Removes the shortest edge of each node


Cluster Output Settings

See Working with Clusters - Cluster Output Settings.


Filters


This node supports a wide variety of filters, but it’s important to keep in mind that only the edge points are processed by the filters.

Both regular point filter & edge filters are supported, node filter are not (because they operate on endpoints specifically, which this node doesn’t work on).

Regular & Sanitization filtering operate on input data, not the modified output. That means if you use filters that rely on intrinsinc properties such as neighbor count, it will be the neighbor count of the input, not the output!


Available Filters


🝖 AND / OR (Group)

Group multiple filters to set up complex AND/OR branches.

🝖 Compare Nearest (Numeric)

The Numeric Comparison Filter compares the arithmetic value of an attribute against the closest point from another dataset.

🝖 Compare (Numeric)

The Numeric Comparison Filter compares the arithmetic value of two attributes

🝖 Compare (String)

Compares two string-like attributes against each other.

🝖 Bool

Performs a simple boolean comparison, converting numeric values to true (> 0) or false (<= 0).

🝖 Within Range

Checks if an attribute value falls within a specified range.

🝖 Dot Product

Compares the dot product of two direction vectors against a third value.

🝖 Modulo Comparison

Compares the modulo of two attributes against a third operand, with configurable comparisons and tolerance.

🝖 Bounds

Checks if a point is inside or outside the provided bounds, with options for bounds types and an epsilon adjustment.

🝖 Bitmask

Checks specific flags in an int64 bitmask attribute with configurable mask types, comparisons, and an option to invert results.

🝖 Random

Random filter.

🝖 Mean Value

The Mean Value Filter compares per-point values of an attribute against the mean statistical value of that same attribute.

🝖 Self Compare (Numeric)

Compares the numeric value at one index against the same attribute at another index.

🝖 Self Compare (String)

Compares the string value at one index against the same attribute at another index.

🝖 Spline Inclusion

Checks against how a point is included in a spline.

🝖 Path Inclusion

Checks against how a point is included in a path.


Edge-specific filters


🝖 Edge Direction (Edge)

Check if the edge direction is within a given range.

🝖 Endpoints Compare (Numeric)

Compare the value of an attribute on each of the edge endpoint.

🝖 Endpoints Compare (String)

Compare the value of an attribute on each of the edge endpoint.

🝖 Neighbors Count (Edge)

Check a node’ neighbors count