Opening3D.tsx

src/views/three/Opening3D.tsx
import type { ThreeEvent } from '@react-three/fiber';
import { wallLength } from '../../scene/geometry';
import type { Opening, Wall } from '../../scene/schema';
import { describeOpening, SELECTED_COLOR, type Selected3D } from '../../scene/describe';
import type { UnitSystem } from '../../scene/units';
type Props = {
opening: Opening;
wall: Wall;
units: UnitSystem;
selectedId: string | null;
onSelect: (sel: Selected3D | null) => void;
};
export function Opening3D({ opening, wall, units, selectedId, onSelect }: Props) {
const len = wallLength(wall);
if (len === 0) return null;
const ux = (wall.end.x - wall.start.x) / len;
const uy = (wall.end.y - wall.start.y) / len;
// Scene (x, y, z) → three (-x, z, -y) — see Wall3D for the handedness note.

Showing the first 20 lines.

Get full code

Support

Talk to the developers of this project to learn more

We have been building professional websites for big clients for over 15 years. Gallop templates and blocks is our best foundation for SEO websites and web apps.

© 2026 Web Plant Media, LLC