@bitbybit-dev/ifc 0.0.0-stage → 1.5.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +42 -0
  3. package/README.md +92 -2
  4. package/index.d.ts +1 -0
  5. package/index.js +1 -0
  6. package/lib/api/dto-registry.d.ts +8 -0
  7. package/lib/api/dto-registry.js +109 -0
  8. package/lib/api/ifc-service.d.ts +109 -0
  9. package/lib/api/ifc-service.js +55 -0
  10. package/lib/api/inputs/base-inputs.d.ts +5 -0
  11. package/lib/api/inputs/base-inputs.js +5 -0
  12. package/lib/api/inputs/ifc-inputs.d.ts +2727 -0
  13. package/lib/api/inputs/ifc-inputs.js +2498 -0
  14. package/lib/api/inputs/index.d.ts +3 -0
  15. package/lib/api/inputs/index.js +3 -0
  16. package/lib/api/resolved-inputs/index.d.ts +70 -0
  17. package/lib/api/resolved-inputs/index.js +1 -0
  18. package/lib/api/services/assemblies.d.ts +28 -0
  19. package/lib/api/services/assemblies.js +49 -0
  20. package/lib/api/services/beams.d.ts +33 -0
  21. package/lib/api/services/beams.js +59 -0
  22. package/lib/api/services/columns.d.ts +26 -0
  23. package/lib/api/services/columns.js +56 -0
  24. package/lib/api/services/defaults.constants.d.ts +44 -0
  25. package/lib/api/services/defaults.constants.js +44 -0
  26. package/lib/api/services/doors.d.ts +45 -0
  27. package/lib/api/services/doors.js +94 -0
  28. package/lib/api/services/geometry.d.ts +51 -0
  29. package/lib/api/services/geometry.js +87 -0
  30. package/lib/api/services/index.d.ts +17 -0
  31. package/lib/api/services/index.js +17 -0
  32. package/lib/api/services/materials.d.ts +46 -0
  33. package/lib/api/services/materials.js +86 -0
  34. package/lib/api/services/member-support.d.ts +7 -0
  35. package/lib/api/services/member-support.js +29 -0
  36. package/lib/api/services/members.d.ts +24 -0
  37. package/lib/api/services/members.js +51 -0
  38. package/lib/api/services/model.d.ts +244 -0
  39. package/lib/api/services/model.js +409 -0
  40. package/lib/api/services/openings.d.ts +57 -0
  41. package/lib/api/services/openings.js +102 -0
  42. package/lib/api/services/properties.d.ts +89 -0
  43. package/lib/api/services/properties.js +142 -0
  44. package/lib/api/services/quantities.d.ts +38 -0
  45. package/lib/api/services/quantities.js +51 -0
  46. package/lib/api/services/roofs.d.ts +24 -0
  47. package/lib/api/services/roofs.js +52 -0
  48. package/lib/api/services/service-support.d.ts +8 -0
  49. package/lib/api/services/service-support.js +37 -0
  50. package/lib/api/services/service-types.d.ts +3 -0
  51. package/lib/api/services/service-types.js +1 -0
  52. package/lib/api/services/site.d.ts +37 -0
  53. package/lib/api/services/site.js +80 -0
  54. package/lib/api/services/slabs.d.ts +31 -0
  55. package/lib/api/services/slabs.js +59 -0
  56. package/lib/api/services/spaces.d.ts +36 -0
  57. package/lib/api/services/spaces.js +64 -0
  58. package/lib/api/services/spatial.d.ts +54 -0
  59. package/lib/api/services/spatial.js +75 -0
  60. package/lib/api/services/walls.d.ts +140 -0
  61. package/lib/api/services/walls.js +268 -0
  62. package/lib/api/services/windows.d.ts +46 -0
  63. package/lib/api/services/windows.js +76 -0
  64. package/lib/build/assemblies.d.ts +4 -0
  65. package/lib/build/assemblies.js +45 -0
  66. package/lib/build/build-types.d.ts +345 -0
  67. package/lib/build/build-types.js +1 -0
  68. package/lib/build/checks.d.ts +6 -0
  69. package/lib/build/checks.js +32 -0
  70. package/lib/build/constants.d.ts +27 -0
  71. package/lib/build/constants.js +43 -0
  72. package/lib/build/contexts.d.ts +9 -0
  73. package/lib/build/contexts.js +52 -0
  74. package/lib/build/curves.d.ts +3 -0
  75. package/lib/build/curves.js +23 -0
  76. package/lib/build/entity-writer.d.ts +23 -0
  77. package/lib/build/entity-writer.js +97 -0
  78. package/lib/build/fillings.d.ts +7 -0
  79. package/lib/build/fillings.js +182 -0
  80. package/lib/build/georeference.d.ts +5 -0
  81. package/lib/build/georeference.js +44 -0
  82. package/lib/build/materials.d.ts +18 -0
  83. package/lib/build/materials.js +166 -0
  84. package/lib/build/math.d.ts +10 -0
  85. package/lib/build/math.js +47 -0
  86. package/lib/build/measure.d.ts +9 -0
  87. package/lib/build/measure.js +195 -0
  88. package/lib/build/moving.d.ts +4 -0
  89. package/lib/build/moving.js +61 -0
  90. package/lib/build/openings.d.ts +12 -0
  91. package/lib/build/openings.js +156 -0
  92. package/lib/build/outlines.d.ts +4 -0
  93. package/lib/build/outlines.js +40 -0
  94. package/lib/build/placement.d.ts +16 -0
  95. package/lib/build/placement.js +106 -0
  96. package/lib/build/profiles.d.ts +4 -0
  97. package/lib/build/profiles.js +35 -0
  98. package/lib/build/project.d.ts +11 -0
  99. package/lib/build/project.js +134 -0
  100. package/lib/build/properties.d.ts +10 -0
  101. package/lib/build/properties.js +182 -0
  102. package/lib/build/quantities.d.ts +7 -0
  103. package/lib/build/quantities.js +262 -0
  104. package/lib/build/relationships.d.ts +9 -0
  105. package/lib/build/relationships.js +67 -0
  106. package/lib/build/removal.d.ts +3 -0
  107. package/lib/build/removal.js +106 -0
  108. package/lib/build/representations.d.ts +6 -0
  109. package/lib/build/representations.js +46 -0
  110. package/lib/build/roof-clipping.d.ts +5 -0
  111. package/lib/build/roof-clipping.js +79 -0
  112. package/lib/build/roofs.d.ts +4 -0
  113. package/lib/build/roofs.js +131 -0
  114. package/lib/build/site.d.ts +7 -0
  115. package/lib/build/site.js +112 -0
  116. package/lib/build/slab-openings.d.ts +4 -0
  117. package/lib/build/slab-openings.js +71 -0
  118. package/lib/build/slabs-columns-beams.d.ts +8 -0
  119. package/lib/build/slabs-columns-beams.js +73 -0
  120. package/lib/build/solids.d.ts +5 -0
  121. package/lib/build/solids.js +33 -0
  122. package/lib/build/spaces.d.ts +6 -0
  123. package/lib/build/spaces.js +55 -0
  124. package/lib/build/spatial.d.ts +17 -0
  125. package/lib/build/spatial.js +111 -0
  126. package/lib/build/type-objects.d.ts +4 -0
  127. package/lib/build/type-objects.js +9 -0
  128. package/lib/build/wall-edits.d.ts +5 -0
  129. package/lib/build/wall-edits.js +138 -0
  130. package/lib/build/wall-geometry.d.ts +15 -0
  131. package/lib/build/wall-geometry.js +159 -0
  132. package/lib/build/wall-parameters.d.ts +3 -0
  133. package/lib/build/wall-parameters.js +47 -0
  134. package/lib/build/walls.d.ts +12 -0
  135. package/lib/build/walls.js +238 -0
  136. package/lib/geometry/advanced.d.ts +27 -0
  137. package/lib/geometry/advanced.js +292 -0
  138. package/lib/geometry/colours.d.ts +3 -0
  139. package/lib/geometry/colours.js +109 -0
  140. package/lib/geometry/curves.d.ts +32 -0
  141. package/lib/geometry/curves.js +370 -0
  142. package/lib/geometry/edges.constants.d.ts +5 -0
  143. package/lib/geometry/edges.constants.js +5 -0
  144. package/lib/geometry/edges.d.ts +21 -0
  145. package/lib/geometry/edges.js +164 -0
  146. package/lib/geometry/elements.d.ts +3 -0
  147. package/lib/geometry/elements.js +152 -0
  148. package/lib/geometry/errors.d.ts +3 -0
  149. package/lib/geometry/errors.js +6 -0
  150. package/lib/geometry/faceted.d.ts +31 -0
  151. package/lib/geometry/faceted.js +214 -0
  152. package/lib/geometry/geometry-types.d.ts +103 -0
  153. package/lib/geometry/geometry-types.js +1 -0
  154. package/lib/geometry/groups.d.ts +21 -0
  155. package/lib/geometry/groups.js +106 -0
  156. package/lib/geometry/items.d.ts +34 -0
  157. package/lib/geometry/items.js +313 -0
  158. package/lib/geometry/operators.d.ts +3 -0
  159. package/lib/geometry/operators.js +65 -0
  160. package/lib/geometry/profiles.d.ts +4 -0
  161. package/lib/geometry/profiles.js +277 -0
  162. package/lib/geometry/recipe-builder.d.ts +14 -0
  163. package/lib/geometry/recipe-builder.js +48 -0
  164. package/lib/geometry/references.d.ts +4 -0
  165. package/lib/geometry/references.js +17 -0
  166. package/lib/geometry/regions.d.ts +4 -0
  167. package/lib/geometry/regions.js +26 -0
  168. package/lib/geometry/surfaces.constants.d.ts +17 -0
  169. package/lib/geometry/surfaces.constants.js +17 -0
  170. package/lib/geometry/surfaces.d.ts +6 -0
  171. package/lib/geometry/surfaces.js +306 -0
  172. package/lib/geometry/swept-solids.constants.d.ts +7 -0
  173. package/lib/geometry/swept-solids.constants.js +6 -0
  174. package/lib/geometry/swept-solids.d.ts +25 -0
  175. package/lib/geometry/swept-solids.js +243 -0
  176. package/lib/index.d.ts +6 -0
  177. package/lib/index.js +6 -0
  178. package/lib/model/constants.d.ts +30 -0
  179. package/lib/model/constants.js +30 -0
  180. package/lib/model/entity-lookup.d.ts +9 -0
  181. package/lib/model/entity-lookup.js +20 -0
  182. package/lib/model/guid.d.ts +7 -0
  183. package/lib/model/guid.js +60 -0
  184. package/lib/model/id-map.d.ts +10 -0
  185. package/lib/model/id-map.js +80 -0
  186. package/lib/model/index.d.ts +4 -0
  187. package/lib/model/index.js +2 -0
  188. package/lib/model/io.d.ts +6 -0
  189. package/lib/model/io.js +136 -0
  190. package/lib/model/is-model.d.ts +9 -0
  191. package/lib/model/is-model.js +11 -0
  192. package/lib/model/model-types.d.ts +111 -0
  193. package/lib/model/model-types.js +1 -0
  194. package/lib/model/overlay-indexes.d.ts +17 -0
  195. package/lib/model/overlay-indexes.js +69 -0
  196. package/lib/model/references.d.ts +2 -0
  197. package/lib/model/references.js +51 -0
  198. package/lib/model/rows-by-id.d.ts +8 -0
  199. package/lib/model/rows-by-id.js +39 -0
  200. package/lib/model/snapshot.d.ts +36 -0
  201. package/lib/model/snapshot.js +144 -0
  202. package/lib/model/source.d.ts +29 -0
  203. package/lib/model/source.js +172 -0
  204. package/lib/model/transaction.d.ts +39 -0
  205. package/lib/model/transaction.js +250 -0
  206. package/lib/model/upgrade.d.ts +2 -0
  207. package/lib/model/upgrade.js +78 -0
  208. package/lib/schema/constants.d.ts +3 -0
  209. package/lib/schema/constants.js +3 -0
  210. package/lib/schema/generated/ifc4.d.ts +2 -0
  211. package/lib/schema/generated/ifc4.js +1204 -0
  212. package/lib/schema/generated/ifc4x3.d.ts +2 -0
  213. package/lib/schema/generated/ifc4x3.js +1325 -0
  214. package/lib/schema/registry.d.ts +7 -0
  215. package/lib/schema/registry.js +37 -0
  216. package/lib/schema/schema-types.d.ts +45 -0
  217. package/lib/schema/schema-types.js +1 -0
  218. package/lib/schema/schema.d.ts +23 -0
  219. package/lib/schema/schema.js +136 -0
  220. package/lib/step/constants.d.ts +48 -0
  221. package/lib/step/constants.js +48 -0
  222. package/lib/step/encoder.d.ts +21 -0
  223. package/lib/step/encoder.js +321 -0
  224. package/lib/step/errors.d.ts +39 -0
  225. package/lib/step/errors.js +45 -0
  226. package/lib/step/file-index.d.ts +2 -0
  227. package/lib/step/file-index.js +221 -0
  228. package/lib/step/header.d.ts +4 -0
  229. package/lib/step/header.js +52 -0
  230. package/lib/step/numbers.d.ts +3 -0
  231. package/lib/step/numbers.js +73 -0
  232. package/lib/step/reader.d.ts +2 -0
  233. package/lib/step/reader.js +160 -0
  234. package/lib/step/scanner.d.ts +13 -0
  235. package/lib/step/scanner.js +203 -0
  236. package/lib/step/step-types.d.ts +170 -0
  237. package/lib/step/step-types.js +1 -0
  238. package/lib/step/strings.d.ts +2 -0
  239. package/lib/step/strings.js +150 -0
  240. package/lib/step/values.d.ts +13 -0
  241. package/lib/step/values.js +51 -0
  242. package/package.json +51 -5
@@ -0,0 +1,3 @@
1
+ export * from "./ifc-inputs";
2
+ export * from "./base-inputs";
3
+ export * from "@bitbybit-dev/base/lib/api/inputs";
@@ -0,0 +1,3 @@
1
+ export * from "./ifc-inputs";
2
+ export * from "./base-inputs";
3
+ export * from "@bitbybit-dev/base/lib/api/inputs";
@@ -0,0 +1,70 @@
1
+ import { WithDefaults } from "@bitbybit-dev/base";
2
+ import * as Inputs from "../inputs";
3
+ export * from "@bitbybit-dev/base/lib/api/resolved-inputs";
4
+ /**
5
+ * The IFC inputs DTOs as their defaults leave them: every property with a default is present,
6
+ * the way `resolveDto` hands a DTO to the code that reads it.
7
+ */
8
+ export declare namespace IFC {
9
+ type AddAssemblyDto<T> = WithDefaults<Inputs.IFC.AddAssemblyDto<T>, "predefinedType">;
10
+ type AddBeamDto<T> = WithDefaults<Inputs.IFC.AddBeamDto<T>, "profile" | "rotation">;
11
+ type AddColumnDto<T> = WithDefaults<Inputs.IFC.AddColumnDto<T>, "position" | "baseOffset" | "profile" | "rotation">;
12
+ type AddDoorDto<T> = WithDefaults<Inputs.IFC.AddDoorDto<T>, "sill">;
13
+ type AddDoorTypeDto<T> = WithDefaults<Inputs.IFC.AddDoorTypeDto<T>, "name" | "operation" | "handle">;
14
+ type AddLayerSetDto<T> = WithDefaults<Inputs.IFC.AddLayerSetDto<T>, "name">;
15
+ type AddMaterialDto<T> = WithDefaults<Inputs.IFC.AddMaterialDto<T>, "name" | "transparency">;
16
+ type AddMemberDto<T> = WithDefaults<Inputs.IFC.AddMemberDto<T>, "predefinedType" | "profile" | "rotation">;
17
+ type AddOpeningDto<T> = WithDefaults<Inputs.IFC.AddOpeningDto<T>, "sill">;
18
+ type AddPropertySetDto<T> = WithDefaults<Inputs.IFC.AddPropertySetDto<T>, "name">;
19
+ type AddRoofDto<T> = WithDefaults<Inputs.IFC.AddRoofDto<T>, "kind" | "pitch" | "overhang" | "baseOffset">;
20
+ type AddSlabDto<T> = WithDefaults<Inputs.IFC.AddSlabDto<T>, "topOffset" | "predefinedType">;
21
+ type AddSlabOpeningDto<T> = Inputs.IFC.AddSlabOpeningDto<T>;
22
+ type AddSpaceDto<T> = WithDefaults<Inputs.IFC.AddSpaceDto<T>, "baseOffset" | "predefinedType">;
23
+ type AddStoreyDto<T> = WithDefaults<Inputs.IFC.AddStoreyDto<T>, "name" | "elevation">;
24
+ type AddTerrainDto<T> = WithDefaults<Inputs.IFC.AddTerrainDto<T>, "name" | "elevation">;
25
+ type AddTreeDto<T> = WithDefaults<Inputs.IFC.AddTreeDto<T>, "name" | "species" | "position" | "elevation">;
26
+ type AddWallDto<T> = WithDefaults<Inputs.IFC.AddWallDto<T>, "alignment" | "baseOffset" | "predefinedType">;
27
+ type AddWallTypeDto<T> = WithDefaults<Inputs.IFC.AddWallTypeDto<T>, "name" | "predefinedType">;
28
+ type AddWindowDto<T> = Inputs.IFC.AddWindowDto<T>;
29
+ type AddWindowTypeDto<T> = WithDefaults<Inputs.IFC.AddWindowTypeDto<T>, "name">;
30
+ type ClipWallByRoofDto<T> = Inputs.IFC.ClipWallByRoofDto<T>;
31
+ type ClipWallDto<T> = WithDefaults<Inputs.IFC.ClipWallDto<T>, "normal">;
32
+ type ComputeQuantitiesDto<T> = Inputs.IFC.ComputeQuantitiesDto<T>;
33
+ type ConnectWallsDto<T> = Inputs.IFC.ConnectWallsDto<T>;
34
+ type CreateModelDto = WithDefaults<Inputs.IFC.CreateModelDto, "name" | "siteName" | "buildingName" | "lengthUnit">;
35
+ type EditOpeningDto<T> = Inputs.IFC.EditOpeningDto<T>;
36
+ type EditWallDto<T> = Inputs.IFC.EditWallDto<T>;
37
+ type ElementDto<T> = Inputs.IFC.ElementDto<T>;
38
+ type ElementInfoDto = WithDefaults<Inputs.IFC.ElementInfoDto, "globalId" | "type" | "name" | "storey">;
39
+ type ElementsDto<T> = WithDefaults<Inputs.IFC.ElementsDto<T>, "type">;
40
+ type GeometryDto<T> = WithDefaults<Inputs.IFC.GeometryDto<T>, "groupByClass">;
41
+ type GeometryElementsDto<T> = Inputs.IFC.GeometryElementsDto<T>;
42
+ type GeometryProblemDto = WithDefaults<Inputs.IFC.GeometryProblemDto, "globalId" | "type" | "message">;
43
+ type GeometryToDocumentDto<T> = WithDefaults<Inputs.IFC.GeometryToDocumentDto<T>, "name" | "emptyWhenFailed" | "facetedMeshes" | "maxTriangles" | "groupByClass">;
44
+ type GeometryToShapesDto<T> = WithDefaults<Inputs.IFC.GeometryToShapesDto<T>, "adjustZtoY" | "emptyWhenFailed" | "facetedMeshes" | "maxTriangles">;
45
+ type GeometryToStepDto<T> = WithDefaults<Inputs.IFC.GeometryToStepDto<T>, "name" | "fileName" | "emptyWhenFailed" | "facetedMeshes" | "maxTriangles" | "compress" | "tryDownload" | "groupByClass">;
46
+ type GeoreferenceDto = WithDefaults<Inputs.IFC.GeoreferenceDto, "mapped" | "crs" | "eastings" | "northings" | "orthogonalHeight" | "xAxisAbscissa" | "xAxisOrdinate" | "scale" | "located" | "latitude" | "longitude" | "elevation">;
47
+ type GetAttributeDto<T> = WithDefaults<Inputs.IFC.GetAttributeDto<T>, "attribute">;
48
+ type GlobalIdOfDto<T> = Inputs.IFC.GlobalIdOfDto<T>;
49
+ type MaterialLayerDto = Inputs.IFC.MaterialLayerDto;
50
+ type MemberSharedDto<T> = WithDefaults<Inputs.IFC.MemberSharedDto<T>, "profile" | "rotation">;
51
+ type ModelDto<T> = Inputs.IFC.ModelDto<T>;
52
+ type ModelSummaryDto = WithDefaults<Inputs.IFC.ModelSummaryDto, "schema" | "editable" | "project" | "millimetresPerUnit" | "entities" | "storeys" | "elementCounts">;
53
+ type MoveElementDto<T> = WithDefaults<Inputs.IFC.MoveElementDto<T>, "translation" | "rotation">;
54
+ type PropertyDto = WithDefaults<Inputs.IFC.PropertyDto, "name">;
55
+ type PropertySetInfoDto = WithDefaults<Inputs.IFC.PropertySetInfoDto, "name" | "properties">;
56
+ type QuantitySetInfoDto = WithDefaults<Inputs.IFC.QuantitySetInfoDto, "name" | "quantities">;
57
+ type ReadModelDto = Inputs.IFC.ReadModelDto;
58
+ type RemovePropertySetDto<T> = WithDefaults<Inputs.IFC.RemovePropertySetDto<T>, "name">;
59
+ type RemovePropertyValuesDto<T> = WithDefaults<Inputs.IFC.RemovePropertyValuesDto<T>, "name">;
60
+ type SetAttributeDto<T> = WithDefaults<Inputs.IFC.SetAttributeDto<T>, "attribute">;
61
+ type SetPropertyValuesDto<T> = WithDefaults<Inputs.IFC.SetPropertyValuesDto<T>, "name">;
62
+ type SetStoreyElevationDto<T> = WithDefaults<Inputs.IFC.SetStoreyElevationDto<T>, "elevation">;
63
+ type SpaceInfoDto = WithDefaults<Inputs.IFC.SpaceInfoDto, "globalId" | "name" | "longName" | "storey" | "area" | "height">;
64
+ type SpacesDto<T> = Inputs.IFC.SpacesDto<T>;
65
+ type StoreyInfoDto = WithDefaults<Inputs.IFC.StoreyInfoDto, "globalId" | "name" | "elevation">;
66
+ type WallDto<T> = Inputs.IFC.WallDto<T>;
67
+ type WallJoinInfoDto = WithDefaults<Inputs.IFC.WallJoinInfoDto, "other" | "at" | "otherAt">;
68
+ type WallParametersDto = WithDefaults<Inputs.IFC.WallParametersDto, "globalId" | "name" | "storey" | "start" | "end" | "height" | "baseOffset" | "thickness" | "offset" | "alignment" | "layerSet" | "wallType" | "joins" | "openings" | "clippings">;
69
+ type WriteModelDto<T> = WithDefaults<Inputs.IFC.WriteModelDto<T>, "fileName">;
70
+ }
@@ -0,0 +1 @@
1
+ export * from "@bitbybit-dev/base/lib/api/resolved-inputs";
@@ -0,0 +1,28 @@
1
+ import type { IfcModel } from "../../model/model-types";
2
+ import * as Inputs from "../inputs";
3
+ /**
4
+ * Assemblies: elements made of other elements, such as a facade's cladding boards or a truss's
5
+ * members, which other tools list as one element with its parts and the STEP export of a model
6
+ * nests as one assembly.
7
+ * @beta
8
+ */
9
+ export declare class IFCAssemblies {
10
+ /**
11
+ * Makes elements the parts of a new assembly standing in their storey in their place. The parts
12
+ * keep their geometry and placement and stand in the model through it; removing the assembly
13
+ * removes them.
14
+ *
15
+ * They must share one storey, or other part of the structure, and belong to no other assembly;
16
+ * openings cannot be parts.
17
+ * @param inputs - The model, the parts, and the assembly's id, name and kind
18
+ * @returns A new model with the assembly
19
+ * @group create
20
+ * @shortname add assembly
21
+ * @drawable false
22
+ * @example
23
+ * ```typescript
24
+ * model = await bitbybit.ifc.assemblies.add({ model, parts: ["board-1", "board-2", "board-3"], id: "south-cladding", name: "South cladding", predefinedType: Bit.Inputs.IFC.elementAssemblyPredefinedTypeEnum.userDefined, objectType: "Cladding" });
25
+ * ```
26
+ */
27
+ add(inputs: Inputs.IFC.AddAssemblyDto<IfcModel>): IfcModel;
28
+ }
@@ -0,0 +1,49 @@
1
+ import { resolveDto } from "@bitbybit-dev/base";
2
+ import { createAssembly } from "../../build/assemblies";
3
+ import * as Inputs from "../inputs";
4
+ import { editModel, modelOf, oneOf, resolveId } from "./service-support";
5
+ /**
6
+ * Assemblies: elements made of other elements, such as a facade's cladding boards or a truss's
7
+ * members, which other tools list as one element with its parts and the STEP export of a model
8
+ * nests as one assembly.
9
+ * @beta
10
+ */
11
+ export class IFCAssemblies {
12
+ /**
13
+ * Makes elements the parts of a new assembly standing in their storey in their place. The parts
14
+ * keep their geometry and placement and stand in the model through it; removing the assembly
15
+ * removes them.
16
+ *
17
+ * They must share one storey, or other part of the structure, and belong to no other assembly;
18
+ * openings cannot be parts.
19
+ * @param inputs - The model, the parts, and the assembly's id, name and kind
20
+ * @returns A new model with the assembly
21
+ * @group create
22
+ * @shortname add assembly
23
+ * @drawable false
24
+ * @example
25
+ * ```typescript
26
+ * model = await bitbybit.ifc.assemblies.add({ model, parts: ["board-1", "board-2", "board-3"], id: "south-cladding", name: "South cladding", predefinedType: Bit.Inputs.IFC.elementAssemblyPredefinedTypeEnum.userDefined, objectType: "Cladding" });
27
+ * ```
28
+ */
29
+ add(inputs) {
30
+ var _a;
31
+ const resolved = resolveDto(Inputs.IFC.AddAssemblyDto, inputs);
32
+ const model = modelOf(resolved.model);
33
+ if (!Array.isArray(resolved.parts) || resolved.parts.length === 0) {
34
+ throw new TypeError("Expected the parts as a list of at least one element's GlobalId or id");
35
+ }
36
+ const parts = resolved.parts.map((part) => resolveId(model, part, "IfcElement", "part"));
37
+ if (new Set(parts).size !== parts.length) {
38
+ throw new Error("The parts name one element more than once");
39
+ }
40
+ const predefinedType = oneOf(resolved.predefinedType, Inputs.IFC.elementAssemblyPredefinedTypeEnum, "predefined type");
41
+ const objectType = ((_a = resolved.objectType) === null || _a === void 0 ? void 0 : _a.trim()) || undefined;
42
+ if (predefinedType === Inputs.IFC.elementAssemblyPredefinedTypeEnum.userDefined && objectType === undefined) {
43
+ throw new Error("A userDefined assembly needs an objectType that says what kind it is, such as Cladding");
44
+ }
45
+ return editModel(model, (tx, writer) => {
46
+ createAssembly(tx, writer, { parts, id: resolved.id, name: resolved.name, predefinedType, objectType });
47
+ });
48
+ }
49
+ }
@@ -0,0 +1,33 @@
1
+ import type { IfcModel } from "../../model/model-types";
2
+ import * as Inputs from "../inputs";
3
+ /**
4
+ * Beams: sections swept straight between two points of a storey, each a rectangle, a circle or an I
5
+ * section centred on the line between them.
6
+ * @beta
7
+ */
8
+ export declare class IFCBeams {
9
+ /**
10
+ * Adds a beam from `start` to `end` in a storey, its section centred on the line between them.
11
+ *
12
+ * The section's Y points up, so an I section stands upright on a level beam; `rotation` turns it
13
+ * about the beam's axis. The section is chosen by `profile` as for columns.
14
+ * @param inputs - The model, the storey, the two ends and the section
15
+ * @returns A new model with the beam
16
+ * @group create
17
+ * @shortname add beam
18
+ * @drawable false
19
+ * @example
20
+ * ```typescript
21
+ * model = await bitbybit.ifc.beams.add({
22
+ * model,
23
+ * storey: "first",
24
+ * start: [0, 4000, 2850],
25
+ * end: [10000, 4000, 2850],
26
+ * profile: Bit.Inputs.IFC.profileKindEnum.iShape,
27
+ * width: 150,
28
+ * depth: 300,
29
+ * });
30
+ * ```
31
+ */
32
+ add(inputs: Inputs.IFC.AddBeamDto<IfcModel>): IfcModel;
33
+ }
@@ -0,0 +1,59 @@
1
+ import { resolveDto } from "@bitbybit-dev/base";
2
+ import { POINT3_SIZE } from "../../build/constants";
3
+ import { createMember } from "../../build/slabs-columns-beams";
4
+ import * as Inputs from "../inputs";
5
+ import { requirePoint } from "../../build/checks";
6
+ import { editModel, modelOf, resolveId } from "./service-support";
7
+ import { finiteRotation, memberMaterial, profileOf } from "./member-support";
8
+ /**
9
+ * Beams: sections swept straight between two points of a storey, each a rectangle, a circle or an I
10
+ * section centred on the line between them.
11
+ * @beta
12
+ */
13
+ export class IFCBeams {
14
+ /**
15
+ * Adds a beam from `start` to `end` in a storey, its section centred on the line between them.
16
+ *
17
+ * The section's Y points up, so an I section stands upright on a level beam; `rotation` turns it
18
+ * about the beam's axis. The section is chosen by `profile` as for columns.
19
+ * @param inputs - The model, the storey, the two ends and the section
20
+ * @returns A new model with the beam
21
+ * @group create
22
+ * @shortname add beam
23
+ * @drawable false
24
+ * @example
25
+ * ```typescript
26
+ * model = await bitbybit.ifc.beams.add({
27
+ * model,
28
+ * storey: "first",
29
+ * start: [0, 4000, 2850],
30
+ * end: [10000, 4000, 2850],
31
+ * profile: Bit.Inputs.IFC.profileKindEnum.iShape,
32
+ * width: 150,
33
+ * depth: 300,
34
+ * });
35
+ * ```
36
+ */
37
+ add(inputs) {
38
+ const resolved = resolveDto(Inputs.IFC.AddBeamDto, inputs);
39
+ const model = modelOf(resolved.model);
40
+ requirePoint(resolved.start, POINT3_SIZE, "start");
41
+ requirePoint(resolved.end, POINT3_SIZE, "end");
42
+ finiteRotation(resolved.rotation);
43
+ const profile = profileOf(model, resolved);
44
+ const storey = resolveId(model, resolved.storey, "IfcBuildingStorey", "storey");
45
+ return editModel(model, (tx, writer) => {
46
+ createMember(tx, writer, "IfcBeam", {
47
+ storey,
48
+ id: resolved.id,
49
+ name: resolved.name,
50
+ start: resolved.start,
51
+ end: resolved.end,
52
+ profile,
53
+ rotation: resolved.rotation,
54
+ material: memberMaterial(tx, resolved.material),
55
+ predefinedType: "BEAM",
56
+ });
57
+ });
58
+ }
59
+ }
@@ -0,0 +1,26 @@
1
+ import type { IfcModel } from "../../model/model-types";
2
+ import * as Inputs from "../inputs";
3
+ /**
4
+ * Columns: sections standing upright on a storey, each a rectangle, a circle or an I section
5
+ * extruded up by the column's height.
6
+ * @beta
7
+ */
8
+ export declare class IFCColumns {
9
+ /**
10
+ * Adds a column standing on `position` in a storey's plan, its section centred on that point and
11
+ * extruded `height` up from `baseOffset` above the floor.
12
+ *
13
+ * `profile` picks the section: a rectangle reads `width` and `depth`, a circle `radius`, an I
14
+ * section also `webThickness` and `flangeThickness`. `rotation` turns it about the axis.
15
+ * @param inputs - The model, the storey, the position, the height and the section
16
+ * @returns A new model with the column
17
+ * @group create
18
+ * @shortname add column
19
+ * @drawable false
20
+ * @example
21
+ * ```typescript
22
+ * model = await bitbybit.ifc.columns.add({ model, storey: "ground", position: [5000, 4000], height: 2700, width: 300, depth: 300 });
23
+ * ```
24
+ */
25
+ add(inputs: Inputs.IFC.AddColumnDto<IfcModel>): IfcModel;
26
+ }
@@ -0,0 +1,56 @@
1
+ import { resolveDto } from "@bitbybit-dev/base";
2
+ import { createMember } from "../../build/slabs-columns-beams";
3
+ import * as Inputs from "../inputs";
4
+ import { requireFinite, requirePoint, requirePositive } from "../../build/checks";
5
+ import { POINT2_SIZE } from "../../build/constants";
6
+ import { DEFAULT_MILLIMETRES } from "./defaults.constants";
7
+ import { editModel, lengthIn, modelOf, resolveId } from "./service-support";
8
+ import { finiteRotation, memberMaterial, profileOf } from "./member-support";
9
+ /**
10
+ * Columns: sections standing upright on a storey, each a rectangle, a circle or an I section
11
+ * extruded up by the column's height.
12
+ * @beta
13
+ */
14
+ export class IFCColumns {
15
+ /**
16
+ * Adds a column standing on `position` in a storey's plan, its section centred on that point and
17
+ * extruded `height` up from `baseOffset` above the floor.
18
+ *
19
+ * `profile` picks the section: a rectangle reads `width` and `depth`, a circle `radius`, an I
20
+ * section also `webThickness` and `flangeThickness`. `rotation` turns it about the axis.
21
+ * @param inputs - The model, the storey, the position, the height and the section
22
+ * @returns A new model with the column
23
+ * @group create
24
+ * @shortname add column
25
+ * @drawable false
26
+ * @example
27
+ * ```typescript
28
+ * model = await bitbybit.ifc.columns.add({ model, storey: "ground", position: [5000, 4000], height: 2700, width: 300, depth: 300 });
29
+ * ```
30
+ */
31
+ add(inputs) {
32
+ const resolved = resolveDto(Inputs.IFC.AddColumnDto, inputs);
33
+ const model = modelOf(resolved.model);
34
+ const position = resolved.position;
35
+ requirePoint(position, POINT2_SIZE, "position");
36
+ const height = lengthIn(model, resolved.height, DEFAULT_MILLIMETRES.columnHeight);
37
+ requirePositive(height, "column's height");
38
+ requireFinite(resolved.baseOffset, "column's base offset");
39
+ finiteRotation(resolved.rotation);
40
+ const profile = profileOf(model, resolved);
41
+ const storey = resolveId(model, resolved.storey, "IfcBuildingStorey", "storey");
42
+ return editModel(model, (tx, writer) => {
43
+ createMember(tx, writer, "IfcColumn", {
44
+ storey,
45
+ id: resolved.id,
46
+ name: resolved.name,
47
+ start: [position[0], position[1], resolved.baseOffset],
48
+ end: [position[0], position[1], resolved.baseOffset + height],
49
+ profile,
50
+ rotation: resolved.rotation,
51
+ material: memberMaterial(tx, resolved.material),
52
+ predefinedType: "COLUMN",
53
+ });
54
+ });
55
+ }
56
+ }
@@ -0,0 +1,44 @@
1
+ export declare const DEFAULT_MILLIMETRES: {
2
+ readonly wallHeight: 3000;
3
+ readonly spaceHeight: 3000;
4
+ readonly wallThickness: 200;
5
+ readonly slabThickness: 200;
6
+ readonly layerThickness: 100;
7
+ readonly columnHeight: 3000;
8
+ readonly sectionWidth: 300;
9
+ readonly sectionDepth: 300;
10
+ readonly sectionRadius: 150;
11
+ readonly webThickness: 10;
12
+ readonly flangeThickness: 15;
13
+ readonly openingOffset: 1000;
14
+ readonly openingWidth: 1000;
15
+ readonly openingHeight: 2000;
16
+ readonly doorWidth: 900;
17
+ readonly doorHeight: 2100;
18
+ readonly liningThickness: 50;
19
+ readonly liningDepth: 100;
20
+ readonly panelThickness: 40;
21
+ readonly windowWidth: 1200;
22
+ readonly windowHeight: 1200;
23
+ readonly windowSill: 900;
24
+ readonly frameThickness: 60;
25
+ readonly frameDepth: 80;
26
+ readonly glassThickness: 24;
27
+ readonly terrainDepth: 1000;
28
+ readonly treeHeight: 8000;
29
+ readonly crownRadius: 2500;
30
+ readonly trunkRadius: 150;
31
+ };
32
+ export declare const HANDLE_MILLIMETRES: {
33
+ readonly inset: 75;
34
+ readonly leverHeight: 1050;
35
+ readonly leverStandoff: 45;
36
+ readonly leverSection: 20;
37
+ readonly leverLength: 130;
38
+ readonly pullBarLength: 1200;
39
+ readonly pullBarMiddle: 1100;
40
+ readonly pullBarStandoff: 50;
41
+ readonly pullBarSection: 30;
42
+ readonly pullBarPost: 20;
43
+ readonly pullBarPostInset: 80;
44
+ };
@@ -0,0 +1,44 @@
1
+ export const DEFAULT_MILLIMETRES = {
2
+ wallHeight: 3000,
3
+ spaceHeight: 3000,
4
+ wallThickness: 200,
5
+ slabThickness: 200,
6
+ layerThickness: 100,
7
+ columnHeight: 3000,
8
+ sectionWidth: 300,
9
+ sectionDepth: 300,
10
+ sectionRadius: 150,
11
+ webThickness: 10,
12
+ flangeThickness: 15,
13
+ openingOffset: 1000,
14
+ openingWidth: 1000,
15
+ openingHeight: 2000,
16
+ doorWidth: 900,
17
+ doorHeight: 2100,
18
+ liningThickness: 50,
19
+ liningDepth: 100,
20
+ panelThickness: 40,
21
+ windowWidth: 1200,
22
+ windowHeight: 1200,
23
+ windowSill: 900,
24
+ frameThickness: 60,
25
+ frameDepth: 80,
26
+ glassThickness: 24,
27
+ terrainDepth: 1000,
28
+ treeHeight: 8000,
29
+ crownRadius: 2500,
30
+ trunkRadius: 150,
31
+ };
32
+ export const HANDLE_MILLIMETRES = {
33
+ inset: 75,
34
+ leverHeight: 1050,
35
+ leverStandoff: 45,
36
+ leverSection: 20,
37
+ leverLength: 130,
38
+ pullBarLength: 1200,
39
+ pullBarMiddle: 1100,
40
+ pullBarStandoff: 50,
41
+ pullBarSection: 30,
42
+ pullBarPost: 20,
43
+ pullBarPostInset: 80,
44
+ };
@@ -0,0 +1,45 @@
1
+ import type { IfcModel } from "../../model/model-types";
2
+ import * as Inputs from "../inputs";
3
+ /**
4
+ * Doors: door types, each a lining around one panel, and doors of those types placed in walls. A
5
+ * door cuts its own opening and shares its type's geometry, so a type placed many times is written
6
+ * once.
7
+ * @beta
8
+ */
9
+ export declare class IFCDoors {
10
+ /**
11
+ * Adds a door type: a lining around one panel, `width` by `height`, which doors are then placed
12
+ * from.
13
+ *
14
+ * The lining's sides and head are `liningThickness` wide and `liningDepth` deep; the panel sits
15
+ * in the middle of the depth. A `handle` goes on both faces, away from the hinges. Materials give
16
+ * the lining, panel and handle their colours.
17
+ * @param inputs - The model, the type's id and name, its sizes and how it opens
18
+ * @returns A new model with the door type
19
+ * @group types
20
+ * @shortname add door type
21
+ * @drawable false
22
+ * @example
23
+ * ```typescript
24
+ * model = await bitbybit.ifc.doors.addType({ model, id: "door-90", name: "Door 900", width: 900, height: 2100 });
25
+ * ```
26
+ */
27
+ addType(inputs: Inputs.IFC.AddDoorTypeDto<IfcModel>): IfcModel;
28
+ /**
29
+ * Places a door of a door type in a wall, `offset` along the wall's axis from its start, cutting
30
+ * an opening as wide and high as the type.
31
+ *
32
+ * The door is centred in the wall's thickness and belongs to the wall's storey. It must fit
33
+ * along the wall.
34
+ * @param inputs - The model, the wall, the door type, and where the door goes
35
+ * @returns A new model with the door
36
+ * @group create
37
+ * @shortname add door
38
+ * @drawable false
39
+ * @example
40
+ * ```typescript
41
+ * model = await bitbybit.ifc.doors.add({ model, wall: "south", doorType: "door-90", id: "front-door", offset: 2000 });
42
+ * ```
43
+ */
44
+ add(inputs: Inputs.IFC.AddDoorDto<IfcModel>): IfcModel;
45
+ }
@@ -0,0 +1,94 @@
1
+ import { resolveDto } from "@bitbybit-dev/base";
2
+ import { createDoorType, createFilling } from "../../build/fillings";
3
+ import * as Inputs from "../inputs";
4
+ import { DEFAULT_MILLIMETRES, HANDLE_MILLIMETRES } from "./defaults.constants";
5
+ import { editModel, lengthIn, lengthTolerance, modelOf, oneOf, resolveId } from "./service-support";
6
+ function handleSizesIn(model) {
7
+ const size = (millimetres) => lengthIn(model, undefined, millimetres);
8
+ return {
9
+ inset: size(HANDLE_MILLIMETRES.inset),
10
+ leverHeight: size(HANDLE_MILLIMETRES.leverHeight),
11
+ leverStandoff: size(HANDLE_MILLIMETRES.leverStandoff),
12
+ leverSection: size(HANDLE_MILLIMETRES.leverSection),
13
+ leverLength: size(HANDLE_MILLIMETRES.leverLength),
14
+ pullBarLength: size(HANDLE_MILLIMETRES.pullBarLength),
15
+ pullBarMiddle: size(HANDLE_MILLIMETRES.pullBarMiddle),
16
+ pullBarStandoff: size(HANDLE_MILLIMETRES.pullBarStandoff),
17
+ pullBarSection: size(HANDLE_MILLIMETRES.pullBarSection),
18
+ pullBarPost: size(HANDLE_MILLIMETRES.pullBarPost),
19
+ pullBarPostInset: size(HANDLE_MILLIMETRES.pullBarPostInset),
20
+ };
21
+ }
22
+ /**
23
+ * Doors: door types, each a lining around one panel, and doors of those types placed in walls. A
24
+ * door cuts its own opening and shares its type's geometry, so a type placed many times is written
25
+ * once.
26
+ * @beta
27
+ */
28
+ export class IFCDoors {
29
+ /**
30
+ * Adds a door type: a lining around one panel, `width` by `height`, which doors are then placed
31
+ * from.
32
+ *
33
+ * The lining's sides and head are `liningThickness` wide and `liningDepth` deep; the panel sits
34
+ * in the middle of the depth. A `handle` goes on both faces, away from the hinges. Materials give
35
+ * the lining, panel and handle their colours.
36
+ * @param inputs - The model, the type's id and name, its sizes and how it opens
37
+ * @returns A new model with the door type
38
+ * @group types
39
+ * @shortname add door type
40
+ * @drawable false
41
+ * @example
42
+ * ```typescript
43
+ * model = await bitbybit.ifc.doors.addType({ model, id: "door-90", name: "Door 900", width: 900, height: 2100 });
44
+ * ```
45
+ */
46
+ addType(inputs) {
47
+ const resolved = resolveDto(Inputs.IFC.AddDoorTypeDto, inputs);
48
+ const model = modelOf(resolved.model);
49
+ const spec = {
50
+ id: resolved.id,
51
+ name: resolved.name,
52
+ width: lengthIn(model, resolved.width, DEFAULT_MILLIMETRES.doorWidth),
53
+ height: lengthIn(model, resolved.height, DEFAULT_MILLIMETRES.doorHeight),
54
+ liningThickness: lengthIn(model, resolved.liningThickness, DEFAULT_MILLIMETRES.liningThickness),
55
+ liningDepth: lengthIn(model, resolved.liningDepth, DEFAULT_MILLIMETRES.liningDepth),
56
+ panelThickness: lengthIn(model, resolved.panelThickness, DEFAULT_MILLIMETRES.panelThickness),
57
+ operation: oneOf(resolved.operation, Inputs.IFC.doorOperationEnum, "door operation"),
58
+ liningMaterial: resolved.liningMaterial,
59
+ panelMaterial: resolved.panelMaterial,
60
+ handle: oneOf(resolved.handle, Inputs.IFC.doorHandleEnum, "door handle"),
61
+ handleMaterial: resolved.handleMaterial,
62
+ hardware: handleSizesIn(model),
63
+ };
64
+ return editModel(model, (tx, writer) => {
65
+ createDoorType(tx, writer, spec);
66
+ });
67
+ }
68
+ /**
69
+ * Places a door of a door type in a wall, `offset` along the wall's axis from its start, cutting
70
+ * an opening as wide and high as the type.
71
+ *
72
+ * The door is centred in the wall's thickness and belongs to the wall's storey. It must fit
73
+ * along the wall.
74
+ * @param inputs - The model, the wall, the door type, and where the door goes
75
+ * @returns A new model with the door
76
+ * @group create
77
+ * @shortname add door
78
+ * @drawable false
79
+ * @example
80
+ * ```typescript
81
+ * model = await bitbybit.ifc.doors.add({ model, wall: "south", doorType: "door-90", id: "front-door", offset: 2000 });
82
+ * ```
83
+ */
84
+ add(inputs) {
85
+ const resolved = resolveDto(Inputs.IFC.AddDoorDto, inputs);
86
+ const model = modelOf(resolved.model);
87
+ const wall = resolveId(model, resolved.wall, "IfcWall", "wall");
88
+ const type = resolveId(model, resolved.doorType, "IfcDoorType", "door type");
89
+ return editModel(model, (tx, writer) => {
90
+ const offset = lengthIn(model, resolved.offset, DEFAULT_MILLIMETRES.openingOffset);
91
+ createFilling(tx, writer, "IfcDoor", { wall, type, id: resolved.id, name: resolved.name, offset, sill: resolved.sill }, lengthTolerance(model));
92
+ });
93
+ }
94
+ }
@@ -0,0 +1,51 @@
1
+ import type { Base } from "@bitbybit-dev/base";
2
+ import type { IfcModel } from "../../model/model-types";
3
+ import * as Inputs from "../inputs";
4
+ /**
5
+ * Describes a model's geometry as a recipe: data that a geometry kernel builds into solids or
6
+ * meshes, one result per element, with the openings of walls and slabs cut through them and each
7
+ * door or window type described once however many times it is placed.
8
+ *
9
+ * The recipe stays in the model's units and its Z up; each result is tagged with its element's
10
+ * `globalId`, `type`, `name` and, when its material has a colour, `rgba`.
11
+ * @beta
12
+ */
13
+ export declare class IFCGeometry {
14
+ private readonly lastDescribed;
15
+ /**
16
+ * Describes the geometry of a model's elements as a recipe, ready for a kernel to build.
17
+ *
18
+ * Each element with a body becomes one root, placed by its matrix and tagged with its GlobalId;
19
+ * openings are cut from their hosts rather than becoming roots. An element that cannot be
20
+ * described is left out, and `geometry.unsupported` lists it with the reason.
21
+ * @param inputs - The model and, optionally, the elements to describe
22
+ * @returns A recipe with one root per element
23
+ * @group recipes
24
+ * @shortname geometry recipe
25
+ * @drawable false
26
+ * @example
27
+ * ```typescript
28
+ * const recipe = await bitbybit.ifc.geometry.recipe({ model });
29
+ * console.log(recipe.roots.length, recipe.millimetresPerUnit);
30
+ * ```
31
+ */
32
+ recipe(inputs: Inputs.IFC.GeometryDto<IfcModel>): Base.Recipe;
33
+ /**
34
+ * Lists the elements whose geometry `geometry.recipe` leaves out, each with what it could not
35
+ * describe, such as a profile type that is not supported yet.
36
+ *
37
+ * An element asked for in `elements` is listed too when it has no body to describe, such as an
38
+ * opening, a storey or an element without a 'Body' representation.
39
+ * @param inputs - The model and, optionally, the elements to check
40
+ * @returns The elements left out, empty when every one is described
41
+ * @group recipes
42
+ * @shortname unsupported geometry
43
+ * @drawable false
44
+ * @example
45
+ * ```typescript
46
+ * const problems = await bitbybit.ifc.geometry.unsupported({ model });
47
+ * problems.forEach((problem) => console.log(problem.type, problem.message));
48
+ * ```
49
+ */
50
+ unsupported(inputs: Inputs.IFC.GeometryElementsDto<IfcModel>): Inputs.IFC.GeometryProblemDto[];
51
+ }