From 46db2184928517cba6677c970451f71322568792 Mon Sep 17 00:00:00 2001 From: Thomas Fuhrmann Date: Fri, 14 Mar 2025 13:34:16 +0100 Subject: [PATCH] Work on bore profiling --- app/components/Form.tsx | 34 +- app/three/CustomMapHeightNodeShader.ts | 31 +- app/three/SceneView.ts | 167 +++++- app/three/config.ts | 2 + app/three/utils/build-scene.ts | 11 +- app/three/utils/create-borehole-svg.ts | 60 +++ package-lock.json | 681 +++++++++++++++++++++++++ package.json | 2 + 8 files changed, 940 insertions(+), 48 deletions(-) create mode 100644 app/three/utils/create-borehole-svg.ts diff --git a/app/components/Form.tsx b/app/components/Form.tsx index d6b4c7d..b8a007c 100644 --- a/app/components/Form.tsx +++ b/app/components/Form.tsx @@ -1,13 +1,13 @@ "use client"; -import { ReactNode, useContext, useRef, useState } from "react"; +import { ChangeEvent, ReactNode, useContext, useRef, useState } from "react"; import { SceneViewContext, SceneViewContextType, } from "../providers/scene-view-provider"; import { Mesh, MeshStandardMaterial } from "three"; -import { scheduler } from "timers/promises"; +import { CustomEvent } from "../three/SceneView"; function Toggle({ title, @@ -15,7 +15,7 @@ function Toggle({ defaultChecked, }: { title: string; - onChange: () => void; + onChange: (e: any) => void; defaultChecked?: boolean; }) { return ( @@ -44,6 +44,7 @@ function Accordion({ }) { const [expanded, setExpanded] = useState(true); const accordionBodyRef = useRef(null); + function handleClick() { if (!accordionBodyRef.current) return; @@ -56,7 +57,7 @@ function Accordion({