Edge
An edge between two material grid points.
Constructor Summary
Public Constructor | ||
public |
constructor(a: Vector3, b: Vector3) Constructs a new edge. |
Member Summary
Public Members | ||
public |
a: Vector3 The starting point of the edge. |
|
public |
b: Vector3 The ending point of the edge. |
|
public |
coordinates: Vector3 The local grid coordinates of the starting point. |
|
public |
The index of the starting material grid point. |
|
public |
n: Vector3 The surface normal at the Zero Crossing position. |
|
public |
The Zero Crossing interpolation value. |
Method Summary
Public Methods | ||
public |
approximateZeroCrossing(sdf: SignedDistanceFunction, steps: Number) Approximates the smallest density along the edge. |
|
public |
computeSurfaceNormal(sdf: SignedDistanceFunction): Vector3 Computes the normal of the surface at the edge intersection. |
|
public |
computeZeroCrossingPosition(target: Vector3): Vector3 Calculates the Zero Crossing position. |
Public Constructors
public constructor(a: Vector3, b: Vector3) source
Constructs a new edge.
Params:
Name | Type | Attribute | Description |
a | Vector3 |
|
A starting point. If none is provided, a new vector will be created. |
b | Vector3 |
|
An ending point. If none is provided, a new vector will be created. |
Public Members
Public Methods
public approximateZeroCrossing(sdf: SignedDistanceFunction, steps: Number) source
Approximates the smallest density along the edge.
Params:
Name | Type | Attribute | Description |
sdf | SignedDistanceFunction | A density field. |
|
steps | Number |
|
The maximum number of interpolation steps. Cannot be smaller than 2. |
public computeSurfaceNormal(sdf: SignedDistanceFunction): Vector3 source
Computes the normal of the surface at the edge intersection.
Params:
Name | Type | Attribute | Description |
sdf | SignedDistanceFunction | A density field. |
Return:
Vector3 | The normal. |
TODO:
- Use analytical derivation instead of finite differences.
public computeZeroCrossingPosition(target: Vector3): Vector3 source
Calculates the Zero Crossing position.
Params:
Name | Type | Attribute | Description |
target | Vector3 | A target for the Zero Crossing position. If none is provided, a new vector will be created. |
Return:
Vector3 | The Zero Crossing position. |