brepjs-bim 0.24.4 → 0.25.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.
@@ -0,0 +1,6 @@
1
+ import { BimError } from './errors/bimError.js';
2
+ import { GeometryCleanupDiagnostic } from './productBodyCleanup.js';
3
+ /** Read prior owner attempts without retrying releases or merging distinct failures. */
4
+ export declare function reportedGeometryCleanup(error: BimError, operation: string, context?: {
5
+ readonly itemIndex?: number;
6
+ }): readonly GeometryCleanupDiagnostic[];
@@ -1,15 +1,10 @@
1
1
  import { ValidSolid } from 'brepjs';
2
2
  import { IfcWriter } from './ifcWriter.js';
3
- import { WallSpec } from '../specs/wallSpec.js';
4
3
  import { SlabSpec } from '../specs/slabSpec.js';
5
4
  import { BeamSpec } from '../specs/beamSpec.js';
6
5
  import { ColumnSpec } from '../specs/columnSpec.js';
7
6
  import { RoofSpec } from '../specs/roofSpec.js';
8
7
  import { Profile } from '../specs/profile.js';
9
- export interface WallRepresentationIds {
10
- localPlacementId: number;
11
- productDefinitionShapeId: number;
12
- }
13
8
  export interface SlabRepresentationIds {
14
9
  localPlacementId: number;
15
10
  productDefinitionShapeId: number;
@@ -18,7 +13,6 @@ export interface LinearElementRepresentationIds {
18
13
  localPlacementId: number;
19
14
  productDefinitionShapeId: number;
20
15
  }
21
- export declare function writeWallGeometry(w: IfcWriter, spec: WallSpec, geomSubContextId: number, parentPlacementId: number | null): WallRepresentationIds;
22
16
  export declare function writeSlabGeometry(w: IfcWriter, spec: SlabSpec, geomSubContextId: number, parentPlacementId: number | null): SlabRepresentationIds;
23
17
  export declare function writeRoofGeometry(w: IfcWriter, spec: RoofSpec, solid: ValidSolid, geomSubContextId: number, parentPlacementId: number | null): SlabRepresentationIds & {
24
18
  usedFallback: boolean;
@@ -28,6 +28,8 @@ export interface BimModelMeta {
28
28
  ifcSchema?: IfcSchema | undefined;
29
29
  }
30
30
  export declare function writeHeader(w: IfcWriter, meta: BimModelMeta): HeaderIds;
31
+ /** Separates display Body geometry from non-subtractive Reference geometry. */
32
+ export declare function writeGeometricSubContext(w: IfcWriter, geomContextId: number, identifier: 'Body' | 'Reference'): number;
31
33
  /**
32
34
  * Writes IfcProjectedCRS + IfcMapConversion georeferencing the model context
33
35
  * (GRF003). Coordinates are metres; rotation defaults to identity.
@@ -13,7 +13,7 @@ type OpeningPsetSpec = {
13
13
  readonly acousticRating?: string | undefined;
14
14
  readonly thermalTransmittance?: number | undefined;
15
15
  };
16
- export declare function writeOpeningGeometry(w: IfcWriter, guid: IfcGuid, openingSpec: WallOpeningSpec, wallSpec: WallSpec, wallPlacementId: number, geomSubContextId: number, ownerHistoryId: number): OpeningIds;
16
+ export declare function writeOpeningGeometry(w: IfcWriter, guid: IfcGuid, openingSpec: WallOpeningSpec, wallSpec: WallSpec, wallPlacementId: number, geomSubContextId: number, ownerHistoryId: number, representationIdentifier: 'Body' | 'Reference'): OpeningIds;
17
17
  export declare function writeSlabOpeningGeometry(w: IfcWriter, guid: IfcGuid, openingSpec: SlabOpeningSpec, slabSpec: SlabSpec, slabPlacementId: number, geomSubContextId: number, ownerHistoryId: number): OpeningIds;
18
18
  export declare function writeDoorEntity(w: IfcWriter, guid: IfcGuid, name: string, ownerHistoryId: number, openingPlacementId: number, geomSubContextId: number, overallWidthM: number, overallHeightM: number, nominalDepthMm?: number): number;
19
19
  export declare function writeWindowEntity(w: IfcWriter, guid: IfcGuid, name: string, ownerHistoryId: number, openingPlacementId: number, geomSubContextId: number, overallWidthM: number, overallHeightM: number, nominalDepthMm?: number): number;
@@ -25,7 +25,7 @@ export type TessellationPreparation = {
25
25
  readonly reason: string;
26
26
  readonly cause?: unknown;
27
27
  };
28
- export interface ExactBodyRepresentationIds {
28
+ export interface ProductBodyRepresentationIds {
29
29
  readonly localPlacementId: number;
30
30
  readonly productDefinitionShapeId: number;
31
31
  readonly bodyItemIds: readonly number[];
@@ -53,7 +53,7 @@ export declare function writePreparedTessellationBody(w: IfcWriter, items: NonEm
53
53
  readonly productDefinitionShapeId: number;
54
54
  readonly bodyItemIds: readonly number[];
55
55
  };
56
- export declare function writeExactBodyGeometry(w: IfcWriter, placement: FrameInput, items: NonEmpty<PreparedTessellation>, geomSubContextId: number, parentPlacementId: number | null): ExactBodyRepresentationIds;
56
+ export declare function writeProductBodyGeometry(w: IfcWriter, placement: FrameInput, items: NonEmpty<PreparedTessellation>, geomSubContextId: number, parentPlacementId: number | null): ProductBodyRepresentationIds;
57
57
  export declare function writePreparedTessellationItem(w: IfcWriter, prepared: PreparedTessellation): number;
58
58
  /**
59
59
  * Builds a wall 'Axis' IfcShapeRepresentation: an IfcPolyline from (0,0) to
@@ -0,0 +1,4 @@
1
+ import { Result, ValidSolid } from 'brepjs';
2
+ import { BimError } from '../errors/bimError.js';
3
+ /** Borrow World-placed inputs; own every disconnected result independently of the cut's cache. */
4
+ export declare function cutImportedSolids(host: ValidSolid, opening: ValidSolid): Result<readonly ValidSolid[], BimError>;
@@ -25,6 +25,6 @@ export declare function setFromIfcTestHooksForTesting(hooks: FromIfcTestHooks |
25
25
  * fatal failures — bad bytes, unsupported schema, WASM open failure — return
26
26
  * `err`. Inspect {@link ImportedModel.diagnostics} for per-element quality.
27
27
  *
28
- * The web-ifc model handle is always closed in a `finally` block.
28
+ * The web-ifc model handle is closed before handing reconstructed owners to the caller.
29
29
  */
30
30
  export declare function fromIfc(bytes: Uint8Array, options?: FromIfcOptions): Promise<Result<ImportedModel, BimError>>;
@@ -18,13 +18,16 @@ export interface ImportedGeometry {
18
18
  readonly fidelity: GeometryFidelity;
19
19
  /** Whether every IFC Body item reconstructed into an owned solid. */
20
20
  readonly completeness: ImportedBodyCompleteness;
21
- /** Owned World-placed reconstructed handles. Dispose them through disposeImportedModel(). */
21
+ /**
22
+ * Owned World-placed handles, in source-item order. Opening cuts can leave zero
23
+ * or more independent solids per source item. Dispose through disposeImportedModel().
24
+ */
22
25
  readonly solids: readonly ValidSolid[];
23
26
  /** Borrowed alias for a COMPLETE one-solid Body. Otherwise null. */
24
27
  readonly solid: ValidSolid | null;
25
- /** Component-wise union of all item bounds for a COMPLETE Body. Null if measurement fails. */
28
+ /** All surviving item bounds for a COMPLETE Body. Null for no survivors or measurement failure. */
26
29
  readonly bounds: Bounds3D | null;
27
- /** Sum of item volumes in mm³ for a COMPLETE Body. Null if measurement fails. */
30
+ /** Occupied-union mm³ for a COMPLETE Body. Null for no survivors or measurement failure. */
28
31
  readonly volumeMm3: number | null;
29
32
  /** Combined raw triangle vertices (interleaved xyz), present for `TESSELLATED_LOSSY`. */
30
33
  readonly meshVertices?: Float32Array | undefined;
@@ -0,0 +1,15 @@
1
+ import { Result, ValidSolid } from 'brepjs';
2
+ import { BimError } from '../errors/bimError.js';
3
+ import { LocalId } from '../identity/localId.js';
4
+ import { NonEmpty } from '../types/productBody.js';
5
+ import { PreparedTessellation, TessellationPreparation } from '../ifc-writer/tessellationWriter.js';
6
+ export type ProductBodyItemPreparer = (solid: ValidSolid) => TessellationPreparation;
7
+ /** Package-internal deterministic failure seam for serialization cleanup tests. */
8
+ export declare function setProductBodyItemPreparerForTesting(prepareItem: ProductBodyItemPreparer | null): void;
9
+ export interface ProductBodyPreflightInput {
10
+ readonly localId: LocalId;
11
+ readonly solids: NonEmpty<ValidSolid>;
12
+ readonly prepareItem?: ProductBodyItemPreparer | undefined;
13
+ }
14
+ /** Prepares every retained Body item without writing IFC lines. Source solids remain borrowed. */
15
+ export declare function preflightProductBody(input: ProductBodyPreflightInput): Result<NonEmpty<PreparedTessellation>, BimError>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brepjs-bim",
3
- "version": "0.24.4",
3
+ "version": "0.25.0",
4
4
  "description": "BIM layer for brepjs — IFC4-aligned parametric building elements",
5
5
  "keywords": [
6
6
  "bim",
@@ -59,7 +59,7 @@
59
59
  "vite-plugin-dts": "^5.0.0",
60
60
  "vitest": "^5.0.0",
61
61
  "web-ifc": "^0.0.77",
62
- "zod": "4.6.4"
62
+ "zod": "4.6.5"
63
63
  },
64
64
  "dependencies": {
65
65
  "brepjs-families": ">=0.1.0 <1.0.0"
@@ -1,15 +0,0 @@
1
- import { Result, ValidSolid } from 'brepjs';
2
- import { BimError } from '../errors/bimError.js';
3
- import { LocalId } from '../identity/localId.js';
4
- import { NonEmpty } from '../types/productBody.js';
5
- import { PreparedTessellation, TessellationPreparation } from '../ifc-writer/tessellationWriter.js';
6
- export type ExactBodyItemPreparer = (solid: ValidSolid) => TessellationPreparation;
7
- /** Package-internal deterministic failure seam for serialization cleanup tests. */
8
- export declare function setExactBodyItemPreparerForTesting(prepareItem: ExactBodyItemPreparer | null): void;
9
- export interface ExactBodyPreflightInput {
10
- readonly localId: LocalId;
11
- readonly solids: NonEmpty<ValidSolid>;
12
- readonly prepareItem?: ExactBodyItemPreparer | undefined;
13
- }
14
- /** Prepares every exact Body item without writing IFC lines. Source solids remain borrowed. */
15
- export declare function preflightExactBody(input: ExactBodyPreflightInput): Result<NonEmpty<PreparedTessellation>, BimError>;