Skip to main content

@twinfinity/geometry

Index

Classes

Enumerations

Functions

Interfaces

Type Aliases

Variables

Type Aliases

ArrowLengthLimits

ArrowLengthLimits: { landingExtension?: number; maxLength?: number; minLength?: number }

Type declaration

  • optionallandingExtension?: number
  • optionalmaxLength?: number
  • optionalminLength?: number

BuildType

BuildType: Dev | Prod

CreateMeshStoreModule

CreateMeshStoreModule: (moduleInfo: MeshStoreModuleOptions) => Promise<TwinfinityMeshStore>

Type declaration

EdgeNormalEntry

EdgeNormalEntry: { extra: boolean; n1: Vec3; n2?: Vec3 }

Type declaration

FlatSegment3

FlatSegment3: [number, number, number, number, number, number]

A 3D line segment as a flat 6-number tuple [x1, y1, z1, x2, y2, z2].

FlightData

FlightData: { avgHeight: number; bottomCenter: { x: number; y: number; z: number }; product: unknown; samples: SamplePoint[]; topCenter: { x: number; y: number; z: number } }

Data for a single stair flight


Type declaration

  • avgHeight: number
  • bottomCenter: { x: number; y: number; z: number }
    • x: number
    • y: number
    • z: number
  • product: unknown
  • samples: SamplePoint[]
  • topCenter: { x: number; y: number; z: number }
    • x: number
    • y: number
    • z: number

HiddenCullOptions

HiddenCullOptions: { angleDot?: number; epsilon?: number }

Type declaration

  • optionalangleDot?: number
  • optionalepsilon?: number

HiddenLineOcclusionOptions

HiddenLineOcclusionOptions: { binarySearchSteps?: number; depthBias?: number; depthEps?: number; maxSamples?: number; sampleSpacing?: number; samplesPerSegment?: number }

Type declaration

  • optionalbinarySearchSteps?: number
  • optionaldepthBias?: number
  • optionaldepthEps?: number
  • optionalmaxSamples?: number
  • optionalsampleSpacing?: number
  • optionalsamplesPerSegment?: number

HiddenLineResult

HiddenLineResult: { hidden: TaggedSegment[]; visible: TaggedSegment[] }

Type declaration

MeasurementUnitFormat

MeasurementUnitFormat: mm | m

Unit format for length/area display. "mm" = millimeters, "m" = meters with decimals.

MutableArrayLike

MutableArrayLike<T>: ArrayLike<T> & {}

Type parameters

  • T

OcclusionOptions

OcclusionOptions: { leafSize?: number; planeOrigin: Vec3; selfOcclusionMinDepth?: number; slabDepth: number; slabEps?: number; viewDir: Vec3 }

Type declaration

  • optionalleafSize?: number
  • planeOrigin: Vec3
  • optionalselfOcclusionMinDepth?: number
  • slabDepth: number
  • optionalslabEps?: number
  • viewDir: Vec3

OcclusionRay

OcclusionRay: { dir: Vec3; dirDotView: number; invDir: Vec3 }

Type declaration

PackedIndices

PackedIndices: TypedArray

PackedMeshHash

PackedMeshHash: Uint32Array

PackedNormals

PackedNormals: Uint16Array

PackedPositions

PackedPositions: TypedArray

PlaneBasis

PlaneBasis: { forward: Vec3; origin: Vec3; right: Vec3; up: Vec3 }

Type declaration

PlaneProjection

PlaneProjection: { depth: number; x: number; y: number }

Type declaration

  • depth: number
  • x: number
  • y: number

PlaneSectionSegment

PlaneSectionSegment: Segment3

Plane section segment — a line segment from plane-mesh intersection.

Point2D

Point2D: { x: number; z: number }

2D point for path calculations.


Type declaration

  • x: number
  • z: number

Polyline3

Polyline3: Vec3[]

RenderMode

RenderMode: normal | silhouette-only | silhouette-with-features | skip

Render mode for a product — determines which line types are generated.

SamplePoint

SamplePoint: { x: number; y: number; z: number }

2D sample point (projected onto XZ plane).


Type declaration

  • x: number
  • y: number
  • z: number

SectionStateValidationResult

SectionStateValidationResult: { ok: true } | { errors: string[]; ok: false }

Segment3

Segment3: [Vec3, Vec3]

A 3D line segment defined by two endpoints.

SegmentSimplifyOptions

SegmentSimplifyOptions: { collinearAngleDeg?: number; maxIterations?: number; minSegmentLength?: number; weldEps?: number }

Type declaration

  • optionalcollinearAngleDeg?: number
  • optionalmaxIterations?: number
  • optionalminSegmentLength?: number
  • optionalweldEps?: number

T8GIModel

TaggedSegment

TaggedSegment: { a: Vec3; b: Vec3; category?: number; productIndex?: number }

Tagged segment with optional metadata for tracking through the pipeline. productIndex and category are preserved through clipping/dedup but not used by algorithms.


Type declaration

  • a: Vec3
  • b: Vec3
  • optionalcategory?: number
  • optionalproductIndex?: number

Triangle2D

Triangle2D: { minY: number; v0: { x: number; z: number }; v1: { x: number; z: number }; v2: { x: number; z: number } }

2D Triangle for occlusion testing (projected to XZ plane).


Type declaration

  • minY: number
  • v0: { x: number; z: number }
    • x: number
    • z: number
  • v1: { x: number; z: number }
    • x: number
    • z: number
  • v2: { x: number; z: number }
    • x: number
    • z: number

TriangleSoA

TriangleSoA: { ax: Float64Array; ay: Float64Array; az: Float64Array; bx: Float64Array; by: Float64Array; bz: Float64Array; count: number; cx: Float64Array; cy: Float64Array; cz: Float64Array; maxX: Float64Array; maxY: Float64Array; maxZ: Float64Array; minX: Float64Array; minY: Float64Array; minZ: Float64Array; normalDotView: Float64Array; productId: Int32Array }

Structure-of-Arrays layout for triangles — eliminates V8 per-object overhead.


Type declaration

  • ax: Float64Array
  • ay: Float64Array
  • az: Float64Array
  • bx: Float64Array
  • by: Float64Array
  • bz: Float64Array
  • count: number
  • cx: Float64Array
  • cy: Float64Array
  • cz: Float64Array
  • maxX: Float64Array
  • maxY: Float64Array
  • maxZ: Float64Array
  • minX: Float64Array
  • minY: Float64Array
  • minZ: Float64Array
  • normalDotView: Float64Array
  • productId: Int32Array

TypedArray

TypedArray: Uint8Array | Uint16Array | Uint32Array | Float32Array | Float64Array

UintArray

UintArray: Uint8Array | Uint16Array | Uint32Array

Vec2

Vec2: [number, number]

Vec3

Vec3: [number, number, number]

Variables

constARROW_EXTENT_RATIO

ARROW_EXTENT_RATIO: 0.9 = 0.9

constARROW_HEAD_LENGTH_RATIO

ARROW_HEAD_LENGTH_RATIO: 0.2 = 0.2

constARROW_HEAD_WIDTH_RATIO

ARROW_HEAD_WIDTH_RATIO: 0.1 = 0.1

constCELL_SIZE_AVG_RATIO

CELL_SIZE_AVG_RATIO: 0.25 = 0.25

constCELL_SIZE_EPS_MULTIPLIER

CELL_SIZE_EPS_MULTIPLIER: 4 = 4

constCLIP_EPSILON

CLIP_EPSILON: 0.000001 = 1e-6

Geometric clipping and intersection tolerance.

constCROSS_PRODUCT_THRESHOLD

CROSS_PRODUCT_THRESHOLD: 0.01 = 0.01

constDEFAULT_ALIGNMENT

DEFAULT_ALIGNMENT: 32 = 32

constDEFAULT_BINARY_STEPS

DEFAULT_BINARY_STEPS: 4 = 4

constDEFAULT_CULL_ANGLE_DOT

DEFAULT_CULL_ANGLE_DOT: 0.995 = 0.995

constDEFAULT_CULL_EPSILON

DEFAULT_CULL_EPSILON: 0.002 = 0.002

constDEFAULT_DEPTH_EPS

DEFAULT_DEPTH_EPS: 0.001 = 1e-3

constDEFAULT_EPS

DEFAULT_EPS: 0.00001 = 1e-5

constDEFAULT_SAMPLES

DEFAULT_SAMPLES: 9 = 9

constDEFAULT_SLAB_SECTION_OPTIONS

DEFAULT_SLAB_SECTION_OPTIONS: Required<Pick<SlabSectionAlgorithmOptions, lines | featureAngle | featureEdgesOnly | featureEdgesIncludeBoundary | minEdgeLength | stairArrows | complexityDetection | occlusionQuality | culling | simplification | dedupEpsilon | stairGrouping>> = ...

Default values for slab section algorithm options.

constEQUALITY_EPSILON

EQUALITY_EPSILON: 1e-10 = 1e-10

Vector/angle equality comparison.

constFACE_EPSILON

FACE_EPSILON: 0.000001 = 1e-6

Face normal tolerance.

constFALLBACK_UP_THRESHOLD

FALLBACK_UP_THRESHOLD: 0.9 = 0.9

constHEIGHT_THRESHOLD_RATIO

HEIGHT_THRESHOLD_RATIO: 0.3 = 0.3

constINITIAL_BEST_DOT

INITIAL_BEST_DOT: -2 = -2

constLANDING_EXTENSION

LANDING_EXTENSION: 1.3 = 1.3

constMAX_ARROW_LENGTH

MAX_ARROW_LENGTH: 20 = 20

constMAX_SAMPLES

MAX_SAMPLES: 64 = 64

constMAX_SIMPLIFY_ITERATIONS

MAX_SIMPLIFY_ITERATIONS: 4 = 4

constMIN_ARROW_LENGTH

MIN_ARROW_LENGTH: 0.8 = 0.8

constMIN_CELL_SIZE

MIN_CELL_SIZE: 0.001 = 1e-3

Minimum cell size for spatial hashing.

constMIN_EDGE_LENGTH

MIN_EDGE_LENGTH: 0.1 = 0.1

constMIN_EXTENT

MIN_EXTENT: 0.1 = 0.1

constMIN_HEIGHT_RANGE

MIN_HEIGHT_RANGE: 0.3 = 0.3

constMIN_POLYLINE_POINTS

MIN_POLYLINE_POINTS: 2 = 2

constMIN_RAMP_HEIGHT

MIN_RAMP_HEIGHT: 0.1 = 0.1

constMIN_RAY_T

MIN_RAY_T: 0.0001 = 1e-4

Minimum ray t for occlusion testing.

constMIN_SAMPLES

MIN_SAMPLES: 2 = 2

constMIN_SEGMENT_T

MIN_SEGMENT_T: 0.00001 = 1e-5

Minimum parametric t for segment subdivision.

constMIN_STAIR_SAMPLES

MIN_STAIR_SAMPLES: 6 = 6

constMIN_TRIANGLE_COUNT

MIN_TRIANGLE_COUNT: 3 = 3

constMIN_VERTEX_COUNT

MIN_VERTEX_COUNT: 3 = 3

constNORMALIZE_EPSILON

NORMALIZE_EPSILON: 1e-12 = 1e-12

Near-zero guard for normalization and division safety.

constOCCLUSION_BIAS

OCCLUSION_BIAS: 0.0001 = 1e-4

Occlusion depth bias.

constOPPOSITE_DIRECTION_DOT

OPPOSITE_DIRECTION_DOT: -0.7 = -0.7

constPARALLEL_THRESHOLD

PARALLEL_THRESHOLD: 4 = 4.0

constRAMP_CLASSES

RAMP_CLASSES: readonly [ramp, ramps, ifcramp, ifcrampflight] = ...

constRAMP_HEAD_LENGTH_RATIO

RAMP_HEAD_LENGTH_RATIO: 0.15 = 0.15

constRAMP_HEAD_WIDTH_RATIO

RAMP_HEAD_WIDTH_RATIO: 0.5 = 0.5

constRAMP_LONG_EDGE_ITERATIONS

RAMP_LONG_EDGE_ITERATIONS: 4 = 4

constRAMP_NUM_LAYERS

RAMP_NUM_LAYERS: 5 = 5

constRAMP_PARALLEL_DOT

RAMP_PARALLEL_DOT: 0.3 = 0.3

constRAY_PARALLEL_EPSILON

RAY_PARALLEL_EPSILON: 0.000001 = 1e-6

Ray parallel detection.

constSEQUENTIAL_THRESHOLD

SEQUENTIAL_THRESHOLD: 3 = 3.0

constSLAB_EPSILON

SLAB_EPSILON: 0.0001 = 1e-4

Slab clipping tolerance.

constSTAIRS_CATEGORY

STAIRS_CATEGORY: stairs = 'stairs'

constSTAIR_AND_RAMP_CLASSES

STAIR_AND_RAMP_CLASSES: readonly [stair, stairs, ifcstair, stairflight, ifcstairflight, ramp, ramps, ifcramp, ifcrampflight] = ...

constSTAIR_FLIGHT_CLASSES

STAIR_FLIGHT_CLASSES: readonly [stairflight, ifcstairflight] = ...

constSTAIR_PARENT_CLASSES

STAIR_PARENT_CLASSES: readonly [stair, stairs, ifcstair] = ...

constTRIANGLE_DET_EPSILON

TRIANGLE_DET_EPSILON: 1e-8 = 1e-8

Triangle determinant tolerance.

constWELD_EPSILON

WELD_EPSILON: 0.001 = 1e-3

Vertex welding tolerance.

constZERO_EPSILON

ZERO_EPSILON: 1e-8 = 1e-8

Numeric zero guard for determinants, ray tests, direction lengths.

constbuildInfo

buildInfo: Readonly<BuildInfo> = ...

constdecodePackedNormal

decodePackedNormal: ReadonlyArray<Readonly<{ x: number; y: number; z: number }>> = ...

constpackedNormalPackSize

packedNormalPackSize: 252 = 252.0
Page Options