Add topography to mesh

This commit is contained in:
Fuhrmann 2025-04-04 13:30:19 +02:00
parent b07af96673
commit dd65a5b804
6 changed files with 237 additions and 92 deletions

View file

@ -166,6 +166,7 @@ export function Form() {
if (!sceneView) return;
sceneView.toggleLayerVisibility(name);
sceneView.dispatchChangeEvent();
}
function handleChangeTopography() {
@ -259,9 +260,12 @@ export function Form() {
<div className="flex flex-col gap-2">
{sceneView?.model.children.map((child) => {
const key = `toggle-visibility-${child.name}`;
const color = `#${(
(child as Mesh).material as MeshStandardMaterial
).color.getHexString()}`;
let color = "transparent";
if ((child as Mesh).material instanceof MeshStandardMaterial) {
color = `#${(
(child as Mesh).material as MeshStandardMaterial
).color.getHexString()}`;
}
const visible = (child as Mesh).visible;
return (