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

Difference

Extends:

Operation → Difference

A difference operation.

Constructor Summary

Public Constructor
public

Constructs a new difference operation.

Method Summary

Public Methods
public

selectEdge(edge0: Edge, edge1: Edge, s: Boolean): Edge

Selects the edge that is closer to the solid grid point.

public

Updates the specified material index.

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() source

Constructs a new difference operation.

Override:

Operation#constructor

Params:

NameTypeAttributeDescription
...children Operation

Child operations.

Public Methods

public selectEdge(edge0: Edge, edge1: Edge, s: Boolean): Edge source

Selects the edge that is closer to the solid grid point.

Params:

NameTypeAttributeDescription
edge0 Edge

An existing edge.

edge1 Edge

A predominant edge.

s Boolean

Whether the starting point of the edge is solid.

Return:

Edge

The selected edge.

public updateMaterialIndex(index: Number, data0: HermiteData, data1: HermiteData) source

Updates the specified material index.

Params:

NameTypeAttributeDescription
index Number

The index of the material index that needs to be updated.

data0 HermiteData

The target volume data.

data1 HermiteData

Predominant volume data.