Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
b8f8d8c
Draft the design for warp handles, feathering and grid contrast
nimerix Nov 18, 2026
f03b75f
Revise the warp handles design after review
nimerix Nov 18, 2026
546ba27
Add a logarithmic slider and a part size helper for Warp
nimerix Nov 18, 2026
96bceef
Feather a painted warp region's edge into the surface around it
nimerix Nov 18, 2026
3e1c2dc
Add a Feather edge option to the Warp region stage
nimerix Nov 18, 2026
aff742f
Give Warp its own brush radius, fitted to the part
nimerix Nov 18, 2026
9090380
Draw the warp grid with a dark core and light casing, lifted over curves
nimerix Nov 18, 2026
6684150
Keep feathered warp drags as fast as unfeathered ones
nimerix Nov 18, 2026
3ee824e
Add soft per-node guides to the warp solver and a handle module for r…
nimerix Nov 18, 2026
5a16533
Make warp control points handles with a radius, falloff and automatic…
nimerix Nov 18, 2026
4b3e8e7
Hold a wider band past a handle's radius and let falloff reach one gr…
nimerix Nov 18, 2026
c0401fc
Add radius, falloff and Distribute points to the warp panel
nimerix Nov 18, 2026
d364c94
Merge the feathered edge into the warp handles branch
nimerix Nov 18, 2026
e98ca99
Draw warp reach dots on a dark base so they show on light parts
nimerix Nov 18, 2026
f9c7171
Benchmark a wide warp handle on a 4000-node grid
nimerix Nov 18, 2026
6c1f54e
Merge handles, radius and automatic points into the warp handles branch
nimerix Nov 18, 2026
92d3161
Keep the feather band to its own surface and short of the last fixed …
nimerix Nov 18, 2026
0e787b1
Decide Close gap facing by the written normal the seam readout uses
nimerix Nov 18, 2026
80044ec
Keep a warp session's feather through density changes and recovery
nimerix Nov 18, 2026
dfba81a
Lay the warp grid on the surface instead of pulling it toward the camera
nimerix Nov 18, 2026
b13a754
Keep Warp's brush radius per part, and step its slider by keyboard
nimerix Nov 18, 2026
7578ddd
Skin warp vertices with linear-precision weights and trapezoid offsets
nimerix Nov 18, 2026
881a6d9
Test feathered warps at six rings and at the default density
nimerix Nov 18, 2026
3f8ae01
Merge the surface-following warp grid and per-part brush radius
nimerix Nov 18, 2026
5ac8a30
Merge the feather fixes and smoother skinning
nimerix Nov 18, 2026
8b0532e
Anchor feathered pieces by a fixed edge, show one feather warning, pi…
nimerix Nov 18, 2026
22a00dc
Merge the feather anchor and warning fixes
nimerix Nov 18, 2026
1ee3ae0
Scope Warp's brush radii to the document and read only radii that wer…
nimerix Nov 18, 2026
995fe2f
Replace the warp handle guide law with bounded terms on shared baselines
nimerix Nov 18, 2026
3ce1fc1
Time the first frame of a warp radius and falloff gesture in the benc…
nimerix Nov 18, 2026
f5fed43
Test warp radius and falloff slider gestures with real browser events
nimerix Nov 18, 2026
8487b13
Let automatic warp pins follow the guides at their nodes
nimerix Nov 18, 2026
1526993
Describe the warp handle law as built in the handles design
nimerix Nov 18, 2026
68d1dfb
Merge the reworked warp handle guides
nimerix Nov 18, 2026
d2945cd
Keep the warp grid on the surface where walks fail and once it bends
nimerix Nov 18, 2026
3880d0c
Draw the warp grid as a thin dark core over a casing that lifts only …
nimerix Nov 18, 2026
7e52a9c
Hold the warp grid to 32,000 points, ordering spine points by bend
nimerix Nov 18, 2026
d97636c
Widen the warp grid's casing to 4 px and lighten it
nimerix Nov 18, 2026
1904be4
Test the warp grid's depth, coverage and contrast as they are drawn
nimerix Nov 18, 2026
470ec55
Add an opt-in benchmark of rendered warp drag frames against the old …
nimerix Nov 18, 2026
616cd67
Describe the surface-following warp grid in the design
nimerix Nov 18, 2026
2adbe34
Test that an opened scene starts Warp's brush fresh, whatever a part'…
nimerix Nov 18, 2026
c40c5a4
Merge the second round of warp grid and brush fixes
nimerix Nov 18, 2026
17f3ace
Let a moved warp handle outrank what shares its nodes
nimerix Nov 18, 2026
84b4ca9
Keep warp handles where they are drawn and bake the preview shown
nimerix Nov 18, 2026
780c880
Carry a feathered band the new paint covers at its written surface
nimerix Nov 18, 2026
62bcbce
Judge Close gap releases from the written surface and keep a laid fea…
nimerix Nov 18, 2026
babcf43
Build each warp handle's footprint by its kind wherever its reach is …
nimerix Nov 18, 2026
e22726b
Keep warp drag frames at their old cost and resume settling after a r…
nimerix Nov 18, 2026
a33ddd6
Hold a moved warp point at priority whatever shares its nodes
nimerix Nov 18, 2026
b958eb2
Describe warp handle priority, settling, take-over and footprints in …
nimerix Nov 18, 2026
95a9dff
Merge the warp session correctness fixes
nimerix Nov 18, 2026
52d5c35
Stop warp folds at their cause: skin maps that stretch and an even grid
nimerix Nov 18, 2026
3b8a2f0
Test first drags and a feathered edge on a dense scan-like surface
nimerix Nov 18, 2026
3cb4974
Keep warp drag frames as cheap as before with skin maps
nimerix Nov 18, 2026
711b0f8
Merge the warp surface quality work
nimerix Nov 18, 2026
008a976
Fit the perspective camera's near and far planes to what it sees
nimerix Nov 18, 2026
5d5084e
Choose the warp grid's points on the bent surface and keep a coarser …
nimerix Nov 18, 2026
f61c9cb
Draw reach dots and seam points after the warp grid, on the surface's…
nimerix Nov 18, 2026
fbebaab
Test the warp grid at overview distance, on bent coarse grids and und…
nimerix Nov 18, 2026
eb4af66
Let the warp grid benchmark time an STL file and wait for a settled grid
nimerix Nov 18, 2026
3d520d8
Describe the warp grid's re-chosen points, coarser nets, depth range …
nimerix Nov 18, 2026
f7e8a52
Find the automatic point and the grid nodes warp tests mean on the ev…
nimerix Nov 18, 2026
bb0fb3c
Weight warp grid edges by their cotangents and refine rotations three…
nimerix Nov 18, 2026
00c4414
Fade a warp handle's bend into a fixed edge its radius reaches
nimerix Nov 18, 2026
0ce87f4
Test that the warp solve models a control point where it is written
nimerix Nov 18, 2026
6dfb71b
Merge the warp grid quality regression fixes
nimerix Nov 18, 2026
fb32e0d
Merge the third round of warp grid fixes
nimerix Nov 18, 2026
82f9f50
Leave the perspective camera's depth range fixed again
nimerix Nov 18, 2026
39c016f
Keep every point a warp grid edge crosses, and choose again only wher…
nimerix Nov 18, 2026
229907a
Carry a warp snapshot to a new grid with the preview's own skinning
nimerix Nov 18, 2026
39147ff
Hold each fragment of a reach dot within two pixels of its tangent plane
nimerix Nov 18, 2026
5c9bcc2
Move only the grid nodes on a line or area handle as one
nimerix Nov 18, 2026
2823f30
Make line and area warp handles from a stroke
nimerix Nov 18, 2026
3f8992b
Stop a warp grab short where the fixed edge or a placed pin holds it,…
nimerix Nov 18, 2026
fb3260a
Describe what the warp grid trace keeps now in its limits and scan-li…
nimerix Nov 18, 2026
1791972
Merge the fourth round of warp grid fixes
nimerix Nov 18, 2026
7304592
Say when the warp surface is still settling, and let Apply wait for i…
nimerix Nov 19, 2026
4ecbe34
Make a warp density change one undo step that restores exactly, and r…
nimerix Nov 19, 2026
795cbd5
Bound the crease a grab makes against a placed pin that must hold, as…
nimerix Nov 19, 2026
2089a03
Draw line and area warp handles on the surface
nimerix Nov 19, 2026
7acb9db
Let go of the warp session the idle settle held when a new grid repla…
nimerix Nov 19, 2026
72b4737
Type the recorded surfaces in the warp settling end-to-end test
nimerix Nov 19, 2026
48a1135
Merge the warp handle review blocker fixes
nimerix Nov 19, 2026
f1d27da
State the stroke sample counts measured on the torso scan
nimerix Nov 19, 2026
d334648
Merge line and area warp handles
nimerix Nov 19, 2026
3ade5fa
Make laying the grid on a changed region one undoable layout step
nimerix Nov 19, 2026
bd29faa
Refuse an area dab that only fixed nodes hold instead of throwing
nimerix Nov 19, 2026
fb3fa6b
Keep only what is left of a line or an area on a smaller region
nimerix Nov 19, 2026
371a40b
Start strokes only on the nearest part and keep their lines off the f…
nimerix Nov 19, 2026
46c0f1e
Draw a few lines from each warp grid node to the outline instead of a…
nimerix Nov 19, 2026
7bfac4c
Let Close gap yield to what the user holds, and name each cause in th…
nimerix Nov 19, 2026
f0815ae
Tie warp grid line weight to cell size on screen
nimerix Nov 19, 2026
7db819b
Test the warp grid's ink budget, visibility floor and border lines
nimerix Nov 19, 2026
1ba18cb
Describe the warp grid's ink rule and border lines in the design
nimerix Nov 19, 2026
1442f0e
Keep line samples where the surface bends away from their chord
nimerix Nov 19, 2026
5a055ee
Merge the warp undo and stroke review fixes
nimerix Nov 19, 2026
d28f55e
Merge the lighter warp grid
nimerix Nov 19, 2026
9eeaa16
Move every bound node with a short line over tight curvature
nimerix Nov 19, 2026
77d8940
Say why Close gap leaves the seam open when it holds back every target
nimerix Nov 19, 2026
12cbec4
Restore the selected handles on undo, and make the new-handle radius …
nimerix Nov 19, 2026
3bc04d4
Keep the feather switch with the session and restore it with its layout
nimerix Nov 19, 2026
12a58fd
Keep the region as painted when the same grid is laid again, as an un…
nimerix Nov 19, 2026
86cff8e
Check the rerouted grid segments show, by an image without them
nimerix Nov 19, 2026
97c32a5
Drive the feather switch and the radius field through undo in the bro…
nimerix Nov 19, 2026
e25287d
Merge the last warp sign-off fixes
nimerix Nov 19, 2026
314ba1a
Move every node a line's drawn path is bound to with the line
nimerix Nov 19, 2026
86774ad
Show the radius and falloff as mixed when the selected points differ
nimerix Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
543 changes: 543 additions & 0 deletions docs/superpowers/specs/2026-11-17-warp-handles-design.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,8 @@ function StatusBar() {
navigationMode = useEditor((s) => (s.temporaryOrbit ? 'orbit' : s.navigationMode)),
indexing = useEditor((s) => s.indexingMeshes > 0),
live = useEditor((s) => s.liveStatus),
warpStage = useEditor((s) => (s.tool === 'warp' ? s.warp?.stage : undefined));
warpStage = useEditor((s) => (s.tool === 'warp' ? s.warp?.stage : undefined)),
warpAdd = useEditor((s) => s.warpAdd);
const hold = useShortcut('holdOrbit'),
cancel = useShortcut('cancel'),
pivot = useShortcut('pivot'),
Expand Down Expand Up @@ -652,7 +653,11 @@ function StatusBar() {
: surfacePainting
? `Drag to paint · Alt erases${smaller || larger ? ` · ${[smaller, larger].filter(Boolean).join(' / ')} brush size` : ''} · ${orbitHint} orbits`
: warpStage === 'warp'
? 'Click the surface to add a control point · Drag a handle to warp · Shift for fine adjustment'
? warpAdd === 'line'
? `Drag on the surface to draw a line · Esc discards it · ${orbitHint} orbits`
: warpAdd === 'area'
? `Drag to paint an area${smaller || larger ? ` · ${[smaller, larger].filter(Boolean).join(' / ')} brush size` : ''} · Esc discards it · ${orbitHint} orbits`
: 'Click the surface to add a control point · Drag a handle to warp · Shift for fine adjustment'
: warpStage
? `Paint the area to warp, or choose Whole part · Alt erases · ${orbitHint} orbits`
: tool === 'align'
Expand Down
53 changes: 38 additions & 15 deletions src/components/SurfaceBrushControls.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import { Eraser, Paintbrush, Undo2 } from 'lucide-react';
import { useEditor } from '../core/store';
import { NumericInput } from './ui';
import { LogRangeInput, NumericInput } from './ui';

export function SurfaceBrushControls() {
const radius = useEditor((state) => state.brushRadius),
type EditorState = ReturnType<typeof useEditor.getState>;

/** With `fitted`, the radius is the caller's and the slider is logarithmic over its range. */
export function SurfaceBrushControls({
fitted,
}: {
fitted?: {
radius: (state: EditorState) => number;
range: { min: number; max: number };
set: (radius: number) => void;
};
} = {}) {
const radius = useEditor((state) => (fitted ? fitted.radius(state) : state.brushRadius)),
setRadius = fitted?.set ?? ((radius: number) => useEditor.getState().setBrush({ radius })),
erase = useEditor((state) => state.brushErase),
history = useEditor((state) => state.paintHistory),
plane = useEditor((state) => state.brushPlane);
Expand Down Expand Up @@ -40,21 +52,32 @@ export function SurfaceBrushControls() {
value={radius}
min={0.05}
max={100}
step={0.5}
onCommit={(value) => useEditor.getState().setBrush({ radius: value })}
step={fitted ? 0.1 : 0.5}
onCommit={setRadius}
/>
<small>mm</small>
</label>
<input
className="brush-radius-slider"
aria-label="Brush radius slider"
type="range"
min={0.1}
max={20}
step={0.1}
value={Math.min(radius, 20)}
onChange={(event) => useEditor.getState().setBrush({ radius: Number(event.target.value) })}
/>
{fitted ? (
<LogRangeInput
className="brush-radius-slider"
label="Brush radius slider"
value={radius}
min={fitted.range.min}
max={fitted.range.max}
onChange={setRadius}
/>
) : (
<input
className="brush-radius-slider"
aria-label="Brush radius slider"
type="range"
min={0.1}
max={20}
step={0.1}
value={Math.min(radius, 20)}
onChange={(event) => setRadius(Number(event.target.value))}
/>
)}
<div className="plane-brush-settings">
<div className="appearance-row">
<span>Stay on seed plane</span>
Expand Down
22 changes: 14 additions & 8 deletions src/components/SurfacePainter.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useEffect, useMemo } from 'react';
import { DoubleSide, MeshBasicMaterial, Quaternion, Vector3 } from 'three';
import { paintingWarpRegion, useEditor } from '../core/store';
import { paintingWarpArea, paintingWarpRegion, useEditor, warpBrushRadius } from '../core/store';
import { contactColors, patchGeometry } from '../core/surfaces';
import { worldNormal, worldPoint } from '../core/geometry';
import { solveAlignment } from '../core/alignment';
import { partDisplay } from '../core/alignment-visibility';
import type { Part, SurfacePatch, SurfacePoint } from '../core/types';
import { pointAccent } from './WarpStroke';

export const warpRegionColor = '#80cbc4';

Expand Down Expand Up @@ -123,15 +124,18 @@ function FlushPreview() {
}

export function PaintCursor({ part, hit }: { part: Part; hit: SurfacePoint | null }) {
const radius = useEditor((s) => s.brushRadius),
const radius = useEditor((s) =>
paintingWarpRegion(s) || paintingWarpArea(s) ? warpBrushRadius(s) : s.brushRadius,
),
erase = useEditor((s) => s.brushErase),
op = useEditor((s) => s.operation),
tool = useEditor((s) => s.tool),
navigationMode = useEditor((s) => (s.temporaryOrbit ? 'orbit' : s.navigationMode)),
pivotPicking = useEditor((s) => s.pivotPicking);
const warpRegion = useEditor((s) => paintingWarpRegion(s) && s.warp!.partId === part.id);
const warpArea = useEditor((s) => paintingWarpArea(s) && s.warp!.partId === part.id);
const contact = tool === 'align' && op.mode === 'surface' && !!op.activeSurface;
if (!hit || (!contact && !warpRegion) || navigationMode || pivotPicking) return null;
if (!hit || (!contact && !warpRegion && !warpArea) || navigationMode || pivotPicking) return null;
const index = op.surfacePairs.findIndex((pair) => pair.id === op.activeSurface?.pairId);
const normal = worldNormal(part, hit),
position = worldPoint(part, hit).addScaledVector(normal, 0.03);
Expand All @@ -142,11 +146,13 @@ export function PaintCursor({ part, hit }: { part: Part; hit: SurfacePoint | nul
<ringGeometry args={[radius, radius + Math.max(radius * 0.025, 0.035), 64]} />
<meshBasicMaterial
color={
erase
? '#f18c8c'
: warpRegion
? warpRegionColor
: contactColors[index % contactColors.length]
warpArea
? pointAccent
: erase
? '#f18c8c'
: warpRegion
? warpRegionColor
: contactColors[index % contactColors.length]
}
side={DoubleSide}
depthTest={false}
Expand Down
13 changes: 10 additions & 3 deletions src/components/Viewport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
import {
isWarpDragging,
measureDistance,
paintingWarpArea,
paintingWarpRegion,
sceneLighting,
refitWarpTree,
Expand All @@ -66,6 +67,7 @@ import { FreeTransformController, FreeTransformPrompt } from './FreeTransform';
import { CombinedTransform } from './CombinedTransform';
import { ManagedTransformControls } from './ManagedTransformControls';
import { WarpOverlay, shownWarpPreview } from './WarpOverlay';
import { beginWarpStroke, endingWarpStroke, WarpStrokeController } from './WarpStroke';
import { transformSelection } from '../core/transform-selection';
import { referencePlanes, resolvePart } from '../core/references';
import type { Part, SurfacePoint, FitAnchor, SceneDocument, SceneLight } from '../core/types';
Expand Down Expand Up @@ -118,6 +120,7 @@ class ViewportBoundary extends Component<{ children: ReactNode }, { error: strin
const noRaycast = () => {};
// A press on a gizmo handle also reaches whatever lies under it, but it is not a selection click.
let gizmoPressed = false;
const gizmoWasPressed = () => gizmoPressed;

const PartMesh = memo(function PartMesh({
part,
Expand Down Expand Up @@ -244,6 +247,8 @@ const PartMesh = memo(function PartMesh({
state.notify('Reset the exploded view before adding control points.', 'info');
return;
}
// Lines and areas are made by their strokes.
if (state.warpAdd !== 'point') return;
state.addWarpPoint(toSurface(event), event.faceIndex);
return;
}
Expand Down Expand Up @@ -308,13 +313,13 @@ const PartMesh = memo(function PartMesh({
} else if (paintingWarpRegion(state)) {
event.stopPropagation();
state.paintWarpRegion(toSurface(event), event.faceIndex, event.altKey, true);
}
} else if (beginWarpStroke(event, part.id)) event.stopPropagation();
}}
onPointerMove={(event) => {
const state = useEditor.getState();
const contact = state.tool === 'align' && state.operation.mode === 'surface';
if (
(!contact && !paintingWarpRegion(state)) ||
(!contact && !paintingWarpRegion(state) && !paintingWarpArea(state)) ||
state.navigationMode ||
state.temporaryOrbit ||
state.pivotPicking ||
Expand Down Expand Up @@ -357,8 +362,8 @@ const PartMesh = memo(function PartMesh({
wireframe={!inspecting && !ghost && wireframe}
emissive={selected && !inspecting && !ghost ? '#c77c39' : '#000000'}
emissiveIntensity={selected && !ghost ? 0.12 : 0}
// A constant, not slope-scaled, offset: a steep surface must still hide what it covers.
polygonOffset={warping}
polygonOffsetFactor={warping ? 1 : 0}
polygonOffsetUnits={warping ? 1 : 0}
/>
{selected &&
Expand Down Expand Up @@ -1143,6 +1148,7 @@ function Scene({
}}
pressed={() => gizmoPressed}
/>
<WarpStrokeController pressed={gizmoWasPressed} />
<PinOverlay />
<LightHandles />
<AssemblyAnnotations />
Expand Down Expand Up @@ -1259,6 +1265,7 @@ export function Viewport() {
event.type !== 'click' ||
event.button !== 0 ||
gizmoPressed ||
endingWarpStroke() ||
state.temporaryOrbit ||
state.navigationMode ||
state.pivotPicking ||
Expand Down
Loading
Loading