"use client"; import React, { useState } from "react"; import { Mountain, X, Sparkles } from "lucide-react"; import { generateAdvancedTerrainWithPad, type TerrainTopographyPreset, } from "@/lib/architecturalBimEngine"; import type { WorkplaneShape, ArchitecturalTextureId } from "@/types/sketchforge"; export interface TerrainGeneratorModalProps { isOpen: boolean; onClose: () => void; onAddShape: (shape: WorkplaneShape) => void; } export const TerrainGeneratorModal: React.FC = ({ isOpen, onClose, onAddShape, }) => { const [preset, setPreset] = useState("hills"); const [width, setWidth] = useState(200); const [depth, setDepth] = useState(200); const [maxHeight, setMaxHeight] = useState(18); const [texture, setTexture] = useState("grass"); const [includeBuildingPad, setIncludeBuildingPad] = useState(true); if (!isOpen) return null; const previewResult = generateAdvancedTerrainWithPad({ preset, width, depth, maxHeight, gridResolution: 16, texture, includeBuildingPad, }); const handleGenerate = () => { onAddShape(previewResult.terrainShape); if (previewResult.padShape) { onAddShape(previewResult.padShape); } onClose(); }; return (
{/* Header */}

Arazi & Topoğrafya Oluşturucu

Simplex-Noise + Delaunator üçgenleme ve bina oturum hafriyat hesabı

{/* Content */}
{/* Preset Selection */}
{[ { id: "hills", label: "Dalgalı Tepe", desc: "Simplex doğal yükseltiler" }, { id: "slope", label: "Eğimli Arsa", desc: "Tek yöne meyil" }, { id: "terrace", label: "Teraslı Plato", desc: "Eşyükselti kademeli kotlar" }, { id: "valley", label: "Vadi / Çukur", desc: "Ortası alçak vadi" }, { id: "coastal-ridge", label: "Kıyı Sırtı", desc: "Yamaç ve sırt hattı" }, ].map((item) => ( ))}
{/* Sliders */}
Genişlik & Derinlik {width} × {depth} mm
{ const val = Number(e.target.value); setWidth(val); setDepth(val); }} className="w-full accent-emerald-600" />
Tepe / Kot Yüksekliği {maxHeight} mm
setMaxHeight(Number(e.target.value))} className="w-full accent-emerald-600" /> {includeBuildingPad ? (
Kazı (Hafriyat) {previewResult.excavationCutVolumeM3} m³
Dolgu Hacmi {previewResult.embankmentFillVolumeM3} m³
Delaunay Ağ {previewResult.triangleCount} üçgen
) : null}
{/* Texture */}
{/* Footer */}
); };