Skip to main content
  1. Hair Tools/
  2. Hair Tools Documentation/

Hair Tools - Extract Clumps

Table of Contents

force_table_of_contents
#

Selects or generates guide curves from a dense groom by first clustering curves that follow similar trajectories, then either picking the most representative curve per clump or generating a synthetic centroid guide. Clustering is based on trajectory proximity rather than just root distance, so curves that travel together are grouped even if their roots are spread apart.

An alternative entry point allows externally provided clump IDs to be used instead of the automatic clustering.

By default, the input groom is shown as a guide, with color coding shown to identify the clumps.

See also: hair_select to select a subset of representative guides with an even mesh distribution.

Clustering
#

Curves are clustered using trajectory proximity. For each curve, the K nearest root neighbors are found, then trajectory samples at regular arc fractions are compared. If the mean nearest-sample distance between two curves is small relative to their length, they are merged into the same clump via union-find.

The sample start parameter skips the root region of the curve, avoiding false groupings of curves that share a common base but diverge further along. Clumps smaller than the minimum size are dissolved and their curves reassigned to the nearest larger clump.

External Clump IDs
#

When clump assignments are provided externally as a clump ID attribute on prims, automatic clustering can be bypassed. The system reads the existing IDs and computes the clump count for downstream processing.

Guide Selection
#

Selects the most representative existing curve per clump. A centroid trajectory is computed at regular arc slices, then each curve is scored by its distance to the centroid. The score is weighted by straightness and length penalties — higher bias values more strongly prefer straighter and longer curves.

Curves shorter than the minimum length ratio (relative to the longest curve in the clump) are excluded from selection. Curves that end before a given arc slice use the tip-to-centroid distance for the remaining slices, naturally penalizing short curves.

The selected curve is tagged with the guide prim group, and all curves in the clump receive the guide’s primitive number as their guideid.

Guide Generation
#

As an alternative to guide selection, synthetic guide curves can be generated through each clump’s centroid. The clump is sliced with planes perpendicular to its overall direction, and all curve points whose projection falls in a given bin contribute to the centroid position at that slice.

Point attributes (width, pscale, Cd, etc.) are averaged per bin. Prim attributes are averaged across clump members. Laplacian smoothing is applied to the generated guide to remove noise.

Clump Width
#

After guide selection or generation, the clump width is measured at each guide point. A perpendicular slab is defined using the local guide tangent, all clump curve points within the slab are collected, and the average distance to the guide point is computed.

The slab fraction controls the thickness of the measurement region as a fraction of the guide’s arc length. Smaller values give more local measurements; larger values average over more of the clump.

The resulting per-point clump width can be used downstream for clump shaping, width-based effects, or visualization.

Clump Radius
#

It can sometimes be useful to determine the width of a clump, so this optional output will try to determine the width of the clump for use with simulation or collisions.