Expand description
Optimized Parquet serialization using ara3d BimOpenSchema format.
Key optimizations over basic Parquet: integer quantized vertices (10,000x multiplier = 0.1mm precision), mesh dedup via content hashing PLUS rotation-aware representation-identity dedup (#3575), byte colors (0-255 instead of float 0-1), optional normals, material dedup.
Typical additional compression: 3-5x over basic Parquet format.
Structsยง
- Material
Key ๐ - Material key for deduplication.
- Optimized
Stats - Statistics about the optimized serialization.
Constantsยง
- VERTEX_
MULTIPLIER - Vertex multiplier for integer quantization. 10,000 = 0.1mm precision.
Functionsยง
- assemble_
optimized_ ๐output - Header:
[version:u8][flags:u8][instance_len:u32][mesh_len:u32][material_len:u32][vertex_len:u32][index_len:u32]Then:[instance_parquet][mesh_parquet][material_parquet][vertex_parquet][index_parquet] - check_
optimized_ ๐section_ lengths - Validate the five optimized-writer section lengths against the u32 wire
limit. Takes plain lengths, not byte slices, so a >4 GiB test case is just
the number
u32::MAX as usize + 1โ no multi-gigabyte buffer needed. - color_
to_ ๐byte - Convert float color (0-1) to byte (0-255).
- quantize_
position ๐ - Quantize a float position to integer (0.1mm precision).
- serialize_
to_ ๐parquet_ optimized - Serialize mesh data to optimized Parquet format (ara3d BOS-compatible):
instances table (entity โ mesh/material index, origin, rotation), meshes
table (unique geometries), materials table, vertices table (quantized
integers), indices table. Dedup covers both bit-identical placements
(content hash) and, as of issue #3575, one shape at DIFFERENT rotations
(
IfcMappedItem/ sharedIfcRepresentationMapreuse โ furniture, pipe runs, repeated structural members). - serialize_
to_ parquet_ optimized_ with_ stats - Serialize with stats.
- write_
parquet_ ๐buffer - Write a RecordBatch to a Parquet buffer with LZ4 compression. Dictionary encoding is disabled for numeric columns (floats, integers) as they have high entropy and dictionary encoding provides no benefit while adding significant overhead.