"use client";
import { RoundedBox } from "@react-three/drei";
import * as THREE from "three";
interface HandleProps {
finish: string;
doorWidth: number;
doorHeight: number;
railDepth: number;
stileWidth: number;
}
// Steel material for handles
const HandleMaterial = ({ color }: { color: string }) => (
);
/**
* Beugelgreep - Vertical bar handle with mounting blocks
* Classic industrial style, common on steel pivot doors
*/
export function Beugelgreep({ finish, doorHeight, railDepth }: HandleProps) {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish] || "#1a1a1a") as string;
const handleLength = Math.min(doorHeight * 0.35, 0.8); // Max 80cm
const barDiameter = 0.025; // 25mm diameter bar
const mountBlockSize: [number, number, number] = [0.04, 0.06, 0.03]; // Mount block dimensions
return (
{/* Main vertical bar */}
{/* Top mounting block */}
{/* Bottom mounting block */}
{/* Mounting screws (detail) */}
{[
[0, handleLength / 2 + mountBlockSize[1] / 2, 0.005],
[0, -handleLength / 2 - mountBlockSize[1] / 2, 0.005],
].map((pos, i) => (
))}
);
}
/**
* Hoekgreep - L-shaped corner handle
* Minimalist flush-mount design
*/
export function Hoekgreep({ finish, doorWidth, railDepth, stileWidth }: HandleProps) {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish] || "#1a1a1a") as string;
const horizontalLength = 0.15; // 15cm horizontal
const verticalLength = 0.12; // 12cm vertical
const barThickness = 0.02; // 20mm thick
const barWidth = 0.03; // 30mm wide
return (
{/* Horizontal bar */}
{/* Vertical bar */}
{/* Corner radius (decorative) */}
);
}
/**
* Maangreep - Crescent/moon shaped recessed handle
* Elegant curved design for flush doors
*/
export function Maangreep({ finish, doorWidth, railDepth, stileWidth }: HandleProps) {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish] || "#1a1a1a") as string;
const curveRadius = 0.08; // 8cm radius
const handleDepth = 0.025; // 25mm deep recess
return (
{/* Main curved handle body */}
{/* Left end cap */}
{/* Right end cap */}
{/* Recessed mounting plate */}
);
}
/**
* Ovaalgreep - Oval/elliptical pull handle
* Modern minimalist design
*/
export function Ovaalgreep({ finish, doorWidth, railDepth, stileWidth }: HandleProps) {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish] || "#1a1a1a") as string;
// Create oval shape using THREE.Shape
const shape = new THREE.Shape();
const rx = 0.06; // 6cm horizontal radius
const ry = 0.03; // 3cm vertical radius
// Draw ellipse
for (let i = 0; i <= 64; i++) {
const angle = (i / 64) * Math.PI * 2;
const x = Math.cos(angle) * rx;
const y = Math.sin(angle) * ry;
if (i === 0) {
shape.moveTo(x, y);
} else {
shape.lineTo(x, y);
}
}
const extrudeSettings = {
depth: 0.02,
bevelEnabled: true,
bevelThickness: 0.003,
bevelSize: 0.003,
bevelSegments: 8,
};
return (
{/* Oval handle ring */}
);
}
/**
* Klink - Traditional door handle with lever
* Classic hinged door handle
*/
export function Klink({ finish, doorWidth, railDepth, stileWidth }: HandleProps) {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish] || "#1a1a1a") as string;
const leverLength = 0.12; // 12cm lever
const leverThickness = 0.015; // 15mm thick
return (
{/* Mounting rosette (round plate) */}
{/* Lever handle */}
{/* Lever end (ergonomic grip) */}
{/* Lock cylinder (detail) */}
);
}
/**
* U-Greep - U-shaped bar handle (current simple version)
* Straight vertical bar for pivot doors
*/
export function UGreep({ finish, railDepth }: HandleProps) {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish] || "#1a1a1a") as string;
return (
);
}