pub struct GpuPointToPlaneInput { /* private fields */ }Expand description
Reusable explicitly uploaded positions/tree and original-order target normals. A single common normal scale preserves relative raw-normal weights; normals are never normalized individually. Source positions remain immutable.
Implementations§
Source§impl GpuPointToPlaneInput
impl GpuPointToPlaneInput
Sourcepub fn upload(
runtime: &WgpuRuntime,
source: &[[f32; 3]],
target: &KdTree,
target_normals: &[[f32; 3]],
) -> SpatialResult<Self>
pub fn upload( runtime: &WgpuRuntime, source: &[[f32; 3]], target: &KdTree, target_normals: &[[f32; 3]], ) -> SpatialResult<Self>
Uploads original source positions, target tree and original-order raw target normals. Normals must be finite; zero rows retain their zero weight. Nonzero components must remain normal f32 after common scaling. H2D payload is 16S + 48T + 32*M bytes (M = target tree nodes).
Sourcepub fn upload_with_gpu_gather(
runtime: &WgpuRuntime,
source: &[[f32; 3]],
target: &KdTree,
target_normals: &[[f32; 3]],
) -> SpatialResult<Self>
pub fn upload_with_gpu_gather( runtime: &WgpuRuntime, source: &[[f32; 3]], target: &KdTree, target_normals: &[[f32; 3]], ) -> SpatialResult<Self>
Explicitly uses shared GPU gathering for target tree points/queries.
Host payload is 16S + 32T + 32M bytes, compared with 16S + 48T + 32M
for upload; device output bytes are 32T. Raw-normal validation/packing and common normal scale are unchanged.
Source/geometry preparation remains on CPU. Two transient inputs add
16T GPU bytes; host target packing totaling 32*T payload bytes over
construction is removed. No readback or completion wait is added.
Placement is explicit; small inputs may be slower and existing device
requirements apply. See GpuIcpInput::upload_with_gpu_gather.
Sourcepub const fn upload_transfers(&self) -> TransferStats
pub const fn upload_transfers(&self) -> TransferStats
All position/tree/normal payload uploaded at construction.
Sourcepub fn source_count(&self) -> u32
pub fn source_count(&self) -> u32
Original source count.
Sourcepub fn equations_resident(
&self,
runtime: &WgpuRuntime,
transform: Isometry3<f32>,
max_distance: f32,
) -> SpatialResult<GpuPointToPlaneNormalEquations>
pub fn equations_resident( &self, runtime: &WgpuRuntime, transform: Isometry3<f32>, max_distance: f32, ) -> SpatialResult<GpuPointToPlaneNormalEquations>
Transforms originals, runs unbounded nearest matching then an inclusive Euclidean distance gate, and reduces centered/scaled Hessian/gradient and raw-normal point-to-plane squared fitness. Five passes share a submission; no payload transfer or host wait occurs. Transformed query storage is reused for rotation/residual rows after matching. Private scratch is 40S + 240min(ceil(S/64),256) bytes. f32 operations can change matches, weights, solutions and stopping relative to the existing CPU f64 path.