Houdini 20.5 Nodes Geometry nodes

Measure 2.0 geometry node

Measures area, volume, or curvature of individual elements or larger pieces of a geometry and puts the results in attributes.

On this page
Since 17.5

This node can be used to measure curvature, which is useful in game development workflows for determining sharp cliff-like areas in terrain, so that rocks or other items can be added to those areas of high curvature, giving the landscape a more natural look.

Measuring area is useful in character workflows, as artists can measure the polygons of characters before and after animation to determine where the polygonal mesh is highly deformed. This information can then be used to blend texture maps.

Measuring volume is often used in destruction workflows, where objects are shattered. Often very small pieces can be deleted (volume under a certain amount), as they don’t affect the overall look and can speed up simulation times. Similarly, measuring perimeter is useful for determining how large things are in 2 dimensional space. For example, this can be used for measuring the 2 dimensional footprint of a city.

Note

Besides perimeter, area, and volume, most other measurements are only applicable to polygons.

Parameters

Group

A point or primitive group on which to report the measurements. The Element Type always matches the group type and the class of the generated attribute.

Element Type

The type of the elements on which to do the measurements. If a group is specified, it must be of the same type as the element type.

Measurement

Measure

Selects the specific quantity to be measured by this operator. In each case, the returned values represent the measurements over the surface share of individual elements (if Accumulate is set to Per Element), piece to which the element belongs (if Accumulate is set to Per Piece), the entire surface/group (if Accumulate is set to Throughout).

Perimeter / Length

Calculates perimeters of individual polygons or total boundary length of connected pieces (if Accumulation is set to Per Piece and a piece attribute is specified) or the entire geometry (if Accumulation is set to Throughout).

Area

Calculates the area.

Volume

Calculates the volume.

Centroid

Calculates the center of mass.

Note

The centroid of a piece of geometry is the center of mass of the its entire surface and not just the average position of its points. Although for a single triangle the two coincide, for more complex geometry the areas of the triangles incident to each point affect its contribution to the average.

Curvature

Calculates various types of curvature.

Gaussian

Returns the product of the two principal curvatures and measures local stretching in the sense that if the surface was supposed to be tightly covered (locally) by a flat piece of elastic fabric the parts with positive Gaussian curvature would require the fabric to stretch and those with negative values would require it to shrink.

Mean

Returns the average of the two principal curvatures and indicates whether the surface is curved more outward or inward.

Make Scale Independent

Normally principal curvatures scale inversely with uniform scaling of input geometry. This option returns a variant of the results which does not change if the input geometry changes scale.

Principal

This option allows you to extract individual principal curvatures (as numbers) or direction (as unit vectors) or both (scaled vectors).

Note

The principal directions are reported as vectors up to a sign change, meaning that the intended direction is both the returned vector and its negation.

Report

You can choose to report either of the smaller or larger of the two principal curvatures or their respective directions. In addition you can choose to decide smaller versus large in the absolute sense to ignore whether the curving is inwards or outwards and only compare the amount of curving. If reported as Curvature a single number is written to the attribute for each element. If Direction is chosen, a unit vector in the direction of the corresponding principal direction is reported. If Vector is chosen, the same vector with a magnitude equal to the corresponding principal curvature is reported.

Difference Filter

Removes (zeros out) measurements for areas where principal directions are not sufficiently distinguishable from one another.

Curvedness

This is the square root of the average of squares of the two principal curvatures and serves as a way of summarizing the two principal curvatures in a single number without distinguishing between them or considering their signs.

Gradient

Calculates the gradient of a scalar (real-valued) source attribute.

This image shows the height gradient on terrain.

Source Attribute

The attribute on which the gradient is calculated. Note that this can be a point, primitive, or vertex attribute regardless of the generated attribute class of the output attribute which is determined by Element Type.

Source Component

Choose the component of a vector-valued attribute to use as source.

Make Scale Independent

Normally gradient scales inversely with uniform scaling of input geometry. This option returns a variant of the gradient which does not change if the input geometry changes scale.

Laplacian

Calculates the laplacian of a scalar or vector source attribute. See the notes under gradient for the Source Attribute and Source Component options, as well as the option to divide the results by surface area.

Source Attribute

The attribute whose Laplacian is calculated.

Source Component

Choose the component of a vector-valued attribute to use as source. You can also use Full Vector to compute a vector-valued Laplacian of a vector attribute.

Make Scale Independent

Enabling this option divides each returned value by its area share which turns it scale independent.

Note

When using Laplacian for smoothing or sharpening features you likely want to enable Make Scale Independent option which effectively replaces the integrated amounts over element shares with their respective area average amounts.

Boundary Integral

Calculates the integral of a source attribute over the boundary of each accumulation region.When Accumulate is set to Per Piece or Throughout all interior edges are automatically canceled out and the returned value for each piece will be a sum over the boundary edges of the products of the length of each edge and the attribute value across that edge. If the source attribute is a primitive attribute, its value across an edge is the same as its value on the primitive to which the edge belongs. If it is a point or vertex attribute then its value across the edge is the average of its values at the two ends.

For example, if the attribute has value 1 on all primitives, the boundary integral on each piece produces exactly the same output as measuring perimeter.

Integration Mode

When integrating vector-valued source attributes, this parameter allows you to choose how the attribute is interpreted at each edge.

Component-wise

Each component of a vector-valued attribute is integrated independently, producing vector-valued results.

Tangent Component

The value integrated at each edge is the dot product of the attribute vector and the unit direction vector of the edge. This corresponds to the mathematical notion of a “line integral”. The result will be real-valued.

Normal Component

The value integrated at each edge is obtained by subtracting the tangent component of the vector along the curve from the attribute, effectively making it orthogonal to the curve before integrating. The result will be vector-valued.

Surface Integral

Calculates the integral of a source attribute over each accumulation region. The returned value for each accumulation region will be a sum over all the elements in that region of the product of their surface share times their source attribute value. The integration Mode work as in the case of Line Integrals.

Note

In this case, using the Normal Component with a vector attribute would generate a scalar output and the tangent component while the tangent component generates a vector valued output.

Accumulate

Chooses what the accumulation regions.

Per Element

The output attribute will calculate a result for each element corresponding to its share of the surface.

Per Piece

Given a piece attribute, the output attribute will have for each element the integrated result for the entire piece to which it belongs. Note that this means that all elements in the same piece receive the same output value. For example calculating the are per piece would assign to each output primitive the whole area of the piece to which it belongs.

Refine To Connected Manifold Pieces

When enabled, the pieces that are described by the piece attribute are further broken down (if possible) so that each final piece is a connected manifold piece. In doing this, non-manifold edges (those shared by 3 or more polygons, or 2 inconsistently oriented polygons) are considered as cuts. If disabled, the results of all connected components with the same piece attribute will be added up and the total is written to every element in that piece.

Throughout

Similar to Per Piece only with the entire geometry (or Group if specified) treated as a single piece.

Position Attribute

If optionally specified, this attribute would override P for calculating all the measurements. It can be a point or vertex attribute. For example the calculations can be done on uv or a rest position.

Visualized Range

The Measure 2.0 SOP comes with a dedicated visualization state. You can enter the state by pressing enter in the viewport when the node is selected. By default, visualization parameters do not cause the operator to cook and are only used for visualization. However if Bake Visualization Range Into Output is set or a Range Group is generated, then these parameters also trigger recooking when modified. Scalar values are visualized as colors with a color ramp used to select the colors assigned to each part of the value range. Vector attributes are visualized by vectors of fixed length but with colors that represent the magnitude of the vectors.

Minimum

If set clamps the output range by the specified minimum. Any output value (magnitude for vectors) smaller than the specified minimum will be clamped the minimum value.

Maximum

If set clamps the output range by the specified maximum. Any output value (magnitude for vectors) greater than the specified maximum will be clamped the minimum value.

Width

If enabled, the output range is additionally clamped centrally to within half the specified width from a Center value. The accompanying menu optionally multiplies this width by a statistical measure of the range of values.

x 1.0

Uses the specified width as is.

x SD

Multiplies the width by the Standard Deviation of the raw range of values (or the raw range of magnitudes for vectors).

x MAD

Multiplies the width by Median Absolute Deviation of the raw range of values (or the raw range of magnitudes for vectors).

Center

Specifies the center value for central clamping.

Fixed

An explicit center is specified.

Mean

The average of the raw output range (or magnitudes of vectors) is used as center.

Median

The median of the raw output range (or magnitudes of vectors) is used as center.

Color mapping

The clamped range is mapped linearly onto the color ramp. The visualization of this node also displays a histogram indicating the concentration of the values along the raw range and how this overlaps the color ramp.

Vector Scale

When the output type is of vector type, this parameter controls the scale at which the vectors are drawn in the viewport. Note that a unit vector is displayed at an automatically selected base scale to avoid clutter in the viewport.

Output

Attribute Name

The name of the attribute to be generated. Note that if the generated name is the default for some measure type, then switching the measure replaces the default attribute name to match the modified measure using a parameter script. Custom names are not changed by this script.

Total Attribute Name

If enabled, a detail attribute will be generated which will hold the total measured quantity over the entire detail (or Group if specified).

Note

This value is equal to the results generated in the output attribute if Accumulate is set to Throughout. The difference is that using the total attribute the value is written a single time as a detail attribute as opposed to being written identically to all elements.

Range Group

If enabled, elements whose raw calculated measured values fits within the visualized range, i.e. those that have not been clamped, are reported in the specified group.

Bake Visualized Range Into Output

If enabled, the same clamping that happens for visualization is also applied to the output values.

Remap Range

If enabled, the (optionally clamped) range of output values (or their magnitudes for vectors) is remapped linearly to match the given minimum and maximum. This option is available if the visualization is being baked into the output.

Examples

MeasureArea Example for Measure geometry node

This example demonstrates how to create groups based on the area of a primitive using the Measure SOP.

MeasureLaplacian Example for Measure geometry node

This example demonstrates how to measure the Laplacian to smooth or sharpen an attribute.

Geometry nodes