Geometry3d
Hierarchy
- Geometry3dHandle
- Geometry3d
Index
Properties
readonlyaabb
The axis-aligned bounding box of the geometry.
Type declaration
max: Vector3
min: Vector3
readonlycenter
The center of the geometry's axis-aligned bounding box in IFC space.
cullOnCameraMove
Specifies whether to cull the geometry when the camera moves.
readonlycullingDistance
The distance at which the geometry should be culled.
readonlyid
The unique identifier for the geometry.
readonlyisTransparent
Indicates whether the geometry is transparent.
readonlyproductsAndMeshes
The products and meshes associated with the geometry.
readonlyreservedIndices
Indices. Describes triangles by referencing items in reservedPositions.
readonlyreservedPositions
Positions written so far, sized to the merge's reserved capacity — not the actual written
count, which stays at reserved size until compact() (on the concrete VertexDataMerge)
trims it. Empty when the merge wrote quantized positions instead. See writtenPositionCount
for the real count.
readonlyreservedUvs
Uvs (u, v), reserved-size like reservedPositions — see writtenPositionCount.
readonlywrittenPositionCount
The number of vertices actually written by the merge. Unlike reservedPositions.length / 3,
this is correct regardless of layout: reservedPositions is empty on the quantized
path, and both arrays stay sized to the merge's reserved capacity — not the actual written
count — until compact() trims them.
Methods
applyToGeometry
Applies geometry to a babylon Geometry. Pass
quantizationto upload int16 positions.Parameters
babylonGeometry: Geometry
engine: Engine
optionalquantization: PositionQuantization
Returns void
applyToMesh
Applies geometry to a babylon Mesh. Whether positions are uploaded as int16 or float32 is fixed when the merge is created — see VertexDataMergeOptions.quantizePositions — because the merge has to produce them in the matching layout.
When quantization is enabled, the int16 positions are written through a scratch buffer shared across every
applyToMeshcall. The upload is synchronous, so the scratch is safe to reuse only if the caller clears the mesh's cached CPU vertex data (e.g.mesh.twinfinity.clearCachedVertexData(), as TwinfinityViewer.addOrReplaceMesh does immediately after calling this) before the nextapplyToMeshcall on any geometry. Skipping that cleanup does not throw — it silently corrupts the previously-uploaded mesh's positions on the next merge.Parameters
mesh: Mesh
engine: Engine
Returns void
copyNormalsTo
Copies normals to existing array.
Type parameters
- T: Writeable<ArrayLike<number>>
Parameters
dst: T
Returns T
toHandle
Handle for this geometry. Can be used to unload the geometry from the GPU.
Returns Geometry3dHandle
Represents a geometry that consists of one or more IFC objects