Enable pillar duplication in floating action menu

This commit is contained in:
sudhir
2026-05-04 22:54:52 +05:30
parent 848529acb0
commit db765f1eb3
4 changed files with 577 additions and 169 deletions
@@ -4,6 +4,7 @@ import {
type AnyNode,
type AnyNodeId,
type CeilingNode,
ColumnNode,
DoorNode,
FenceNode,
generateId,
@@ -262,6 +263,8 @@ export function FloatingActionMenu() {
duplicate = WindowNode.parse(duplicateInfo)
} else if (node.type === 'item') {
duplicate = ItemNode.parse(duplicateInfo)
} else if (node.type === 'column') {
duplicate = ColumnNode.parse(duplicateInfo)
} else if (node.type === 'wall') {
duplicate = WallNode.parse(duplicateInfo)
} else if (node.type === 'fence') {
@@ -322,6 +325,7 @@ export function FloatingActionMenu() {
}
if (
duplicate.type === 'item' ||
duplicate.type === 'column' ||
duplicate.type === 'wall' ||
duplicate.type === 'fence' ||
duplicate.type === 'window' ||
@@ -425,7 +429,6 @@ export function FloatingActionMenu() {
onDuplicate={
node &&
node.type !== 'spawn' &&
node.type !== 'column' &&
!DELETE_ONLY_TYPES.includes(node.type) &&
!HOLE_TYPES.includes(node.type)
? handleDuplicate
@@ -155,6 +155,7 @@ function shaftProfileUpdates(shaftProfile: ColumnNode['shaftProfile']): Partial<
shaftStartScale: 0.72,
shaftEndScale: 0.72,
shaftSegmentCount: 1,
shaftTwistStep: 0,
}
}
@@ -406,6 +407,34 @@ export function ColumnPanel() {
/>
</>
)}
<SliderControl
label="Segment Twist"
max={90}
min={-90}
onChange={(value) =>
handleUpdate({
shaftTwistStep: value,
...(Math.abs(value) > 0.001 && (node.shaftSegmentCount ?? 1) < 8
? { shaftSegmentCount: 12 }
: {}),
})
}
precision={0}
step={5}
unit="°"
value={node.shaftTwistStep ?? 0}
/>
{Math.abs(node.shaftTwistStep ?? 0) > 0.001 && (
<SliderControl
label="Twist Segments"
max={48}
min={4}
onChange={(value) => handleUpdate({ shaftSegmentCount: Math.round(value) })}
precision={0}
step={1}
value={node.shaftSegmentCount ?? 12}
/>
)}
<SliderControl
label="Ring Pairs"
max={4}