Skip to main content
Version: v0.1.0

CopcPointCloud

Streaming COPC viewer. Fetches only the tiles visible in the current camera frustum via HTTP range requests. No server infrastructure required.

import { CopcPointCloud } from "pointflow/copc";

Quick example

<CopcPointCloud
src="https://s3.amazonaws.com/bucket/scan.copc.laz"
colorBy="intensity"
maxConcurrent={16}
persistCache={true}
/>

Props

Required

PropTypeDescription
srcstringURL to a .copc.laz file. Needs CORS + Range request support on the server.

Tile loading

PropTypeDefaultDescription
prefetchStrategy"frustum-priority" | "depth-first" | "nearest" | "bandwidth-saver""frustum-priority"Tile prioritization strategy.
maxConcurrentnumber16Max parallel tile fetch requests.
maxDepthnumber12Octree depth limit.

Caching

PropTypeDefaultDescription
maxCacheMbnumber512In-memory LRU tile budget in MB.
persistCachebooleanfalseStore decoded tiles in OPFS across page reloads.

Rendering

PropTypeDefaultDescription
colorBystringundefinedAttribute key to colour by.
rendererBackend"auto" | "webgpu" | "webgl""auto"Force a renderer or let PointFlow pick.
powerPreference"high-performance" | "low-power" | "default""high-performance"GPU power preference hint for the WebGPU adapter. "high-performance" prefers the discrete GPU on multi-GPU systems. "low-power" prefers the integrated GPU. "default" lets the browser decide. No-op on the WebGL path.
frustumCullingbooleantrue
lodThresholdnumber0.01Screen-space geometric error cutoff. Lower = finer detail.
atlasTiersAtlasTierConfig[]See defaultsGPU atlas tier configuration.

Lifecycle

PropTypeDescription
onReady() => voidCalled after the first frame renders.
onRendererResolved(backend) => void
onError(err: PointFlowError) => void
onProgress(progress: number) => voidCalled with 0–1 as tiles load.
onDeclaredPointCount(count: number) => voidTotal points from COPC header.
onAvailableAttributes(attrs: string[]) => voidAttribute keys present in the file.
renderMetricsRefReact.MutableRefObject<...>
fileSourceLabelstringHuman-readable source label for metrics.
fileViewSnapshotRefReact.MutableRefObject<...>Snapshot ref for serializing the current view state.

AtlasTierConfig

type AtlasTierConfig = {
slotCount: number; // number of slots in this tier
pointsPerSlot: number; // max points per slot
};

Default tiers:

TierSlotsPoints/slotFor
0 (small)4096512Leaf / deep nodes
1 (medium)10248,192Mid-level nodes
2 (large)25665,536Root / shallow nodes

Total default GPU memory: ~280 MB.

Deprecated props

These props existed before v0.1.0 and are now silently ignored:

PropReason
maxPointsMemory is atlas-controlled. Use atlasTiers to tune capacity.
pollIntervalMsLoading is RAF-driven. No polling needed.
workerModeRendering is always direct WebGPU/WebGL.