Add procedural support column variants

This commit is contained in:
sudhir
2026-05-08 12:54:59 +05:30
parent e348ccdb08
commit 53393b7def
8 changed files with 2461 additions and 730 deletions
+1
View File
@@ -39,6 +39,7 @@ export {
ColumnShaftDetail,
ColumnShaftProfile,
ColumnStyle,
ColumnSupportStyle,
} from './nodes/column'
export { DoorNode, DoorSegment } from './nodes/door'
export { FenceBaseStyle, FenceNode, FenceStyle } from './nodes/fence'
+582
View File
@@ -56,6 +56,20 @@ export const ColumnRingPlacement = z.enum(['ends', 'even', 'top', 'bottom'])
export const ColumnCarvingPlacement = z.enum(['shaft', 'base', 'capital', 'all'])
export const ColumnSupportStyle = z.enum([
'vertical',
'a-frame',
'y-frame',
'v-frame',
'x-brace',
'k-brace',
'single-strut',
'tripod',
'trestle',
'portal-frame',
'box-frame',
])
export type ColumnStyle = z.infer<typeof ColumnStyle>
export type ColumnCrossSection = z.infer<typeof ColumnCrossSection>
export type ColumnShaftProfile = z.infer<typeof ColumnShaftProfile>
@@ -65,6 +79,7 @@ export type ColumnBaseStyle = z.infer<typeof ColumnBaseStyle>
export type ColumnCapitalStyle = z.infer<typeof ColumnCapitalStyle>
export type ColumnRingPlacement = z.infer<typeof ColumnRingPlacement>
export type ColumnCarvingPlacement = z.infer<typeof ColumnCarvingPlacement>
export type ColumnSupportStyle = z.infer<typeof ColumnSupportStyle>
export const ColumnNode = BaseNode.extend({
id: objectId('column'),
@@ -136,6 +151,12 @@ export const ColumnNode = BaseNode.extend({
lowerBandCarvingLevel: z.number().int().min(0).max(4).default(0),
dentilCount: z.number().int().min(0).max(48).default(0),
beadCount: z.number().int().min(0).max(64).default(0),
supportStyle: ColumnSupportStyle.default('vertical'),
braceWidth: z.number().positive().default(0.16),
braceDepth: z.number().positive().default(0.16),
braceBottomSpread: z.number().min(0.2).default(1.2),
braceTopSpread: z.number().min(0).default(0.12),
bracePlateEnabled: z.boolean().default(true),
material: MaterialSchema.optional(),
materialPreset: z.string().optional(),
}).describe(dedent`
@@ -150,6 +171,7 @@ export const ColumnNode = BaseNode.extend({
- baseStyle/capitalStyle: procedural base and top treatment with tier/detail controls
- baseHeight/capitalHeight: bottom and top block proportions
- ring/flute/spiral/panel/lathe/carving fields: procedural detail controls
- supportStyle/brace fields: vertical column or procedural support assembly
`)
export const COLUMN_PRESETS = {
@@ -403,6 +425,566 @@ export const COLUMN_PRESETS = {
dentilCount: 0,
beadCount: 0,
},
aFrameSupport: {
label: 'A-Frame Support',
supportStyle: 'a-frame',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.08,
width: 0.16,
depth: 0.16,
edgeSoftness: 0.012,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.012,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.16,
braceDepth: 0.16,
braceBottomSpread: 1.2,
braceTopSpread: 0.06,
bracePlateEnabled: false,
},
yFrameSupport: {
label: 'Y Support',
supportStyle: 'y-frame',
style: 'faceted',
crossSection: 'rectangular',
height: 2.7,
radius: 0.08,
width: 0.16,
depth: 0.16,
edgeSoftness: 0.012,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.012,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.16,
braceDepth: 0.16,
braceBottomSpread: 0.2,
braceTopSpread: 1,
bracePlateEnabled: false,
},
vFrameSupport: {
label: 'V Support',
supportStyle: 'v-frame',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.08,
width: 0.16,
depth: 0.16,
edgeSoftness: 0.012,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.012,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.16,
braceDepth: 0.16,
braceBottomSpread: 0.2,
braceTopSpread: 1,
bracePlateEnabled: false,
},
xBraceSupport: {
label: 'X Brace',
supportStyle: 'x-brace',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.07,
width: 0.14,
depth: 0.14,
edgeSoftness: 0.01,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.01,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.14,
braceDepth: 0.14,
braceBottomSpread: 1,
braceTopSpread: 1,
bracePlateEnabled: false,
},
kBraceSupport: {
label: 'K Brace',
supportStyle: 'k-brace',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.07,
width: 0.14,
depth: 0.14,
edgeSoftness: 0.01,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.01,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.14,
braceDepth: 0.14,
braceBottomSpread: 1,
braceTopSpread: 1,
bracePlateEnabled: false,
},
singleStrutSupport: {
label: 'Single Strut',
supportStyle: 'single-strut',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.07,
width: 0.14,
depth: 0.14,
edgeSoftness: 0.01,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.01,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.14,
braceDepth: 0.14,
braceBottomSpread: 1,
braceTopSpread: 1,
bracePlateEnabled: false,
},
tripodSupport: {
label: 'Tripod Support',
supportStyle: 'tripod',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.07,
width: 0.14,
depth: 0.14,
edgeSoftness: 0.01,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.01,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.14,
braceDepth: 0.14,
braceBottomSpread: 1.1,
braceTopSpread: 1.1,
bracePlateEnabled: false,
},
trestleSupport: {
label: 'Trestle Frame',
supportStyle: 'trestle',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.07,
width: 0.14,
depth: 0.14,
edgeSoftness: 0.01,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.01,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.14,
braceDepth: 0.14,
braceBottomSpread: 1.2,
braceTopSpread: 1,
bracePlateEnabled: false,
},
portalFrameSupport: {
label: 'Portal Frame',
supportStyle: 'portal-frame',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.08,
width: 0.16,
depth: 0.16,
edgeSoftness: 0.012,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.012,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.16,
braceDepth: 0.16,
braceBottomSpread: 1.4,
braceTopSpread: 0.2,
bracePlateEnabled: false,
},
boxFrameSupport: {
label: 'Box Frame',
supportStyle: 'box-frame',
style: 'faceted',
crossSection: 'rectangular',
height: 2.6,
radius: 0.07,
width: 0.14,
depth: 0.14,
edgeSoftness: 0.01,
baseHeight: 0,
capitalHeight: 0,
shaftProfile: 'straight',
shaftTaper: 0,
shaftBulge: 0,
shaftStartScale: 1,
shaftEndScale: 1,
shaftSegmentCount: 1,
shaftTwistStep: 0,
shaftCornerRadius: 0.01,
shaftDetail: 'none',
baseStyle: 'none',
baseWidthScale: 1,
baseDepthScale: 1,
baseTierCount: 1,
baseStepSpread: 0.34,
basePlinthHeightRatio: 0.44,
baseRoundBandScale: 0.92,
baseNeckScale: 0.72,
baseRoundBandCount: 0,
baseRibCount: 0,
baseCarvingLevel: 0,
capitalStyle: 'none',
capitalWidthScale: 1,
capitalDepthScale: 1,
capitalTierCount: 1,
capitalStepSpread: 0.34,
capitalBandCount: 0,
capitalCarvingLevel: 0,
ringCount: 0,
ringSpread: 0.16,
fluteCount: 0,
spiralTwist: 0,
spiralRibCount: 0,
panelCount: 0,
latheRingCount: 0,
carvingLevel: 0,
lowerBandEnabled: false,
dentilCount: 0,
beadCount: 0,
braceWidth: 0.14,
braceDepth: 0.14,
braceBottomSpread: 1.4,
braceTopSpread: 1,
bracePlateEnabled: false,
},
} as const satisfies Record<string, { label: string } & Partial<z.input<typeof ColumnNode>>>
export type ColumnPresetId = keyof typeof COLUMN_PRESETS
+2
View File
@@ -23,6 +23,7 @@ export const FenceNode = BaseNode.extend({
groundClearance: z.number().default(0),
edgeInset: z.number().default(0.015),
baseStyle: FenceBaseStyle.default('grounded'),
showInfill: z.boolean().default(true),
color: z.string().default('#ffffff'),
style: FenceStyle.default('slat'),
}).describe(
@@ -33,6 +34,7 @@ export const FenceNode = BaseNode.extend({
- height/thickness: overall fence dimensions in meters
- baseHeight/postSpacing/postSize/topRailHeight: exact geometric controls from the plan3D fence model
- groundClearance/edgeInset/baseStyle: fence support and inset configuration
- showInfill: whether to draw intermediate posts/slats between end posts
- color/style: visual appearance options
`,
)