From 3d6fe41ee91be935c651a84b7636ceac1eff2c82 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Sun, 9 Mar 2025 13:44:30 -0400 Subject: [PATCH] [3d] add edge threshold support (#2939) Co-authored-by: github-actions --- src/components/load3d/Load3D.vue | 15 ++++ src/components/load3d/Load3DControls.vue | 58 +++++++++++++++ src/components/load3d/Load3DScene.vue | 4 ++ .../core/load3d/Load3DConfiguration.ts | 12 +++- src/extensions/core/load3d/Load3d.ts | 4 ++ src/extensions/core/load3d/ModelManager.ts | 72 ++++++++++++++++++- src/locales/en/main.json | 3 +- src/locales/fr/main.json | 1 + src/locales/ja/main.json | 1 + src/locales/ko/main.json | 1 + src/locales/ru/main.json | 1 + src/locales/zh/main.json | 1 + 12 files changed, 169 insertions(+), 4 deletions(-) diff --git a/src/components/load3d/Load3D.vue b/src/components/load3d/Load3D.vue index ed3e222c2f..f2e5bc576a 100644 --- a/src/components/load3d/Load3D.vue +++ b/src/components/load3d/Load3D.vue @@ -12,6 +12,7 @@ :backgroundImage="backgroundImage" :upDirection="upDirection" :materialMode="materialMode" + :edgeThreshold="edgeThreshold" @materialModeChange="listenMaterialModeChange" @backgroundColorChange="listenBackgroundColorChange" @lightIntensityChange="listenLightIntensityChange" @@ -21,6 +22,7 @@ @showPreviewChange="listenShowPreviewChange" @backgroundImageChange="listenBackgroundImageChange" @upDirectionChange="listenUpDirectionChange" + @edgeThresholdChange="listenEdgeThresholdChange" /> @@ -79,6 +83,7 @@ const hasBackgroundImage = ref(false) const backgroundImage = ref('') const upDirection = ref('original') const materialMode = ref('original') +const edgeThreshold = ref(85) const showPreviewButton = computed(() => { return !props.type.includes('Preview') @@ -130,6 +135,12 @@ const handleUpdateFOV = (value: number) => { node.value.properties['FOV'] = fov.value } +const handleUpdateEdgeThreshold = (value: number) => { + edgeThreshold.value = value + + node.value.properties['Edge Threshold'] = edgeThreshold.value +} + const handleBackgroundColorChange = (value: string) => { backgroundColor.value = value @@ -158,6 +169,10 @@ const listenUpDirectionChange = (value: UpDirection) => { upDirection.value = value } +const listenEdgeThresholdChange = (value: number) => { + edgeThreshold.value = value +} + const listenBackgroundColorChange = (value: string) => { backgroundColor.value = value } diff --git a/src/components/load3d/Load3DControls.vue b/src/components/load3d/Load3DControls.vue index 99c67499ac..84eebf1246 100644 --- a/src/components/load3d/Load3DControls.vue +++ b/src/components/load3d/Load3DControls.vue @@ -166,7 +166,42 @@ +
+ +
+ + +
+
+