mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
ifcviewer: reorder sidecar by Morton in the offline bake path
SidecarBuilder::build (the one-shot bake used by the models-panel export command in bonsaiviewer) never called reorderSidecarByMorton, unlike the live streaming loader. The chunk table was therefore left empty, so the exported .ifcview had its geometry laid out non-contiguously and only the metadata blocks compressed. Reorder before writeSidecar to match the loader so exported sidecars stream correctly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "Federation.h"
|
||||
#include "LodBuilder.h"
|
||||
#include "SidecarCache.h"
|
||||
#include "SidecarLayout.h"
|
||||
#include "VertexQuantization.h"
|
||||
|
||||
#include <QEventLoop>
|
||||
@@ -205,6 +206,13 @@ bool SidecarBuilder::build(const QString& ifc_path,
|
||||
|
||||
SidecarData data = finalize(georef, streamer.drainElements());
|
||||
|
||||
// Match the live loader (SceneLoader::onStreamerFinished): reorder into the
|
||||
// chunk-contiguous layout, which populates the chunk table so writeSidecar
|
||||
// actually compresses the geometry. Without it this offline bake path (used
|
||||
// by the models-panel export command) writes a sidecar whose geometry was
|
||||
// never laid out contiguously, with only the metadata blocks compressed.
|
||||
reorderSidecarByMorton(data);
|
||||
|
||||
if (!writeSidecar(anchor_path.toStdString(), data)) {
|
||||
last_error_ = "writeSidecar failed";
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user