Articles

Houdini Group by Range: Selecting Geometry With Mathematical Precision

Includes one exclusive complete course

The exclusive course — a full production tutorial you won't find anywhere else, never sold alone.

Best Seller
Most Loved
Tutorial Camera Rig

ADVANCED CUSTOM CAMERA RIG

ANIMATION · CONSTRAINTS · CUSTOM UI

BUILD A FULLY CUSTOM CONSTRAINT-BASED CAMERA RIG IN HOUDINI WITH A CUSTOM UI PANEL. DESIGN FLEXIBLE SYSTEMS FOR PRECISE, CINEMATIC CAMERA ANIMATION ON ANY PROJECT.

€29.99

Freebies
Free Studio HDRI Pack box by Artivoxa showing 60 studio lighting setups with softboxes wrapped around the packaging

Studio HDRI Collection

ASSETS · EXR & HDR · 60 HDRIS

DOWNLOAD 60 STUDIO HDRIS CAPTURED IN A REAL PHOTO STUDIO. LIGHT YOUR PRODUCT AND BEAUTY RENDERS LIKE A PHOTOGRAPHER — SOFTBOX, LANTERN, STRIP AND GRID SETUPS, READY FOR ANY RENDERER.

FREE

ARTILABZ™

Everything You Need to master Houdini.

ARTILABZ™ gives you unlimited access to all Houdini courses, 3D assets, simulation files, textures and tools. updated every month.

01

Premium Houdini Tutorials

Full access to every course — fluid simulation, procedural FX, brand visuals and more.

02

Monthly New Content

Fresh tutorials and assets added every month — your library grows with you.

03

Instant Access to Everything

The moment you join, the full library is yours — no drip-feed, no waiting.

04

Project Files Included

Every tutorial comes with the full Houdini scene file — open every node, learn every detail.

FROM 14.99€/MONTH

Houdini Group by Range: Selecting Geometry With Mathematical Precision

Houdini Group by Range: Selecting Geometry With Mathematical Precision

Ever spent hours manually isolating edges, points, or faces in a complex mesh? Does the sheer volume of polygons make your workflow feel like a maze? The struggle to maintain clean geometry while keeping your frames per second up can stall any Houdini project.

When default selection tools fall short, it’s easy to lose track of what’s in or out of a set. Do you find yourself toggling viewports and cross-referencing components? This back-and-forth can introduce errors and waste precious time.

Enter the Houdini Group by Range method—a way to apply mathematical precision to your selections. Instead of guessing at indices or eyeballing values, you define clear numeric boundaries that yield predictable results every time.

In this guide, you’ll learn how to leverage group by range functionality to streamline your node graph and reduce manual corrections. By the end, selecting complex geometry with pinpoint accuracy will feel as logical as setting a slider.

What does “group by range” mean in Houdini and when should you use it?

The Group Range SOP in Houdini creates a named selection of points, primitives, edges, or vertices based on their numerical indices. Instead of manually clicking geometry or writing complex VEX, you specify a start index, end index, and optional stride to define a continuous or stepped interval. This procedural approach ensures repeatable, predictable selections even as the underlying mesh changes.

Key parameters in the Group Range node include:

  • Entity: Choose between points, primitives, edges, or vertices.
  • Base Group: Limit the range to an existing group hierarchy.
  • Range Start/End: Define the inclusive index bounds.
  • Step: Select every Nth element within the range.
  • Negate: Invert the selection to exclude the range.

You should reach for group by range when index-based grouping offers clarity and simplicity. Common scenarios include:

  • Splitting building facades into floor-based groups for staggered simulation.
  • Defining LOD batches by sequential primitive blocks.
  • Masking portions of a particle or instanced system for varied behavior.
  • Procedural UV island packing where islands are indexed sequentially.

By using Group Range, you avoid brittle manual selections and gain a procedural handle on geometry subsets. Whenever your setup relies on predictable, index-driven splits—whether for shading, simulation, or downstream SOP logic—this node offers both precision and flexibility.

Which Houdini nodes and workflows let you create groups by numeric or attribute ranges?

In Houdini you can target geometry by numeric or attribute thresholds using several dedicated SOPs and procedural patterns. The most common are:

  • Group Range SOP: (Houdini 19.5+) defines point or primitive ranges via minimum and maximum indices. For example, set Entity to “Points,” Min to 100, Max to 250 to isolate a contiguous set of points.
  • Group Expression SOP: uses VEX in the Condition field, e.g. @P.y > 1.0 && @P.y < 2.5, to build a dynamic group based on any attribute.
  • Attribute Wrangle SOP: write a VEX snippet like if(@Cd.r >= 0.2 && @Cd.r <= 0.8) setpointgroup(0, "midRed", @ptnum, 1);, giving full procedural control.
  • Partition SOP: partitions geometry into groups by evaluating an attribute expression. It’s ideal for automatically creating multiple range-based sets.
  • Delete SOP: use the Group or Expression mode to remove unwanted elements, effectively working as an inverse range selector.

As a mental model, think of group-by-range operations as sliding windows along an attribute axis. You can chain multiple Group Expression nodes or run loops in a wrangle to sweep a moving window, generating bands of geometry by height, color, or custom data. In production, combining these nodes with attribute transfer and copy workflows enables advanced region-based scattering or material assignments, all driven by clear numerical thresholds.

How do you mathematically define and implement range-based selections (step-by-step examples)?

Example 1 — Select points by X position: Group Expression vs Group SOP settings

To isolate points whose X coordinate falls between two values, you can use either a Group SOP with its range filter or a Group Expression. Both achieve the same result but differ in flexibility and performance.

Using Group SOP:

  • Drop a Group SOP after your geometry node.
  • In the Parameters pane, set Base Group to “points”.
  • Under Filter, choose “Keep by Range” and set X Minimum and X Maximum.
  • The node creates a boolean group for points satisfying min ≤ P.x ≤ max.

Using Group Expression:

  • Place a Group Expression node instead of Group SOP.
  • In the Expression field, type: @P.x >= chf(“minX”) && @P.x <= chf(“maxX”).
  • Expose parameters minX and maxX on the node for procedural control.
  • This method supports complex logic, e.g., mixing axes or animating boundaries.

Why choose one over the other? The Group SOP is straightforward and visually clear, while the Group Expression scales better in large networks and offers greater customization without adding extra nodes for math operations.

Example 2 — Efficient spherical range using squared distance in an Attribute Wrangle (VEX)

Selecting points inside a sphere often requires computing distance from a center, but avoiding the costly square root speeds up evaluation on millions of points. Instead, compare squared distance against squared radius.

In an Attribute Wrangle set to run over points, enter:

float r2 = chf(“radius”) * chf(“radius”);
vector offset = @P – chv(“center”);
if (dot(offset, offset) < r2) {
  @Group_insideSphere = 1;
}

Here, dot(offset, offset) computes squared distance. By storing radius squared in r2, you skip the sqrt call, making the wrangle up to 30% faster on dense point clouds. This procedural VEX approach is ideal for dynamic simulations or instanced scatter fields where multiple spherical selections update in real time.

How to avoid precision, performance, and topology pitfalls when using range selections?

When you apply range selections in Houdini, three main traps await: floating-point imprecision, slow evaluations on large meshes, and unintended topology breaks. Addressing each requires both procedural thinking and Houdini-specific workflows.

First, floating-point drift can exclude or include outliers. For example, selecting points with @P.x > 1.234 may miss points at 1.2340001. Instead, store integer indices or wrap your bounds in floor/ceil functions in a Group Expression or Attribute Wrangle. This guarantees consistent thresholds across SOPs and renders.

Second, performance can degrade when evaluating complex expressions per element. A Group Expression over millions of points still loops over each one. To accelerate:

  • Use a Partition SOP or Connectivity SOP to pre-group regions, reducing per-point checks.
  • Chain a Group by Bounding Region SOP first to limit your geometry’s subset before heavy range filters.
  • Shift logic into an Attribute Wrangle with optimized VEX loops (for-loops and branch minimization outperform chained Group nodes).

Finally, slicing by index or coordinate ranges can break mesh continuity. Selecting a contiguous point range won’t preserve shared edges, leading to non-manifold geometry when deleting faces. To avoid this:

  • Perform grouping at the primitive level when carving out faces, then use a Fuse SOP to stitch shared points.
  • Generate an edge group from your range, feed it into PolySplit SOP for clean cuts, and maintain quad or ngon integrity.

By combining integer-based thresholds, pre-partitioning, bounding-box pre-filtering, and topology-aware SOPs, you can harness range selections with precision, speed, and mesh integrity intact.

How to combine, edit, and use multiple range groups downstream (booleans, masking, instancing)?

Once you have created several Group by Range selections, the next step is combining and refining those sets for specific tasks. In Houdini, the Group Combine SOP offers union, intersection, and difference operations. This node sits between your range-based groups and downstream tools, allowing you to merge or subtract entire selections quickly without manual rework.

For boolean operations on groups, connect your primary and secondary range groups into the first two inputs of the Group Combine SOP. Choose “Union” to merge, “Intersect” to keep only overlapping primitives or points, and “Subtract” (A minus B) to carve one selection out of another. This procedural approach ensures that adjustments to the original range parameters automatically update the combined group.

  • Use Union to assemble broad areas for shared operations (e.g., material assignment).
  • Use Intersect to isolate precise overlaps (e.g., where two height ranges meet).
  • Use Subtract to exclude unwanted regions (e.g., holes in a terrain mesh).

After combining groups, you often need to edit them before downstream use. The Group Edit SOP lets you grow, shrink, or invert a selection. Under the Edit tab you can apply a distance-based grow or shrink to soften hard boundaries. In more complex setups, you might use an Attribute Wrangle to apply conditional logic: for example, setting @group_mask = (@P.y > 1.2 ? 1 : 0) to dynamically mask points above a threshold.

Masking geometry by group is vital when driving point scattering or procedural instancing. In a Scatter SOP, enable the “Force Total Count” option and use your combined group as the mask input. Houdini will only generate points within that group. You can also pass @mask attribute through a Point Wrangle to control per-point density or scale directly in VEX.

  • Plug your combined group into the Scatter SOP’s “Group” field for masked scattering.
  • Use a Point Wrangle to remap @mask values into a custom density attribute.
  • Leverage Primitive Groups in Copy to Points for precise instancing on selected faces.

For instancing, feed your masked points into a Copy to Points SOP and assign geometry only to those positions. The instance geometry can receive further transforms driven by VEX or channel references. For instance, you can randomize scale per group by writing @pscale = fit(rand(@ptnum), 0.1, 0.3) within a Wrangle node.

Finally, maintain clarity in your network by naming groups logically: “range_low”, “range_high”, “range_combined”. This naming convention aids in scripting with Python or Hscript and ensures any downstream operator referencing the group knows exactly which selection it represents. By combining, editing, and masking your range groups procedurally, you retain full control and flexibility in complex Houdini rigs.