cad/view3d.tsimport * as THREE from "three";import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";import { CSS2DObject, CSS2DRenderer } from "three/examples/jsm/renderers/CSS2DRenderer.js";import type { Cabinet, Part, PartBox } from "./model";// Generic 3D CAD drawing of a Cabinet (see model.ts). Renders each part's// assembled box (a part with a pocket renders as a solid slab with the// center cleared), overall dimension callouts in the assembled state, and// per-part cut-size callouts in the exploded state.export interface Cabinet3D {layers: { name: string; color: string }[];setLayerVisible(name: string, on: boolean): void;setExplode(t: number): void; // 0 assembled .. 1 explodedresetView(): void;show(): void;hide(): void;resize(): void;}
Showing the first 20 lines.
Get full code