diff --git a/README.md b/README.md index f543a3d..6f7714f 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ You can always find the most up-to-date [API documentation here](https://mod-con ## Data Model +> **Note on Units**: All units decsribing the geometry of prefab elements are expressed in **millimeters (mm)** unless otherwise specified. + ```mermaid erDiagram PrefabElement { diff --git a/src/types/common/boundingBoxSchema.ts b/src/types/common/boundingBoxSchema.ts index a42c181..b1b1315 100644 --- a/src/types/common/boundingBoxSchema.ts +++ b/src/types/common/boundingBoxSchema.ts @@ -1,12 +1,19 @@ import { z } from "zod"; -const BoundingBoxSchema = z.object({ - width: z.number().gt(0, "Width must be greater than 0"), - height: z.number().gt(0, "Height must be greater than 0"), - depth: z.number().gt(0, "Depth must be greater than 0") +const BoundingBoxSchema = z.object({ + max: z.tuple([ + z.number().positive(), + z.number().positive(), + z.number().positive() + ]).describe("Maximum corner in millimeters and defined in the local coordianate system"), + }).openapi({ - description: "The bounding box of an element in millimeters.", + description: "Local bounding box aligned to element's own axes, origin at (0,0,0). Dimensions in millimeters." }); type BoundingBox = z.infer; -export { BoundingBoxSchema, BoundingBox }; \ No newline at end of file + +export { + BoundingBoxSchema, + BoundingBox, +}; \ No newline at end of file diff --git a/src/types/common/dimensionalAttributesSchema.ts b/src/types/common/dimensionalAttributesSchema.ts index eecb412..d96e5a7 100644 --- a/src/types/common/dimensionalAttributesSchema.ts +++ b/src/types/common/dimensionalAttributesSchema.ts @@ -2,9 +2,18 @@ import { z } from "zod"; import { RangeSchema } from "./rangeSchema"; const DimensionalAttributesSchema = z.object({ - width: RangeSchema, - height: RangeSchema, - length: RangeSchema + length: RangeSchema.describe("Primary dimension along the longest horizontal axis of the element. Used for linear elements like beams, walls, and slabs."), + width: RangeSchema.describe("Secondary horizontal dimension perpendicular to length. Used for planar elements like slabs, walls, and panels."), + height: RangeSchema.describe("Vertical dimension. Defines the elevation of elements like walls and columns."), + depth: RangeSchema.describe("Cross-sectional dimension of structural members like beams and columns."), + thickness: RangeSchema.describe("Smallest dimension of planar elements such as walls, slabs, or panels. Represents the cross-sectional depth."), + radius: RangeSchema.describe("Radius of circular or cylindrical elements like columns, piles, or pipes."), +}).openapi({ + description: + "Dimensional attributes defining the physical size of prefab elements. " + + "All dimensions are optional and dependent on element type. " + + "All measurements are in millimeters (mm). " + + "Ranges represent manufacturing constraints.", }); type DimensionalAttributes = z.infer; diff --git a/src/types/common/enums.ts b/src/types/common/enums.ts index 6f2792e..edfae4c 100644 --- a/src/types/common/enums.ts +++ b/src/types/common/enums.ts @@ -60,6 +60,7 @@ const BuildingSystemEnum = z "Plants", "Roofs", "Stairs", + "Structure", ]) .openapi({ description: @@ -77,9 +78,12 @@ const ProductCategoryEnum = z "Insulated Concrete Panels", "Prefabricated Balcony", "Pod", + "Structural Beam", + "Structural Column", "Whole Building System", "Structural Frame", "Facade System", + "Curtain Wall", "Hollowcore Floor", "Concrete Lattice Floor", "Floor Cassettes", diff --git a/src/types/common/productCategorySchema.ts b/src/types/common/productCategorySchema.ts index af04a8e..5fe13e8 100644 --- a/src/types/common/productCategorySchema.ts +++ b/src/types/common/productCategorySchema.ts @@ -1,34 +1,40 @@ import { z } from "zod"; -import { BuildingSystemEnum, ProductCategoryEnum } from "./enums"; +import { BuildingSystemEnum, ProductCategoryEnum,IfcBuildingElementEnum } from "./enums"; // Temporary schema for values const RawProductCategorySchema = z.object({ category: ProductCategoryEnum, - buildingSystem: BuildingSystemEnum + buildingSystem: BuildingSystemEnum, + ifcCompatibleElements: z + .array(IfcBuildingElementEnum) + .optional(), }); const productCategoryValues: z.infer[] = [ - { category: "Boarding", buildingSystem: "Wall" }, - { category: "Solid Wall Panels", buildingSystem: "Wall" }, - { category: "Closed Wall Panels", buildingSystem: "Wall" }, - { category: "Twinwall", buildingSystem: "Wall" }, - { category: "Open Wall Panels", buildingSystem: "Wall" }, - { category: "Structural Insulated Panels (SIPs)", buildingSystem: "Wall" }, - { category: "Insulated Concrete Panels", buildingSystem: "Wall" }, - { category: "Whole Building System", buildingSystem: "Frame" }, - { category: "Structural Frame", buildingSystem: "Frame" }, - { category: "Hollowcore Floor", buildingSystem: "Floors" }, - { category: "Concrete Lattice Floor", buildingSystem: "Floors" }, - { category: "Floor Cassettes", buildingSystem: "Floors" }, - { category: "Solid Floor Panels", buildingSystem: "Floors" }, - { category: "Roof Panel", buildingSystem: "Roofs" }, - { category: "Roof Truss", buildingSystem: "Roofs" }, - { category: "Prefabricated Balcony", buildingSystem: "Balcony" }, - { category: "Pod", buildingSystem: "Pod" }, - { category: "Facade System", buildingSystem: "Facade" }, - { category: "Volumetric module", buildingSystem: "Modules" }, - { category: "Prefabricated Plant", buildingSystem: "Plants" }, - { category: "Prefabricated Stairs", buildingSystem: "Stairs" }, + { category: "Boarding", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcWallStandardCase","IfcBuildingElementProxy"] }, + { category: "Solid Wall Panels", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcWallStandardCase","IfcBuildingElementProxy"] }, + { category: "Closed Wall Panels", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcWallStandardCase","IfcBuildingElementProxy"] }, + { category: "Twinwall", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcWallStandardCase","IfcBuildingElementProxy"] }, + { category: "Open Wall Panels", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcWallStandardCase","IfcBuildingElementProxy"] }, + { category: "Structural Insulated Panels (SIPs)", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcWallStandardCase","IfcBuildingElementProxy"] }, + { category: "Insulated Concrete Panels", buildingSystem: "Wall", ifcCompatibleElements: ["IfcWall","IfcWallStandardCase","IfcBuildingElementProxy"] }, + { category: "Whole Building System", buildingSystem: "Frame", ifcCompatibleElements: ["IfcBuildingElementProxy","IfcWall","IfcWallStandardCase","IfcSlab","IfcRoof","IfcColumn","IfcBeam"] }, + { category: "Structural Frame", buildingSystem: "Frame", ifcCompatibleElements: ["IfcBuildingElementProxy","IfcColumn","IfcBeam","IfcMember"] }, + { category: "Hollowcore Floor", buildingSystem: "Floors", ifcCompatibleElements: ["IfcSlab","IfcBuildingElementProxy"] }, + { category: "Concrete Lattice Floor", buildingSystem: "Floors", ifcCompatibleElements: ["IfcSlab","IfcBuildingElementProxy"] }, + { category: "Floor Cassettes", buildingSystem: "Floors", ifcCompatibleElements: ["IfcSlab","IfcBuildingElementProxy"] }, + { category: "Solid Floor Panels", buildingSystem: "Floors", ifcCompatibleElements: ["IfcSlab","IfcBuildingElementProxy"] }, + { category: "Roof Panel", buildingSystem: "Roofs", ifcCompatibleElements: ["IfcRoof","IfcBuildingElementProxy","IfcCovering"] }, + { category: "Roof Truss", buildingSystem: "Roofs", ifcCompatibleElements: ["IfcRoof","IfcBuildingElementProxy","IfcBeam"] }, + { category: "Prefabricated Balcony", buildingSystem: "Balcony", ifcCompatibleElements: ["IfcBuildingElementProxy","IfcSlab"] }, + { category: "Pod", buildingSystem: "Pod", ifcCompatibleElements: ["IfcBuildingElementProxy"] }, + { category: "Facade System", buildingSystem: "Facade", ifcCompatibleElements: ["IfcCurtainWall","IfcBuildingElementProxy","IfcWall","IfcWallStandardCase"] }, + { category: "Curtain Wall", buildingSystem: "Facade", ifcCompatibleElements: ["IfcCurtainWall","IfcBuildingElementProxy","IfcWall","IfcWallStandardCase"] }, + { category: "Volumetric module", buildingSystem: "Modules", ifcCompatibleElements: ["IfcBuildingElementProxy","IfcWall","IfcWallStandardCase","IfcSlab","IfcRoof"] }, + { category: "Prefabricated Plant", buildingSystem: "Plants", ifcCompatibleElements: ["IfcBuildingElementProxy"] }, + { category: "Prefabricated Stairs", buildingSystem: "Stairs", ifcCompatibleElements: ["IfcStair","IfcBuildingElementProxy","IfcRamp"] }, + { category: "Structural Beam", buildingSystem: "Structure", ifcCompatibleElements: ["IfcBeam", "IfcMember","IfcBuildingElementProxy"] }, + { category: "Structural Column", buildingSystem: "Structure", ifcCompatibleElements: ["IfcColumn", "IfcMember","IfcBuildingElementProxy"] }, ]; const ProductCategorySchema = RawProductCategorySchema.refine( diff --git a/src/types/entities/prefabElementSchema.ts b/src/types/entities/prefabElementSchema.ts index aa3da33..02c9abf 100644 --- a/src/types/entities/prefabElementSchema.ts +++ b/src/types/entities/prefabElementSchema.ts @@ -49,9 +49,9 @@ const PrefabElementSchema = z.object({ example: "This CLT wall panel is suitable for multi-story residential buildings and meets fire resistance standards." }), boundingBox: BoundingBoxSchema - .describe("3D bounding dimensions of the prefab element.") + .describe("3D bounding dimensions of the prefab element, located at the Local Origin (0,0,0).") .openapi({ - description: "3D bounding dimensions of the prefab element, defining its spatial envelope." + description: "3D bounding dimensions of the prefab element, located at the local origin (0,0,0)." }), images: z.array(z.string()).min(1, "At least one image is required") .describe("Image URLs of the element")