feat(stereo): B — умные точки (деление m:n, координаты, перетаскивание)
Фаза B раунда «Конструктор» (умные точки для построений). B1 — деление отрезка m:n: задаёшь m,n, кликаешь 2 точки A,B → точка делит AB как AM:MB = m:n (t=m/(m+n)), создаётся как точка-построение M,N,K… B2 — точка по координатам: поля x/y/z + кнопка → addPointAt. B3 — перетаскивание построенных точек мышью: drag в плоскости, обращённой к камере (нормаль фиксируется на старте), приоритет над орбитой; снапшот истории на старте → undo откатывает весь drag. Непараметрично: downstream- объекты за перетаскиванием не следуют (параметрический граф — бэклог). - StereoSim: setDivideMode/setDivideRatio (+ ветка в _onConstructClick), addPointAt; setDragPointMode/_pickCPointAt/_beginCPointDrag/_rayPlaneHit/ _dragCPointWithRay/_dragCPointAt/_endCPointDrag; pointer-хендлеры (down=начать drag, move=тащить, up=завершить); сброс в setFigure; интеграция в _stereoDeactivateTools. - Панель: блок «Точки» (кнопки Деление/Тащить, поля m:n, поля x,y,z + «Точка (x,y,z)»); glue stereoDivideMode/DivideRatio/AddCoordPoint/ DragPointMode. Верификация: node --check OK; headless-смоук 25/25 (деление 1:1/1:2/3:1, координатная точка + отказ NaN, ray∩plane вкл. parallel/behind, drag begin→ move→end с проверкой позиции и снапшота истории + undo, взаимоисключение режимов, setFigure-сброс, dispose); эмодзи/eval/new Function — 0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3699,6 +3699,27 @@
|
||||
<svg viewBox="0 0 24 24"><polygon points="3,14 12,17 21,9 12,6" fill="none"/><line x1="12" y1="2" x2="12" y2="21"/></svg>⟂ плоск.
|
||||
</button>
|
||||
</div>
|
||||
<div class="st-tool-grid" style="margin-top:3px">
|
||||
<button class="st-tool-btn" id="stereo-divide-btn" onclick="stereoDivideMode(this)" title="Точка, делящая отрезок AB в отношении m:n — задайте m,n и кликните 2 точки">
|
||||
<svg viewBox="0 0 24 24"><line x1="3" y1="12" x2="21" y2="12"/><circle cx="3" cy="12" r="1.8" fill="currentColor"/><circle cx="21" cy="12" r="1.8" fill="currentColor"/><circle cx="11" cy="12" r="2.6" fill="currentColor"/></svg>Деление
|
||||
</button>
|
||||
<button class="st-tool-btn" id="stereo-dragpt-btn" onclick="stereoDragPointMode(this)" title="Перетаскивать построенные точки мышью (в плоскости экрана)">
|
||||
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3" fill="currentColor"/><path d="M12 3v3M12 18v3M3 12h3M18 12h3"/></svg>Тащить
|
||||
</button>
|
||||
</div>
|
||||
<div style="display:flex;align-items:center;gap:5px;margin-top:4px;font-size:.72rem;color:rgba(255,255,255,.55)">
|
||||
<span>m</span>
|
||||
<input id="st-div-m" type="number" min="0" step="1" value="1" oninput="stereoDivideRatio()" style="width:40px;background:#1a1030;color:#f0e8ff;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:3px 4px;font-size:.72rem">
|
||||
<span>:</span>
|
||||
<input id="st-div-n" type="number" min="0" step="1" value="1" oninput="stereoDivideRatio()" style="width:40px;background:#1a1030;color:#f0e8ff;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:3px 4px;font-size:.72rem">
|
||||
<span>n</span><span style="opacity:.55">(AM:MB)</span>
|
||||
</div>
|
||||
<div style="display:flex;align-items:center;gap:4px;margin-top:4px">
|
||||
<input id="st-pt-x" type="number" step="0.5" value="0" title="x" style="width:42px;background:#1a1030;color:#f0e8ff;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:3px 4px;font-size:.72rem">
|
||||
<input id="st-pt-y" type="number" step="0.5" value="0" title="y" style="width:42px;background:#1a1030;color:#f0e8ff;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:3px 4px;font-size:.72rem">
|
||||
<input id="st-pt-z" type="number" step="0.5" value="0" title="z" style="width:42px;background:#1a1030;color:#f0e8ff;border:1px solid rgba(255,255,255,.12);border-radius:6px;padding:3px 4px;font-size:.72rem">
|
||||
<button class="st-action-btn" onclick="stereoAddCoordPoint()" style="flex:1" title="Поставить точку по координатам">Точка (x,y,z)</button>
|
||||
</div>
|
||||
<div class="st-action-grid" style="margin-top:3px">
|
||||
<button class="st-action-btn" onclick="stereoConstructHistUndo()" title="Отменить (Ctrl+Z)">Отменить</button>
|
||||
<button class="st-action-btn" onclick="stereoConstructHistRedo()" title="Вернуть (Ctrl+Shift+Z)">Вернуть</button>
|
||||
|
||||
Reference in New Issue
Block a user