24 lines
845 B
TypeScript
24 lines
845 B
TypeScript
import dedent from 'dedent'
|
|
import { z } from 'zod'
|
|
import { BaseNode, nodeType, objectId } from '../base'
|
|
import { MaterialSchema } from '../material'
|
|
|
|
export const SlabNode = BaseNode.extend({
|
|
id: objectId('slab'),
|
|
type: nodeType('slab'),
|
|
material: MaterialSchema.optional(),
|
|
polygon: z.array(z.tuple([z.number(), z.number()])),
|
|
holes: z.array(z.array(z.tuple([z.number(), z.number()]))).default([]),
|
|
elevation: z.number().default(0.05), // Elevation in meters
|
|
autoFromWalls: z.boolean().default(false),
|
|
}).describe(
|
|
dedent`
|
|
Slab node - used to represent a slab/floor in the building
|
|
- polygon: array of [x, z] points defining the slab boundary
|
|
- elevation: elevation in meters
|
|
- autoFromWalls: whether the slab is automatically generated from a closed wall loop
|
|
`,
|
|
)
|
|
|
|
export type SlabNode = z.infer<typeof SlabNode>
|