editor: improve cabinet resizing and wall alignment (#503)
* Add roof surface placement support for items Items (e.g. solar panels) can now be placed on sloped roof surfaces. The placement system computes euler rotation from the roof surface normal so items sit flush on the slope instead of going inside. - Add roofStrategy to placement-strategies with enter/move/click/leave - Wire roof:enter/move/click/leave events in the placement coordinator - Add calculateRoofRotation in placement-math using surface normals - Support full 3D cursor rotation for sloped surfaces - Items on roofs are parented to the level with world-space rotation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fixed conflict * fix wall treatment miter geometry * fix cabinet group resizing and corner alignment * fix cabinet corner depth resizing * fix(cabinet): stabilize modular preset changes * fix(cabinet): stabilize corner resizing and wall alignment * fix(nodes): stabilize wall cabinet depth resizing * fix(editor): hide cabinet arrows for module selection * feat(cabinet): add individual width resize handles * feat(cabinet): improve wall cabinet editing * fix(cabinet): harden wall cabinet resizing * fix(cabinet): correct wall drag and depth handles * fix(cabinet): refine individual depth resizing * fix(cabinet): preserve context-aware corner depth behavior * fix(editor): respect snapping modes for resize handles * fix(editor): harden cabinet resize interactions --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Aymeric Rabot <aymeric.rabot@gmail.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
Aymeric Rabot
parent
c0a5db935e
commit
6cc10c929e
@@ -64,3 +64,17 @@ describe('wall mitering miter limit', () => {
|
||||
expect(startSideX).toBeGreaterThan(-0.5)
|
||||
})
|
||||
})
|
||||
|
||||
describe('wall miter boundary sides', () => {
|
||||
test('keeps left and right on the same physical face at both free endpoints', () => {
|
||||
const node = wall('A', [0, 0], [3, 0])
|
||||
const boundary = getWallMiterBoundaryPoints(node, calculateLevelMiters([node]))
|
||||
expect(boundary).not.toBeNull()
|
||||
if (!boundary) throw new Error('expected miter boundary points')
|
||||
|
||||
expect(boundary.startLeft.y).toBeCloseTo(0.05)
|
||||
expect(boundary.endLeft.y).toBeCloseTo(0.05)
|
||||
expect(boundary.startRight.y).toBeCloseTo(-0.05)
|
||||
expect(boundary.endRight.y).toBeCloseTo(-0.05)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -178,11 +178,8 @@ function getWallBoundaryFrame(wall: WallNode, endType: 'start' | 'end') {
|
||||
endType === 'start'
|
||||
? { x: wall.start[0], y: wall.start[1] }
|
||||
: { x: wall.end[0], y: wall.end[1] }
|
||||
const vector =
|
||||
endType === 'start'
|
||||
? { x: wall.end[0] - wall.start[0], y: wall.end[1] - wall.start[1] }
|
||||
: { x: wall.start[0] - wall.end[0], y: wall.start[1] - wall.end[1] }
|
||||
const length = Math.hypot(vector.x, vector.y)
|
||||
const direction = { x: wall.end[0] - wall.start[0], y: wall.end[1] - wall.start[1] }
|
||||
const length = Math.hypot(direction.x, direction.y)
|
||||
|
||||
if (length < 1e-9) {
|
||||
return {
|
||||
@@ -194,8 +191,11 @@ function getWallBoundaryFrame(wall: WallNode, endType: 'start' | 'end') {
|
||||
|
||||
return {
|
||||
point,
|
||||
tangent: { x: vector.x / length, y: vector.y / length },
|
||||
normal: { x: -vector.y / length, y: vector.x / length },
|
||||
tangent:
|
||||
endType === 'start'
|
||||
? { x: direction.x / length, y: direction.y / length }
|
||||
: { x: -direction.x / length, y: -direction.y / length },
|
||||
normal: { x: -direction.y / length, y: direction.x / length },
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user