import React, { useState, useMemo } from 'react'; import { Ruler, Scissors, Sparkles, MoveHorizontal, ArrowDownToLine, MoveVertical, Maximize2, FileText, ChevronRight, Printer } from 'lucide-react'; const App = () => { // --- Состояние (State) --- const [hips, setHips] = useState(102); const [waist, setWaist] = useState(92); const [sideHeight, setSideHeight] = useState(32); const [seatHeight, setSeatHeight] = useState(25); const [stretch, setStretch] = useState(10); const [showMarkers, setShowMarkers] = useState(true); // --- Вычисления (Logic) --- const calculations = useMemo(() => { const reductionFactor = 1 - (stretch / 100); const totalWidthRaw = hips / 2; const totalWidthReduced = totalWidthRaw * reductionFactor; const backWidth = (totalWidthReduced * 0.45).toFixed(1); const frontSideWidth = (totalWidthReduced * 0.25).toFixed(1); const pouchWidth = (totalWidthReduced * 0.15).toFixed(1); // Высоты const pouchHeight = seatHeight; const legLength = Math.max(0, sideHeight - seatHeight); // Ластовица const gussetWidth = (totalWidthReduced * 0.16).toFixed(1); const gussetLength = (seatHeight * 0.5).toFixed(1); const fabricLength = sideHeight + 5; return { backWidth, frontSideWidth, pouchWidth, gussetWidth, gussetLength, fabricLength, reductionFactor, pouchHeight, legLength }; }, [hips, waist, sideHeight, seatHeight, stretch]); // --- Печать --- const handlePrint = () => { window.print(); }; // --- Компоненты UI --- const Marker = ({ x, y, label, color }) => { if (!showMarkers) return null; return ( {label} ); }; const QuantityBadge = ({ x, y, count, note }) => ( x{count} {note && {note}} ); return (
{/* Стили для печати */} {/* Header - Скрывается при печати */}

Анатомическая правда.

Настройте параметры и распечатайте техническую карту.

{/* Controls - Скрывается при печати */}

Размеры

{seatHeight}
setSeatHeight(Number(e.target.value))} className="w-full h-1 bg-gray-100 rounded-full appearance-none cursor-pointer accent-blue-600" />
{sideHeight}
setSideHeight(Number(e.target.value))} className="w-full h-1 bg-gray-100 rounded-full appearance-none cursor-pointer accent-blue-600" />
{hips}
setHips(Number(e.target.value))} className="w-full h-1 bg-gray-100 rounded-full appearance-none cursor-pointer accent-blue-600" />
{stretch}
setStretch(Number(e.target.value))} className="w-full h-1 bg-gray-100 rounded-full appearance-none cursor-pointer accent-purple-600" />
{/* Visualization & Table - ПЕЧАТНАЯ ЗОНА */}
{/* Top Bar */}

Техническая карта

Проект: Мужские боксеры (Анатомический крой)

{/* SVG Visualizer */}
{/* --- 1. Back Panel (Спинка) --- */} СПИНКА СГИБ {/* --- 2. Side Panel (Бок) --- */} БОК {/* --- 3. Pouch (Гульфик) --- */} ГУЛЬФИК ЦЕНТР {/* --- 4. Gusset (Ластовица) --- */} ЛАСТОВИЦА
{/* Data Table */}

Параметры кроя (см)

1. Спинка (ширина){calculations.backWidth}
2. Бок (ширина){calculations.frontSideWidth}
3. Гульфик (ширина){calculations.pouchWidth}
4. Ластовица{calculations.gussetWidth} x {calculations.gussetLength}

Высоты (см)

Высота сиденья (до ластовицы){calculations.pouchHeight}
Длина штанины{calculations.legLength.toFixed(1)}
Общая длина бока{sideHeight}
Расход ткани (при 150см)~{calculations.fabricLength}
Точки совмещения: A-A', B-B', C-C', D-D', E-E' *Размеры даны без припусков на швы
); }; export default App;
Made on
Tilda