@yschindel/ara3d-webgl 1.3.11 → 1.3.14
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 +2 -0
- package/dist/ara3d-webgl.mjs +5591 -5492
- package/dist/ara3d-webgl.mjs.map +1 -1
- package/dist/ara3d-webgl.umd.js +143 -143
- package/dist/ara3d-webgl.umd.js.map +1 -1
- package/dist/types/loader/BimParameterDescriptors.d.ts +7 -0
- package/dist/types/loader/BimParameterTable.d.ts +6 -0
- package/dist/types/loader/bimData.d.ts +16 -2
- package/dist/types/loader/bimGeometry.d.ts +1 -0
- package/dist/types/loader/bimOpenSchemaLoader.d.ts +15 -2
- package/dist/types/loader/bimQuery.d.ts +3 -1
- package/dist/types/loader/bimResolver.d.ts +24 -2
- package/dist/types/loader/buildGeometryGroup.d.ts +8 -1
- package/dist/types/loader/buildInstances.d.ts +1 -1
- package/package.json +5 -2
|
@@ -3,7 +3,10 @@ import { BimGeometry } from './bimGeometry';
|
|
|
3
3
|
import { Instance } from './buildInstances';
|
|
4
4
|
import { BimResolver } from './bimResolver';
|
|
5
5
|
import { BimQuery } from './bimQuery';
|
|
6
|
+
import { BuildGeometryOptions } from './buildGeometryGroup';
|
|
6
7
|
import { BimEntities } from './bimEntities';
|
|
8
|
+
import { BimParameterTable } from './BimParameterTable';
|
|
9
|
+
import { BimParameterDescriptors } from './BimParameterDescriptors';
|
|
7
10
|
export type EntityIndex = number & {
|
|
8
11
|
__brand: "EntityIndex";
|
|
9
12
|
};
|
|
@@ -13,6 +16,9 @@ export type StringIndex = number & {
|
|
|
13
16
|
export type InstanceIndex = number & {
|
|
14
17
|
__brand: "InstanceIndex";
|
|
15
18
|
};
|
|
19
|
+
export type DescriptorIndex = number & {
|
|
20
|
+
__brand: "InstanceIndex";
|
|
21
|
+
};
|
|
16
22
|
export declare class BimData {
|
|
17
23
|
BimGeometry: BimGeometry;
|
|
18
24
|
Entities: BimEntities;
|
|
@@ -20,6 +26,14 @@ export declare class BimData {
|
|
|
20
26
|
ThreeGeometry: THREE.Group;
|
|
21
27
|
Resolver: BimResolver;
|
|
22
28
|
Query: BimQuery;
|
|
23
|
-
Instances: Array<Instance>;
|
|
24
|
-
|
|
29
|
+
Instances: Array<Instance | undefined>;
|
|
30
|
+
Descriptors: BimParameterDescriptors;
|
|
31
|
+
IntegerParameters: BimParameterTable;
|
|
32
|
+
StringParameters: BimParameterTable;
|
|
33
|
+
EntityParameters: BimParameterTable;
|
|
34
|
+
SingleParameters: BimParameterTable;
|
|
35
|
+
PointParameters: BimParameterTable;
|
|
36
|
+
/** Options used when building geometry (stored for rebuildGeometry) */
|
|
37
|
+
geometryOptions: BuildGeometryOptions;
|
|
38
|
+
rebuildGeometry(instances: Array<Instance | undefined>): THREE.Group;
|
|
25
39
|
}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import JSZip from 'jszip';
|
|
2
2
|
import { BimData } from './bimData';
|
|
3
|
+
/**
|
|
4
|
+
* Options for loading BOS files
|
|
5
|
+
*/
|
|
6
|
+
export interface BosLoaderOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Whether to apply Z-up to Y-up rotation.
|
|
9
|
+
* - true: Apply rotation (for Revit exports which are Z-up)
|
|
10
|
+
* - false: No rotation (for IFC imports which are already Y-up compatible)
|
|
11
|
+
* Default: true (for backwards compatibility with Revit BOS files)
|
|
12
|
+
*/
|
|
13
|
+
applyZUpToYUpRotation?: boolean;
|
|
14
|
+
skipDescriptorsAndParameters?: boolean;
|
|
15
|
+
}
|
|
3
16
|
/**
|
|
4
17
|
* Loader that takes a URL to a .ZIP or .BOS file containing BIM Open Schema geometry parquet tables:
|
|
5
18
|
*/
|
|
6
19
|
export declare class BimOpenSchemaLoader {
|
|
7
|
-
load(source: string): Promise<BimData>;
|
|
20
|
+
load(source: string, options?: BosLoaderOptions): Promise<BimData>;
|
|
8
21
|
}
|
|
9
22
|
/**
|
|
10
23
|
* Reads the BOS parquet tables from a JSZip archive into a BimGeometry object.
|
|
11
24
|
* This is the same idea as the previous browser version, just using package imports.
|
|
12
25
|
*/
|
|
13
|
-
export declare function loadBimGeometryFromZip(zip: JSZip): Promise<BimData>;
|
|
26
|
+
export declare function loadBimGeometryFromZip(zip: JSZip, options?: BosLoaderOptions): Promise<BimData>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BimData } from './bimData';
|
|
2
|
-
import { BimResolver } from './bimResolver';
|
|
2
|
+
import { BimResolver, Parameter } from './bimResolver';
|
|
3
3
|
import { Instance } from './buildInstances';
|
|
4
4
|
export declare class BimQuery {
|
|
5
5
|
readonly Data: BimData;
|
|
@@ -8,4 +8,6 @@ export declare class BimQuery {
|
|
|
8
8
|
FuncToInstances(f: (i: Instance) => string): Map<string, Instance[]>;
|
|
9
9
|
CategoryToInstances(): Map<string, Instance[]>;
|
|
10
10
|
GlobalIdToInstances(): Map<string, Instance[]>;
|
|
11
|
+
GetLevelFromParameters(ps: Array<Parameter>): string;
|
|
12
|
+
LevelToInstances(): Map<string, Instance[]>;
|
|
11
13
|
}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
import { BimData, StringIndex, EntityIndex } from './bimData';
|
|
1
|
+
import { BimData, StringIndex, EntityIndex, InstanceIndex, DescriptorIndex } from './bimData';
|
|
2
2
|
import { BimEntities } from './bimEntities';
|
|
3
3
|
import { BimGeometry } from './bimGeometry';
|
|
4
|
+
import { BimParameterDescriptors } from './BimParameterDescriptors';
|
|
5
|
+
import { BimParameterTable } from './BimParameterTable';
|
|
4
6
|
import { Instance } from './buildInstances';
|
|
7
|
+
import { BosLoaderOptions } from './bimOpenSchemaLoader';
|
|
8
|
+
export type Parameter = {
|
|
9
|
+
Name: string;
|
|
10
|
+
Value: any;
|
|
11
|
+
};
|
|
5
12
|
export declare class BimResolver {
|
|
6
13
|
readonly Data: BimData;
|
|
7
|
-
constructor(Data: BimData);
|
|
14
|
+
constructor(Data: BimData, options?: BosLoaderOptions);
|
|
15
|
+
GetVal(rawVal: number, descType: number): any;
|
|
16
|
+
ProcessParameters(table: BimParameterTable): void;
|
|
17
|
+
readonly Descriptors: BimParameterDescriptors;
|
|
8
18
|
readonly Strings: Array<string>;
|
|
9
19
|
readonly Entities: BimEntities;
|
|
10
20
|
readonly InstanceCount: number;
|
|
11
21
|
readonly EntityCount: number;
|
|
12
22
|
readonly BimGeometry: BimGeometry;
|
|
23
|
+
readonly DescriptorCount: number;
|
|
24
|
+
readonly ParameterMap: Map<EntityIndex, Array<Parameter>>;
|
|
13
25
|
GetString(stringIndex: StringIndex): string;
|
|
14
26
|
GetEntityName(i: EntityIndex): string;
|
|
15
27
|
GetEntityCategory(i: EntityIndex): EntityIndex;
|
|
@@ -18,10 +30,20 @@ export declare class BimResolver {
|
|
|
18
30
|
GetEntityTypeName(i: EntityIndex): string;
|
|
19
31
|
GetEntityDocument(i: EntityIndex): EntityIndex;
|
|
20
32
|
GetEntityDocumentName(i: EntityIndex): string;
|
|
33
|
+
GetEntityParameters(i: EntityIndex): Array<Parameter>;
|
|
21
34
|
GetInstanceName(i: Instance): string;
|
|
22
35
|
GetInstanceCategoryName(i: Instance): string;
|
|
23
36
|
GetInstanceTypeName(i: Instance): string;
|
|
24
37
|
GetInstanceDocumentName(i: Instance): string;
|
|
25
38
|
GetInstanceGlobalId(i: Instance): string;
|
|
39
|
+
GetInstanceParameters(i: Instance): Array<Parameter>;
|
|
40
|
+
GetDescriptorName(i: DescriptorIndex): string;
|
|
41
|
+
GetDescriptorType(i: DescriptorIndex): number;
|
|
42
|
+
GetDescriptorGroup(i: DescriptorIndex): string;
|
|
43
|
+
GetDescriptorUnits(i: DescriptorIndex): string;
|
|
26
44
|
EntityIndices(): Iterable<EntityIndex>;
|
|
45
|
+
InstanceIndices(): Iterable<InstanceIndex>;
|
|
46
|
+
DescriptorIndices(): Iterable<DescriptorIndex>;
|
|
47
|
+
first<T>(iterable: Iterable<T>, predicate: (value: T) => boolean, _default: T): T;
|
|
48
|
+
FindDescriptor(name: string): DescriptorIndex;
|
|
27
49
|
}
|
|
@@ -5,7 +5,14 @@ type InstanceMaterialGroup = {
|
|
|
5
5
|
material: THREE.Material;
|
|
6
6
|
instances: Array<Instance>;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export interface BuildGeometryOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Whether to apply Z-up to Y-up rotation (-90° around X axis).
|
|
11
|
+
* Default: true
|
|
12
|
+
*/
|
|
13
|
+
applyZUpToYUpRotation?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function buildGeometry(instances: Array<Instance | undefined>, options?: BuildGeometryOptions): THREE.Group;
|
|
9
16
|
export declare function createMergedAndSingleMeshes(materialGroups: Array<InstanceMaterialGroup>): Array<THREE.Mesh>;
|
|
10
17
|
export declare function mergeGeometries(geometries: Array<THREE.BufferGeometry>): {
|
|
11
18
|
geometry: THREE.BufferGeometry;
|
|
@@ -9,5 +9,5 @@ export type Instance = {
|
|
|
9
9
|
material: THREE.Material;
|
|
10
10
|
transform: THREE.Matrix4;
|
|
11
11
|
};
|
|
12
|
-
export declare function buildInstances(bg: BimGeometry): Array<Instance>;
|
|
12
|
+
export declare function buildInstances(bg: BimGeometry): Array<Instance | undefined>;
|
|
13
13
|
export declare function computeTransforms(bim: BimGeometry): Array<THREE.Matrix4>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yschindel/ara3d-webgl",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.14",
|
|
4
4
|
"description": "A 3D viewer designed for large architectural (BIM) models built on top of Three.JS.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
"url": "https://github.com/yschindel/ara3d-webgl/issues"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"author": "
|
|
15
|
+
"author": "Yssentyl Technologies <contact@yssentyl.com>",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
16
19
|
"repository": {
|
|
17
20
|
"type": "git",
|
|
18
21
|
"url": "git+https://github.com/yschindel/ara3d-webgl.git"
|