beam: preserve point cloud source colors

This commit is contained in:
CODEX 2026-06-04 23:52:58 +03:00
parent bb30202b9b
commit 0a09296022
2 changed files with 6 additions and 3 deletions

View File

@ -436,6 +436,7 @@ const getDisplayModePreset = (mode) => {
const getBaseEdgesForModel = (modelId) => { const getBaseEdgesForModel = (modelId) => {
const modelType = modelTypes[modelId]; const modelType = modelTypes[modelId];
if (modelType === "las") return false;
if (modelType === "gltf") return false; if (modelType === "gltf") return false;
return !!toggleEdges?.checked; return !!toggleEdges?.checked;
}; };
@ -453,7 +454,9 @@ const applyDisplayModeToModel = (modelId) => {
entity.xrayed = !!preset.xrayed; entity.xrayed = !!preset.xrayed;
entity.colorize = preset.colorize; entity.colorize = preset.colorize;
entity.opacity = preset.opacity; entity.opacity = preset.opacity;
entity.edges = preset.edges === "base" ? getBaseEdgesForModel(modelId) : !!preset.edges; entity.edges = modelTypes[modelId] === "las"
? false
: (preset.edges === "base" ? getBaseEdgesForModel(modelId) : !!preset.edges);
} catch (err) { } catch (err) {
console.warn("display mode update failed", err); console.warn("display mode update failed", err);
} }
@ -2899,7 +2902,7 @@ const initViewer = async () => {
const loadOpts = { const loadOpts = {
id, id,
src: srcToLoad, src: srcToLoad,
edges: edges ?? (inferredType === "gltf" ? false : toggleEdges.checked), edges: edges ?? (inferredType === "gltf" || inferredType === "las" ? false : toggleEdges.checked),
}; };
if (inferredType === "gltf") loadOpts.autoMetaModel = true; if (inferredType === "gltf") loadOpts.autoMetaModel = true;
if (inferredType === "bim" || inferredType === "las") loadOpts.rotation = [-90, 0, 0]; if (inferredType === "bim" || inferredType === "las") loadOpts.rotation = [-90, 0, 0];

View File

@ -239,6 +239,6 @@
<input id="fileInput" class="hidden" type="file" <input id="fileInput" class="hidden" type="file"
accept=".xkt,.glb,.gltf,.bim,.las,.laz,.obj,.stl"> accept=".xkt,.glb,.gltf,.bim,.las,.laz,.obj,.stl">
<script type="module" src="./dcViewer.js?v=9"></script> <script type="module" src="./dcViewer.js?v=10"></script>
</body> </body>
</html> </html>