Skip to main content

Geometry (beta)

Geometry

Used to sample Geometry data.

Parameters

ParameterDescription
GeometryThe input object.
ModePlease see the table below for detailed description on the difference modes.
AttributeThe name of the attribute to sample when in Attribute mode.

Modes

ModeDescription
Closest PointReturn the closest point on the input geometry.
Closest NormalReturn the closest normal on the input geometry.
Vector To Closest PointReturns a vector from the current point to the closest point on the input geometry
DistanceReturns the distance between the current point and the closest point on the input geometry
Face IndexReturns the index of the closest face on the input geometry
AttributeReturns the sampled attribute value on the input geometry, where the attribute name is provided in the Attribute parameter

Example

If you want to see the completed example you can download yeti_geometrySamplerExample.ma

To get started you can start your scene with a Yeti node assigned to a sphere and a simple graph.

Initial graph setup

A cube can be created and added to the Yeti graph via the Input Objects tab in the Attribute Editor.

Adding a cube to the graph

A Geometry sampler node can be created and set the Geometry to the newly added pCubeShape1 and set the Mode to Vector To Closest Point. This will compute a vector from the current vertex to the closest point on the object.

Create a Geometry sampler

Now we can use this vector to displace the points onto the object. First we create a Displacement node and add the result of geometry0 to the Direction parameter of displacement0.

Create a Displacement node Connect Geometry sampler to Displacement node

The Direction parameter is set to Normalize by default, but if we set this Off and then set the amount to 1.0 you will see all of the point will be displaced to the surface of pCubeShape01.

To make this more visible we can set the Amount parameter to an expression $strandu which will modulate the effect along the length of the fibre.

Update displacement with results

This is a dynamic effect, so as the sphere or cube move the fibres will always be trying to find the closest point on the surface.