Slide 25 · Serialization

From Points to a Sequence

A point cloud has no order. A space-filling curve gives it one. Five steps, one at a time: press Next (or →).

Curve:

?Why a space-filling curve, and not a simpler order?

Measured on the course's car scan (2 500 points), cutting each ordering into patches of 64 points, as PTv3 does with 1 024:

ordernext point in the list is on averageof a point's 8 nearest neighbours, in its patcha patch spans
file order1.51 m away0.24.3 m
sort by x1.37 m1.73.7 m
row by row (x, then y, then z)0.24 m4.12.3 m
Z-order curve0.10 m6.21.2 m
Hilbert curve0.09 m6.01.0 m
  1. Compact patches. A curve keeps neighbours together in all three directions, so a patch is a small blob, not a stripe. More of each point's real neighbours are in its patch, which is what attention needs.
  2. No search. A point's number is computed from its own coordinates alone (a few bit operations), without looking at any other point. All points are numbered in parallel; then one sort orders the whole scene. Compare PTv2, which searches every point's neighbours in every layer.
  3. Only occupied cells count. Empty space costs nothing: no grid is stored, any scene size works.
  4. A built-in hierarchy. Drop the last 3 bits of a cell's number and you get the number of the cell twice as big that contains it. PTv3's grid pooling uses exactly this, so the pooled points come out already numbered.
  5. Several curves to choose from. Z-order, Hilbert and their trans versions split the space differently, which Shift Order uses (slide 28).

+Compare the four curves

The same 8 × 8 grid, all four curves drawn together. Z-order makes Z shapes and sometimes jumps (the next cell does not touch the current one: two consecutive cells far apart). Hilbert makes U-turns and never jumps. The trans versions are the same curves with x and y swapped.