scans and ref image

This commit is contained in:
wass08
2026-01-29 09:38:24 +09:00
parent a1a0e78384
commit c94f661bf9
20 changed files with 688 additions and 7 deletions
+2
View File
@@ -13,6 +13,8 @@ export { BuildingNode } from './nodes/building'
export { CeilingNode } from './nodes/ceiling'
export { ZoneNode } from './nodes/zone'
export { ScanNode } from './nodes/scan'
export { GuideNode } from './nodes/guide'
export type { AnyNodeId, AnyNodeType } from './types'
// Union types
export { AnyNode } from './types'
+14
View File
@@ -0,0 +1,14 @@
import { z } from 'zod'
import { BaseNode, nodeType, objectId } from '../base'
export const GuideNode = BaseNode.extend({
id: objectId('guide'),
type: nodeType('guide'),
url: z.string(),
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
rotation: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
scale: z.number().default(1),
opacity: z.number().min(0).max(100).default(50),
})
export type GuideNode = z.infer<typeof GuideNode>
+3 -1
View File
@@ -2,6 +2,8 @@ import dedent from 'dedent'
import { z } from 'zod'
import { BaseNode, nodeType, objectId } from '../base'
import { CeilingNode } from './ceiling'
import { GuideNode } from './guide'
import { ScanNode } from './scan'
import { SlabNode } from './slab'
import { WallNode } from './wall'
import { ZoneNode } from './zone'
@@ -9,7 +11,7 @@ import { ZoneNode } from './zone'
export const LevelNode = BaseNode.extend({
id: objectId('level'),
type: nodeType('level'),
children: z.array(z.union([WallNode.shape.id, ZoneNode.shape.id, SlabNode.shape.id, CeilingNode.shape.id])).default([]),
children: z.array(z.union([WallNode.shape.id, ZoneNode.shape.id, SlabNode.shape.id, CeilingNode.shape.id, ScanNode.shape.id, GuideNode.shape.id])).default([]),
// Specific props
level: z.number().default(0),
}).describe(
+14
View File
@@ -0,0 +1,14 @@
import { z } from 'zod'
import { BaseNode, nodeType, objectId } from '../base'
export const ScanNode = BaseNode.extend({
id: objectId('scan'),
type: nodeType('scan'),
url: z.string(),
position: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
rotation: z.tuple([z.number(), z.number(), z.number()]).default([0, 0, 0]),
scale: z.number().default(1),
opacity: z.number().min(0).max(100).default(100),
})
export type ScanNode = z.infer<typeof ScanNode>
+4
View File
@@ -1,8 +1,10 @@
import z from 'zod'
import { BuildingNode } from './nodes/building'
import { CeilingNode } from './nodes/ceiling'
import { GuideNode } from './nodes/guide'
import { ItemNode } from './nodes/item'
import { LevelNode } from './nodes/level'
import { ScanNode } from './nodes/scan'
import { SiteNode } from './nodes/site'
import { SlabNode } from './nodes/slab'
import { WallNode } from './nodes/wall'
@@ -17,6 +19,8 @@ export const AnyNode = z.discriminatedUnion('type', [
ZoneNode,
SlabNode,
CeilingNode,
ScanNode,
GuideNode,
])
export type AnyNode = z.infer<typeof AnyNode>