brepjs-bim 0.23.2 → 0.24.1
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.
- package/README.md +31 -11
- package/dist/brepjs-bim.cjs +1263 -734
- package/dist/brepjs-bim.js +1255 -727
- package/dist/elementFns/placedGeometry.d.ts +5 -0
- package/dist/errors/bimError.d.ts +1 -1
- package/dist/familiesAdapter.d.ts +15 -3
- package/dist/familiesProductBody.d.ts +40 -0
- package/dist/ifc-writer/ifcWriter.d.ts +16 -0
- package/dist/ifc-writer/psetWriter.d.ts +6 -0
- package/dist/ifc-writer/tessellationWriter.d.ts +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/model/bimModel.d.ts +9 -0
- package/dist/rigidPlacement.d.ts +4 -0
- package/dist/serialize/exactBodyPreflight.d.ts +15 -0
- package/dist/serialize/exactWallQuantities.d.ts +20 -0
- package/dist/types/bimTypes.d.ts +2 -1
- package/dist/types/productBody.d.ts +13 -0
- package/package.json +1 -1
|
@@ -2,6 +2,11 @@ import { ValidSolid, Result } from 'brepjs';
|
|
|
2
2
|
import { AnyBimElement } from '../types/bimTypes.js';
|
|
3
3
|
import { BimError } from '../errors/bimError.js';
|
|
4
4
|
import { FrameInput } from '../import/placement.js';
|
|
5
|
+
export interface PlacedGeometryTestHooks {
|
|
6
|
+
readonly afterPlaced?: ((solid: ValidSolid) => void) | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** Package-internal deterministic failure seam for placement ownership tests. */
|
|
9
|
+
export declare function setPlacedGeometryTestHooksForTesting(hooks: PlacedGeometryTestHooks | null): void;
|
|
5
10
|
export interface PlacedSolidsOptions {
|
|
6
11
|
/**
|
|
7
12
|
* Cumulative frame of the element's containing spatial structure. Element
|
|
@@ -8,7 +8,7 @@ export interface BimError {
|
|
|
8
8
|
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
9
9
|
}
|
|
10
10
|
export declare function specError(code: string, message: string, cause?: unknown): BimError;
|
|
11
|
-
export declare function ifcError(code: string, message: string, cause?: unknown): BimError;
|
|
11
|
+
export declare function ifcError(code: string, message: string, cause?: unknown, metadata?: Readonly<Record<string, unknown>>): BimError;
|
|
12
12
|
export declare function geometryError(code: string, message: string, cause?: unknown): BimError;
|
|
13
13
|
/**
|
|
14
14
|
* IFC-import error factory. Codes used by the reader subsystem:
|
|
@@ -9,9 +9,16 @@ export interface FamiliesToBimOptions {
|
|
|
9
9
|
readonly siteName?: string | undefined;
|
|
10
10
|
readonly buildingName?: string | undefined;
|
|
11
11
|
/**
|
|
12
|
-
* Materializes exact evaluated Product Bodies for supported typed routes
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Materializes exact evaluated Product Bodies for supported typed routes.
|
|
13
|
+
* Earthworks Fill always retains that Body. Civil-semantic walls and railings
|
|
14
|
+
* require this evaluator (or `proxyEvaluator`) before projection: absence
|
|
15
|
+
* returns FAMILIES_PRODUCT_BODY_EVALUATOR_REQUIRED with the element path and
|
|
16
|
+
* mapped category, and does not fall back to a parametric envelope.
|
|
17
|
+
* Conventional archetype walls and railings stay specification-authoritative
|
|
18
|
+
* and do not require an evaluator. When present, civil walls and railings
|
|
19
|
+
* compare the evaluated Body with their post-opening parametric Body and
|
|
20
|
+
* retain the authored Body when they differ. Supplying this option does not
|
|
21
|
+
* opt unsupported products into the proxy fallback.
|
|
15
22
|
*/
|
|
16
23
|
readonly bodyEvaluator?: csg.Evaluator | undefined;
|
|
17
24
|
/**
|
|
@@ -44,6 +51,11 @@ export interface FamiliesBimResult {
|
|
|
44
51
|
*/
|
|
45
52
|
readonly proxied: readonly ProxiedElement[];
|
|
46
53
|
}
|
|
54
|
+
export interface FamiliesAdapterTestHooks {
|
|
55
|
+
readonly afterCivilProductBody?: ((model: BimModel, localId: LocalId, element: ResolvedElement) => void) | undefined;
|
|
56
|
+
}
|
|
57
|
+
/** Package-internal deterministic failure seam for projection ownership tests. */
|
|
58
|
+
export declare function setFamiliesAdapterTestHooksForTesting(hooks: FamiliesAdapterTestHooks | null): void;
|
|
47
59
|
/**
|
|
48
60
|
* Project a resolved families tree into an eager BimModel. The caller owns
|
|
49
61
|
* the returned model (`using`); families stays domain-neutral — this adapter
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Result, Solid, ValidSolid, csg } from 'brepjs';
|
|
2
|
+
import { ResolvedElement } from 'brepjs-families';
|
|
3
|
+
import { BimError } from './errors/bimError.js';
|
|
4
|
+
import { ProductBody } from './types/productBody.js';
|
|
5
|
+
import { Frame } from './placementFrame.js';
|
|
6
|
+
type ExactProductBody = Extract<ProductBody, {
|
|
7
|
+
readonly kind: 'EXACT';
|
|
8
|
+
}>;
|
|
9
|
+
type ParametricProductBody = Extract<ProductBody, {
|
|
10
|
+
readonly kind: 'PARAMETRIC';
|
|
11
|
+
}>;
|
|
12
|
+
export type CivilProductBodySelection = {
|
|
13
|
+
readonly kind: 'PARAMETRIC';
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: 'EXACT';
|
|
16
|
+
readonly body: ExactProductBody;
|
|
17
|
+
};
|
|
18
|
+
export interface CivilProductBodyInput {
|
|
19
|
+
readonly element: ResolvedElement;
|
|
20
|
+
readonly category: 'WALL' | 'RAILING';
|
|
21
|
+
readonly evaluator: csg.Evaluator;
|
|
22
|
+
readonly productWorldFrame: Frame;
|
|
23
|
+
/** Borrowed model-owned comparison candidate after registered openings. */
|
|
24
|
+
readonly parametricBody: ParametricProductBody;
|
|
25
|
+
}
|
|
26
|
+
export interface FamiliesProductBodyTestHooks {
|
|
27
|
+
readonly afterCopy?: ((itemIndex: number, solid: Solid, source: Solid) => void) | undefined;
|
|
28
|
+
readonly beforeLocalize?: ((itemIndex: number, solid: ValidSolid) => void) | undefined;
|
|
29
|
+
readonly afterLocalized?: ((itemIndex: number, solid: ValidSolid) => void) | undefined;
|
|
30
|
+
readonly beforeCoincidence?: ((exact: ExactProductBody, parametric: ParametricProductBody) => void) | undefined;
|
|
31
|
+
}
|
|
32
|
+
/** Package-internal deterministic failure seams for exact ownership tests. */
|
|
33
|
+
export declare function setFamiliesProductBodyTestHooksForTesting(hooks: FamiliesProductBodyTestHooks | null): void;
|
|
34
|
+
/**
|
|
35
|
+
* Evaluates a civil Product Body, clones and localizes every borrowed source,
|
|
36
|
+
* then proves whether the registered-opening parametric Body is coincident.
|
|
37
|
+
* An EXACT result is caller-owned until takeExactProductBody() succeeds.
|
|
38
|
+
*/
|
|
39
|
+
export declare function selectCivilProductBody(input: CivilProductBodyInput): Result<CivilProductBodySelection, BimError>;
|
|
40
|
+
export {};
|
|
@@ -3,6 +3,18 @@ import { BimError } from '../errors/bimError.js';
|
|
|
3
3
|
import { IfcGuid } from '../identity/ifcGuid.js';
|
|
4
4
|
import { IfcSchema } from './schemaVersion.js';
|
|
5
5
|
import { Result } from 'brepjs';
|
|
6
|
+
export interface IfcWriterApiForTesting {
|
|
7
|
+
WriteLine(modelId: number, entity: unknown): void;
|
|
8
|
+
CreateIfcType(modelId: number, type: number, value: unknown): Record<string, unknown>;
|
|
9
|
+
SaveModel(modelId: number): Uint8Array;
|
|
10
|
+
CloseModel(modelId: number): void;
|
|
11
|
+
}
|
|
12
|
+
export interface IfcWriterTestHooks {
|
|
13
|
+
readonly afterWriteLine?: (() => void) | undefined;
|
|
14
|
+
readonly afterClose?: (() => void) | undefined;
|
|
15
|
+
}
|
|
16
|
+
/** Package-internal deterministic lifecycle observation seam. */
|
|
17
|
+
export declare function setIfcWriterTestHooksForTesting(hooks: IfcWriterTestHooks | null): void;
|
|
6
18
|
/** Default MVD ViewDefinition declared in the STEP FILE_DESCRIPTION header. */
|
|
7
19
|
export declare const DEFAULT_MVD_VIEW_DEFINITION = "ReferenceView_v1.2";
|
|
8
20
|
export interface IfcHeaderMeta {
|
|
@@ -13,6 +25,8 @@ export declare class IfcWriter {
|
|
|
13
25
|
#private;
|
|
14
26
|
private constructor();
|
|
15
27
|
static create(mvdViewDefinition?: string, ifcSchema?: IfcSchema, header?: IfcHeaderMeta): Promise<Result<IfcWriter, BimError>>;
|
|
28
|
+
/** Package-internal lifecycle seam for deterministic writer cleanup tests. */
|
|
29
|
+
static fromApiForTesting(api: IfcWriterApiForTesting, modelId?: number): IfcWriter;
|
|
16
30
|
nextId(): number;
|
|
17
31
|
/**
|
|
18
32
|
* Deterministic GlobalId for a writer-minted line, keyed on its express ID.
|
|
@@ -27,5 +41,7 @@ export declare class IfcWriter {
|
|
|
27
41
|
} & Record<string, unknown>): number;
|
|
28
42
|
ref(id: number): InstanceType<typeof Handle>;
|
|
29
43
|
mkType(type: number, value: unknown): Record<string, unknown>;
|
|
44
|
+
close(): void;
|
|
45
|
+
[Symbol.dispose](): void;
|
|
30
46
|
save(): Result<Uint8Array, BimError>;
|
|
31
47
|
}
|
|
@@ -45,6 +45,12 @@ export declare function writeCustomPsets(w: IfcWriter, ownerHistoryId: number, e
|
|
|
45
45
|
*/
|
|
46
46
|
export declare function resolveDensityKgM3(materialName: string | undefined, explicitDensityKgM3: number | undefined): number | undefined;
|
|
47
47
|
export declare function writeWallBaseQuantities(w: IfcWriter, ownerHistoryId: number, wallExpressId: number, spec: WallSpec, openings: readonly WallOpeningSpec[], densityKgM3?: number): void;
|
|
48
|
+
export declare function writeExactWallBaseQuantities(w: IfcWriter, ownerHistoryId: number, wallExpressId: number, values: {
|
|
49
|
+
readonly lengthM: number;
|
|
50
|
+
readonly widthM: number;
|
|
51
|
+
readonly heightM: number;
|
|
52
|
+
readonly netVolumeM3: number;
|
|
53
|
+
}): void;
|
|
48
54
|
export declare function writeSlabCommonPset(w: IfcWriter, ownerHistoryId: number, slabExpressId: number, spec: SlabSpec): void;
|
|
49
55
|
export declare function writeSlabBaseQuantities(w: IfcWriter, ownerHistoryId: number, slabExpressId: number, spec: SlabSpec, openings: readonly SlabOpeningSpec[], densityKgM3?: number): void;
|
|
50
56
|
export declare function writeBeamCommonPset(w: IfcWriter, ownerHistoryId: number, beamExpressId: number, spec: BeamSpec): void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ValidSolid } from 'brepjs';
|
|
2
2
|
import { IfcWriter } from './ifcWriter.js';
|
|
3
|
+
import { FrameInput } from '../import/placement.js';
|
|
4
|
+
import { NonEmpty } from '../types/productBody.js';
|
|
3
5
|
export interface TessellationResult {
|
|
4
6
|
readonly productDefinitionShapeId: number;
|
|
5
7
|
/** True when the IfcFacetedBrep fallback was used because mesh() failed. */
|
|
@@ -11,6 +13,24 @@ export interface TessellationFallbackResult {
|
|
|
11
13
|
readonly fallbackReason: string;
|
|
12
14
|
}
|
|
13
15
|
export type TessellationOutput = TessellationResult | TessellationFallbackResult;
|
|
16
|
+
export interface PreparedTessellation {
|
|
17
|
+
readonly coordList: readonly (readonly [number, number, number])[];
|
|
18
|
+
readonly coordIndex: readonly (readonly [number, number, number])[];
|
|
19
|
+
}
|
|
20
|
+
export type TessellationPreparation = {
|
|
21
|
+
readonly ok: true;
|
|
22
|
+
readonly value: PreparedTessellation;
|
|
23
|
+
} | {
|
|
24
|
+
readonly ok: false;
|
|
25
|
+
readonly reason: string;
|
|
26
|
+
readonly cause?: unknown;
|
|
27
|
+
};
|
|
28
|
+
export interface ExactBodyRepresentationIds {
|
|
29
|
+
readonly localPlacementId: number;
|
|
30
|
+
readonly productDefinitionShapeId: number;
|
|
31
|
+
readonly bodyItemIds: readonly number[];
|
|
32
|
+
}
|
|
33
|
+
export declare function prepareTessellation(solid: ValidSolid, toleranceMm?: number): TessellationPreparation;
|
|
14
34
|
/**
|
|
15
35
|
* Writes an IfcTriangulatedFaceSet (preferred IFC4 tessellation) from a brepjs
|
|
16
36
|
* ValidSolid, wrapped in an IfcShapeRepresentation (Body/Tessellation) and an
|
|
@@ -29,6 +49,12 @@ export type TessellationOutput = TessellationResult | TessellationFallbackResult
|
|
|
29
49
|
* shape representation, so it is not referenced here.
|
|
30
50
|
*/
|
|
31
51
|
export declare function writeTessellation(w: IfcWriter, solid: ValidSolid, geomSubContextId: number, _localPlacementId: number | null, toleranceMm?: number): TessellationOutput;
|
|
52
|
+
export declare function writePreparedTessellationBody(w: IfcWriter, items: NonEmpty<PreparedTessellation>, geomSubContextId: number): {
|
|
53
|
+
readonly productDefinitionShapeId: number;
|
|
54
|
+
readonly bodyItemIds: readonly number[];
|
|
55
|
+
};
|
|
56
|
+
export declare function writeExactBodyGeometry(w: IfcWriter, placement: FrameInput, items: NonEmpty<PreparedTessellation>, geomSubContextId: number, parentPlacementId: number | null): ExactBodyRepresentationIds;
|
|
57
|
+
export declare function writePreparedTessellationItem(w: IfcWriter, prepared: PreparedTessellation): number;
|
|
32
58
|
/**
|
|
33
59
|
* Builds a wall 'Axis' IfcShapeRepresentation: an IfcPolyline from (0,0) to
|
|
34
60
|
* (lengthM, 0) in the wall's local XY plane, wrapped in an IfcShapeRepresentation
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { BimModel, type ElementIdentityOptions, type OpeningIdentityOptions, } from './model/bimModel.js';
|
|
2
2
|
export type { BimTreeNode, BimTreeSummary } from './model/treeSummary.js';
|
|
3
3
|
export { placedSolids } from './elementFns/placedGeometry.js';
|
|
4
|
+
export { bodySolids } from './types/productBody.js';
|
|
5
|
+
export type { NonEmpty, ProductBody } from './types/productBody.js';
|
|
4
6
|
export type { PlacedSolidsOptions } from './elementFns/placedGeometry.js';
|
|
5
7
|
export type { FrameInput } from './import/placement.js';
|
|
6
8
|
export { toIfc, toIfcValidated } from './serialize/toIfc.js';
|
package/dist/model/bimModel.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { ZoneSpec, SystemSpec } from '../specs/groupSpec.js';
|
|
|
24
24
|
import { SurfaceStyleSpec } from '../ifc-writer/styleWriter.js';
|
|
25
25
|
import { ProjectSpec, SiteSpec, BuildingSpec, StoreySpec } from '../specs/spatialSpec.js';
|
|
26
26
|
import { BridgePartSpec, BridgeSpec, EarthworksFillSpec } from '../specs/infrastructureSpec.js';
|
|
27
|
+
import { ProductBody } from '../types/productBody.js';
|
|
27
28
|
/** Optional identity override for created elements: a stable key (e.g. a
|
|
28
29
|
* families key path) that replaces the positional GlobalId derivation. */
|
|
29
30
|
export interface ElementIdentityOptions {
|
|
@@ -67,6 +68,14 @@ export declare class BimModel {
|
|
|
67
68
|
*/
|
|
68
69
|
addRamp(spec: RampSpec, options?: ElementIdentityOptions): Result<LocalId, BimError>;
|
|
69
70
|
addRailing(spec: RailingSpec, options?: ElementIdentityOptions): Result<LocalId, BimError>;
|
|
71
|
+
/**
|
|
72
|
+
* Atomically replaces a parametric wall or railing Body with authoritative,
|
|
73
|
+
* caller-owned exact solids. Success transfers every supplied handle to this
|
|
74
|
+
* model. Failure leaves both the model and all supplied handles unchanged.
|
|
75
|
+
*/
|
|
76
|
+
takeExactProductBody(localId: LocalId, body: Extract<ProductBody, {
|
|
77
|
+
readonly kind: 'EXACT';
|
|
78
|
+
}>): Result<void, BimError>;
|
|
70
79
|
/**
|
|
71
80
|
* Adds an IfcCovering. When `hostLocalId` is supplied, an
|
|
72
81
|
* IfcRelCoversBldgElements linking the covering to its host (e.g. a slab it
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AnyShape, Dimension } from 'brepjs';
|
|
2
|
+
import { FrameInput } from './import/placement.js';
|
|
3
|
+
/** Applies a rigid placement as a location so the source BRep is not rebuilt. */
|
|
4
|
+
export declare function locateShapeInFrame<T extends AnyShape<Dimension>>(shape: T, frame: FrameInput): T;
|
|
@@ -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 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>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { fuseAll, measureVolume, Result, ValidSolid } from 'brepjs';
|
|
2
|
+
import { BimError } from '../errors/bimError.js';
|
|
3
|
+
import { WallSpec } from '../specs/wallSpec.js';
|
|
4
|
+
import { NonEmpty } from '../types/productBody.js';
|
|
5
|
+
export interface ExactWallQuantityValues {
|
|
6
|
+
readonly lengthM: number;
|
|
7
|
+
readonly widthM: number;
|
|
8
|
+
readonly heightM: number;
|
|
9
|
+
readonly netVolumeM3: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ExactWallQuantityDependencies {
|
|
12
|
+
readonly fuse?: typeof fuseAll | undefined;
|
|
13
|
+
readonly measure?: typeof measureVolume | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface ExactWallQuantityInput {
|
|
16
|
+
readonly spec: WallSpec;
|
|
17
|
+
readonly solids: NonEmpty<ValidSolid>;
|
|
18
|
+
readonly dependencies?: ExactWallQuantityDependencies | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare function deriveExactWallQuantities(input: ExactWallQuantityInput): Result<ExactWallQuantityValues, BimError>;
|
package/dist/types/bimTypes.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { ElementAssemblySpec } from '../specs/assemblySpec.js';
|
|
|
20
20
|
import { ZoneSpec, SystemSpec } from '../specs/groupSpec.js';
|
|
21
21
|
import { ProjectSpec, SiteSpec, BuildingSpec, StoreySpec } from '../specs/spatialSpec.js';
|
|
22
22
|
import { BridgePartSpec, BridgeSpec, EarthworksFillSpec } from '../specs/infrastructureSpec.js';
|
|
23
|
+
import { ProductBody } from './productBody.js';
|
|
23
24
|
export type BimCategory = 'WALL' | 'SLAB' | 'BEAM' | 'COLUMN' | 'OPENING' | 'DOOR' | 'WINDOW' | 'PROXY' | 'SPACE' | 'ROOF' | 'CURTAIN_WALL' | 'FOOTING' | 'PILE' | 'STAIR' | 'RAMP' | 'RAILING' | 'COVERING' | 'ELEMENT_ASSEMBLY' | 'ZONE' | 'SYSTEM' | 'PROJECT' | 'SITE' | 'BRIDGE' | 'BRIDGE_PART' | 'EARTHWORKS_FILL' | 'BUILDING' | 'STOREY';
|
|
24
25
|
export type WallOpeningSpec = {
|
|
25
26
|
readonly kind: 'WALL_OPENING';
|
|
@@ -39,7 +40,7 @@ export type OpeningSpec = WallOpeningSpec | SlabOpeningSpec;
|
|
|
39
40
|
export declare function isWallOpening(spec: OpeningSpec): spec is WallOpeningSpec;
|
|
40
41
|
export declare function isSlabOpening(spec: OpeningSpec): spec is SlabOpeningSpec;
|
|
41
42
|
export type BimSpecFor<C extends BimCategory> = C extends 'WALL' ? WallSpec : C extends 'SLAB' ? SlabSpec : C extends 'BEAM' ? BeamSpec : C extends 'COLUMN' ? ColumnSpec : C extends 'OPENING' ? OpeningSpec : C extends 'DOOR' ? DoorSpec : C extends 'WINDOW' ? WindowSpec : C extends 'PROXY' ? ProxySpec : C extends 'SPACE' ? SpaceSpec : C extends 'ROOF' ? RoofSpec : C extends 'CURTAIN_WALL' ? CurtainWallSpec : C extends 'FOOTING' ? FootingSpec : C extends 'PILE' ? PileSpec : C extends 'STAIR' ? StairSpec : C extends 'RAMP' ? RampSpec : C extends 'RAILING' ? RailingSpec : C extends 'COVERING' ? CoveringSpec : C extends 'ELEMENT_ASSEMBLY' ? ElementAssemblySpec : C extends 'ZONE' ? ZoneSpec : C extends 'SYSTEM' ? SystemSpec : C extends 'PROJECT' ? ProjectSpec : C extends 'SITE' ? SiteSpec : C extends 'BRIDGE' ? BridgeSpec : C extends 'BRIDGE_PART' ? BridgePartSpec : C extends 'EARTHWORKS_FILL' ? EarthworksFillSpec : C extends 'BUILDING' ? BuildingSpec : C extends 'STOREY' ? StoreySpec : never;
|
|
42
|
-
export type BimGeometryFor<C extends BimCategory> = C extends 'CURTAIN_WALL' ? CurtainWallGrid : C extends 'WALL' | 'SLAB' | 'BEAM' | 'COLUMN' | 'PROXY' | 'EARTHWORKS_FILL' | 'SPACE' | 'ROOF' | 'FOOTING' | 'PILE' | '
|
|
43
|
+
export type BimGeometryFor<C extends BimCategory> = C extends 'CURTAIN_WALL' ? CurtainWallGrid : C extends 'WALL' | 'RAILING' ? ProductBody : C extends 'SLAB' | 'BEAM' | 'COLUMN' | 'PROXY' | 'EARTHWORKS_FILL' | 'SPACE' | 'ROOF' | 'FOOTING' | 'PILE' | 'COVERING' ? ValidSolid : null;
|
|
43
44
|
export interface BimElement<C extends BimCategory> {
|
|
44
45
|
readonly guid: IfcGuid;
|
|
45
46
|
readonly localId: LocalId;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ValidSolid } from 'brepjs';
|
|
2
|
+
export type NonEmpty<T> = readonly [T, ...T[]];
|
|
3
|
+
export type ProductBody = {
|
|
4
|
+
readonly kind: 'PARAMETRIC';
|
|
5
|
+
readonly solid: ValidSolid;
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'EXACT';
|
|
8
|
+
readonly solids: NonEmpty<ValidSolid>;
|
|
9
|
+
};
|
|
10
|
+
/** Returns borrowed Product-local solids. The model retains ownership. */
|
|
11
|
+
export declare function bodySolids(body: ProductBody): NonEmpty<ValidSolid>;
|
|
12
|
+
/** Model-owner cleanup. Borrowers must use {@link bodySolids} without disposing its items. */
|
|
13
|
+
export declare function disposeProductBody(body: ProductBody): void;
|