Home Reference Source
import {DensityFunction} from 'rabbit-hole'
public class | source

DensityFunction

Extends:

Operation → DensityFunction

An operation that describes a density field.

Constructor Summary

Public Constructor
public

Constructs a new density function operation.

Method Summary

Public Methods
public

Calculates the bounding box of this density function.

public

Generates surface intersection data for the specified edge.

public

generateMaterialIndex(position: Vector3): Number

Calculates the material index for the given world position.

Inherited Summary

From class Operation
public

The type of this operation.

public

Calculates the bounding box of this CSG operation while taking all child operations into account.

public

getBoundingBox(): Box3

Calculates the complete bounding box of this CSG operation if it doesn't exist yet and returns it.

Public Constructors

public constructor(sdf: SignedDistanceFunction) source

Constructs a new density function operation.

Override:

Operation#constructor

Params:

NameTypeAttributeDescription
sdf SignedDistanceFunction

An SDF.

Public Methods

public computeBoundingBox(): Box3 source

Calculates the bounding box of this density function.

Override:

Operation#computeBoundingBox

Return:

Box3

The bounding box.

public generateEdge(edge: Edge) source

Generates surface intersection data for the specified edge.

Params:

NameTypeAttributeDescription
edge Edge

The edge that should be processed.

public generateMaterialIndex(position: Vector3): Number source

Calculates the material index for the given world position.

Params:

NameTypeAttributeDescription
position Vector3

The world position of the material index.

Return:

Number

The material index.