Shape

Overview

image
The shape sampler allows you to sample geometric shapes such as spheres, capsules, cylinders, meshes, and generate points on their surface or volume, retrieve normal, UVs, and various other surface properties.
It can be used either through the shape sampler script functions, or using the template core-library nodes, such as shape.sample.

Property

Type

Description

SampleDimensionality

enum

How the shape should be sampled.

  • Vertex: Only works when ShapeType is MESH, samples points at the location of the mesh vertices.

  • Surface: Samples points located on the shape surface.

  • Volume: Only works when ShapeType is not MESH. Samples points in the shape volume.

ShapeType

enum

Type of shape being sampled.

  • SPHERE: Simple sphere shape.

  • ELLIPSOID: Sphere with a non-uniform scale. Can also be an hemisphere.

  • CYLINDER: Simple cylinder shape.

  • CAPSULE: Simple capsule shape (cylinder with hemispherical ends).

  • CONE: Simple cone shape.

  • MESH: 3D model asset used as the shape to sample.

TransformTranslate

bool

Translate the shape according to the specified position property.

TransformRotate

bool

Rotate the shape according to the specified orientation property.

Position

float3

Local shape position.

Orientation

float3

Local shape rotation. Those values are euler angles (in degres).

SPHERE

Radius

float

Sphere radius.
image

InnerRadius

float

Sphere inner radius.
image

NormalizedInnerRadius

float

Normalized inner radius (InnerRadius / Radius).

ELLIPSOID

Radius

float

Ellipsoid radius, same as the sphere radius.

InnerRadius

float

Ellipsoid inner radius, same as the sphere radius.

NormalizedInnerRadius

float

Ellipsoid normalized radius, same as the sphere normalized radius.

Hemisphere

bool

Cut the sphere in half and only keep the top part.
image

NonUniformScale

float3

Scale the sphere on each axis.
image

CYLINDER

Radius

float

Cylinder radius. A cylinder with a radius of 0 is a line.
image

InnerRadius

float

Cylinder inner radius.
image

NormalizedInnerRadius

float

Normalized cylinder inner radius (InnerRadius / Radius).

Height

float

Cylinder height. A cylinder with a height of 0 is a disk.
image

CAPSULE

Radius

float

Capsule radius. A capsule with a radius of 0 is a line.
image

InnerRadius

float

Capsule inner radius.
image

NormalizedInnerRadius

float

Normalized capsule inner radius (InnerRadius / Radius).

Height

float

Capsule height. A capsule with a height of 0 is a sphere.
image

CONE

Radius

float

Cone radius. A cone with a radius of 0 is a line.
image

Height

float

Cone height. A cone with a height of 0 is a disk.
image

MESH

MeshScale

float3

Scales the mesh along each axis.
image

MeshSamplingMode

enum

How the mesh should be sampled.

  • Fast: Samples the mesh without taking its triangles sizes into account. Larger triangles will have a smaller density of points sampled on them.

  • Uniform: Samples the mesh uniformly. This means that the sampled points will be uniformly distributed over the mesh surface, taking into account the mesh triangles sizes.

  • Weighted: Will sample points on the mesh depending on a per-vertex value specified by the DensityChannel property.

SubMeshIndex

int

If the mesh asset is composed of multiple submeshes, this property is used to specify which submesh should be sampled.

DefaultUvStream

int

Index of the per-vertex UV stream that should be sampled by default if the mesh has multiple texture coordinates per-vertex.

DefaultColorStream

int

Index of the color stream that should be sampled by default if the mesh has multiple colors per-vertex.

DensityColorStream

int

Used when the MeshSamplingMode is set to Weighted. This is the index of the color stream that should be used as the density value if the mesh has multiple colors per-vertex.

DensityChannel

enum

Used when the MeshSamplingMode is set to Weighted. This is the color channel that should be used as the density value for the sampling algorithm.

Output pins

DataGeometry

data

The geometry data that can be plugged in the mesh/shape sampling nodes.

+ all sampler properties