From 2ef764d50daffa1c621ffe6208618f4c09057e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Gonz=C3=A1lez=20Viegas?= Date: Sat, 28 Sep 2024 12:03:15 +0200 Subject: [PATCH] feat: restructure repo and document core --- packages/clay/package.json | 2 + packages/clay/src/base/clay-object.ts | 14 - packages/clay/src/base/index.ts | 2 - .../Elements/DynamicElementType/index.ts | 26 +- .../Elements/Element/index.ts | 108 +++-- .../src/core/Elements/ElementType/index.ts | 51 ++ .../Elements/StaticElementType/index.ts | 30 +- .../src/{elements => core}/Elements/index.ts | 0 .../{geometries => core}/Geometry/index.ts | 64 ++- .../{base/model.ts => core/Model/index.ts} | 40 +- packages/clay/src/core/Object/index.ts | 26 ++ packages/clay/src/core/index.ts | 4 + .../CurtainWalls/SimpleCurtainWall/index.html | 330 ++++++------- .../CurtainWalls/SimpleCurtainWall/index.ts | 6 +- .../SimpleCurtainWall/src/index.ts | 6 +- .../elements/Elements/ElementType/index.ts | 30 -- .../Furniture/SimpleFurniture/index.html | 280 +++++------ .../Furniture/SimpleFurniture/index.ts | 6 +- .../Furniture/SimpleFurniture/src/index.ts | 6 +- .../elements/Members/SimpleMember/index.html | 212 ++++----- .../elements/Members/SimpleMember/index.ts | 6 +- .../Members/SimpleMember/src/index.ts | 6 +- .../Openings/SimpleOpening/index.html | 238 +++++----- .../elements/Openings/SimpleOpening/index.ts | 6 +- .../Openings/SimpleOpening/src/index.ts | 6 +- .../src/elements/Plates/SimplePlate/index.ts | 6 +- .../elements/Plates/SimplePlate/src/index.ts | 6 +- .../src/elements/Slabs/SimpleSlab/index.html | 228 ++++----- .../src/elements/Slabs/SimpleSlab/index.ts | 6 +- .../elements/Slabs/SimpleSlab/src/index.ts | 6 +- .../elements/Walls/SimpleWall/example.html | 67 +++ .../src/elements/Walls/SimpleWall/example.ts | 84 ++++ .../src/elements/Walls/SimpleWall/index.html | 434 +++++++++--------- .../src/elements/Walls/SimpleWall/index.ts | 5 +- .../elements/Walls/SimpleWall/src/index.ts | 414 +++++++++-------- .../elements/Windows/SimpleWindow/index.html | 256 +++++------ .../elements/Windows/SimpleWindow/index.ts | 6 +- .../Windows/SimpleWindow/src/index.ts | 6 +- packages/clay/src/geometries/Brep/index.ts | 4 +- .../clay/src/geometries/Extrusion/index.ts | 4 +- .../clay/src/geometries/HalfSpace/index.ts | 4 +- .../clay/src/geometries/MappedItems/index.ts | 4 +- .../Profiles/ArbitraryClosedProfile/index.ts | 2 +- .../src/geometries/Profiles/Profile/index.ts | 2 +- .../Profiles/RectangleProfile/index.ts | 2 +- packages/clay/src/index.ts | 2 +- packages/clay/src/primitives/Faces/index.html | 7 +- packages/clay/src/utils/ifc-utils.ts | 2 +- packages/clay/tsconfig.json | 3 +- yarn.lock | 255 +++++++++- 50 files changed, 1957 insertions(+), 1363 deletions(-) delete mode 100644 packages/clay/src/base/clay-object.ts delete mode 100644 packages/clay/src/base/index.ts rename packages/clay/src/{elements => core}/Elements/DynamicElementType/index.ts (62%) rename packages/clay/src/{elements => core}/Elements/Element/index.ts (67%) create mode 100644 packages/clay/src/core/Elements/ElementType/index.ts rename packages/clay/src/{elements => core}/Elements/StaticElementType/index.ts (52%) rename packages/clay/src/{elements => core}/Elements/index.ts (100%) rename packages/clay/src/{geometries => core}/Geometry/index.ts (65%) rename packages/clay/src/{base/model.ts => core/Model/index.ts} (65%) create mode 100644 packages/clay/src/core/Object/index.ts create mode 100644 packages/clay/src/core/index.ts delete mode 100644 packages/clay/src/elements/Elements/ElementType/index.ts create mode 100644 packages/clay/src/elements/Walls/SimpleWall/example.html create mode 100644 packages/clay/src/elements/Walls/SimpleWall/example.ts diff --git a/packages/clay/package.json b/packages/clay/package.json index 8b3befa..9a90e21 100644 --- a/packages/clay/package.json +++ b/packages/clay/package.json @@ -37,7 +37,9 @@ "access": "public" }, "devDependencies": { + "@thatopen/components": "^2.2.11", "@thatopen/fragments": "2.2.0", + "@thatopen/ui": "^2.2.2", "@types/earcut": "^2.1.4", "@types/jest": "27.0.0", "@types/node": "20.11.30", diff --git a/packages/clay/src/base/clay-object.ts b/packages/clay/src/base/clay-object.ts deleted file mode 100644 index 20d374e..0000000 --- a/packages/clay/src/base/clay-object.ts +++ /dev/null @@ -1,14 +0,0 @@ -import * as WEBIFC from "web-ifc"; -import { Model } from "./model"; - -export abstract class ClayObject { - model: Model; - - abstract attributes: WEBIFC.IfcLineObject; - - abstract update(): void; - - protected constructor(model: Model) { - this.model = model; - } -} diff --git a/packages/clay/src/base/index.ts b/packages/clay/src/base/index.ts deleted file mode 100644 index 5472fd8..0000000 --- a/packages/clay/src/base/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./clay-object"; -export * from "./model"; diff --git a/packages/clay/src/elements/Elements/DynamicElementType/index.ts b/packages/clay/src/core/Elements/DynamicElementType/index.ts similarity index 62% rename from packages/clay/src/elements/Elements/DynamicElementType/index.ts rename to packages/clay/src/core/Elements/DynamicElementType/index.ts index eac3b56..064c35f 100644 --- a/packages/clay/src/elements/Elements/DynamicElementType/index.ts +++ b/packages/clay/src/core/Elements/DynamicElementType/index.ts @@ -1,13 +1,22 @@ import * as THREE from "three"; import { IFC4X3 as IFC } from "web-ifc"; -import { Element } from "../Element"; -import { ElementType } from "../ElementType"; +import { ClayElement } from "../Element"; +import { ClayElementType } from "../ElementType"; -export abstract class DynamicElementType< - T extends Element, -> extends ElementType { +/** + * Dynamic variation of {@link ClayElementType}, used in types that need geometry control at the instance level. It's less efficient but more flexible than {@link StaticClayElementType}. + */ +export abstract class DynamicClayElementType< + T extends ClayElement, +> extends ClayElementType { + /** + * {@link ClayElementType.attributes} + */ abstract attributes: IFC.IfcElementType; + /** + * {@link ClayElementType.addInstance}. It creates a new fragment per instance, allowing for geometry control at the instance level. + */ addInstance(): T { const element = this.createElement(); const id = element.attributes.expressID; @@ -23,6 +32,9 @@ export abstract class DynamicElementType< return element; } + /** + * {@link ClayElementType.addInstance}. Deletes a specific fragment. + */ deleteInstance(id: number) { const element = this.elements.get(id); if (!element) { @@ -47,6 +59,10 @@ export abstract class DynamicElementType< } } + /** + * Updates all the elements of this type. + * @param updateGeometry whether to update the element geometries or not. Remember that in dynamic types, each element has a + */ update(updateGeometry = false) { for (const [_id, element] of this.elements) { element.update(updateGeometry); diff --git a/packages/clay/src/elements/Elements/Element/index.ts b/packages/clay/src/core/Elements/Element/index.ts similarity index 67% rename from packages/clay/src/elements/Elements/Element/index.ts rename to packages/clay/src/core/Elements/Element/index.ts index aae6069..41962dc 100644 --- a/packages/clay/src/elements/Elements/Element/index.ts +++ b/packages/clay/src/core/Elements/Element/index.ts @@ -1,26 +1,50 @@ import * as THREE from "three"; import * as FRAGS from "@thatopen/fragments"; -import * as WEBIFC from "web-ifc"; import { v4 as uuidv4 } from "uuid"; import { IFC4X3 as IFC } from "web-ifc"; -import { ClayObject, Model } from "../../../base"; -import { ElementType } from "../ElementType"; +import * as WEBIFC from "web-ifc"; +import { ClayObject } from "../../Object"; +import { Model } from "../../Model"; +import { ClayElementType } from "../ElementType"; import { IfcUtils } from "../../../utils/ifc-utils"; -import { SimpleOpening } from "../../Openings"; -export abstract class Element extends ClayObject { +/** + * Any object with a physical representation in the IFC. It corresponds to the IFCELEMENT entity in the IFC schema. + */ +export abstract class ClayElement extends ClayObject { + /** + * {@link ClayObject.attributes} + */ abstract attributes: IFC.IfcElement; + /** + * Position of this element in 3D space. + */ position = new THREE.Vector3(); + /** + * Rotation of this element in 3D space. + */ rotation = new THREE.Euler(); - type: ElementType; + /** + * The type of this element. + */ + type: ClayElementType; + /** + * The geometry IDs of this element. + */ geometries = new Set(); - openings = new Map(); + /** + * The list of IFC links to the Elements that create subtractions in this element. + */ + subtractions = new Map(); + /** + * The list of all meshes of the fragments that compose this element. + */ get meshes() { const meshes: FRAGS.FragmentMesh[] = []; for (const id of this.geometries) { @@ -33,11 +57,15 @@ export abstract class Element extends ClayObject { return meshes; } - protected constructor(model: Model, type: ElementType) { + protected constructor(model: Model, type: ClayElementType) { super(model); this.type = type; } + /** + * Updates this element both in the IFC model and in the 3D scene. + * @param updateGeometry whether to update the geometries of the fragments that compose this element. + */ update(updateGeometry = false) { this.updateIfcElement(); const modelID = this.model.modelID; @@ -75,46 +103,41 @@ export abstract class Element extends ClayObject { }); } - private updateIfcElement() { - const placement = this.model.get( - this.attributes.ObjectPlacement, - ) as IFC.IfcLocalPlacement; - - const relPlacement = this.model.get( - placement.RelativePlacement, - ) as IFC.IfcAxis2Placement3D; - - IfcUtils.setAxis2Placement( - this.model, - relPlacement, - this.position, - this.rotation, - ); - - this.model.set(this.attributes); - } + /** + * Adds a new subtraction to this element. + * @param subtraction the element that will be subtracted from this element. + */ + addSubtraction(subtraction: ClayElement) { + if (!(subtraction.attributes instanceof IFC.IfcFeatureElementSubtraction)) { + throw new Error( + "Only elements with attributes of type IfcFeatureElementSubtraction can be used to subtract", + ); + } - addOpening(opening: SimpleOpening) { const voids = new IFC.IfcRelVoidsElement( new IFC.IfcGloballyUniqueId(uuidv4()), null, null, null, this.attributes, - opening.attributes, + subtraction.attributes, ); this.model.set(voids); - const id = opening.attributes.expressID; - this.openings.set(id, voids); + const id = subtraction.attributes.expressID; + this.subtractions.set(id, voids); this.model.update(); } - removeOpening(opening: SimpleOpening) { - const id = opening.attributes.expressID; - const found = this.openings.get(id); + /** + * Removes an existing subtraction from this element. + * @param subtraction the element whose subtraction will be removed from this element. + */ + removeSubtraction(subtraction: ClayElement) { + const id = subtraction.attributes.expressID; + const found = this.subtractions.get(id); if (!found) return; this.model.delete(found); this.model.update(); @@ -150,4 +173,23 @@ export abstract class Element extends ClayObject { geometry.setIndex(Array.from(index)); return geometry as FRAGS.IndexedGeometry; } + + private updateIfcElement() { + const placement = this.model.get( + this.attributes.ObjectPlacement, + ) as IFC.IfcLocalPlacement; + + const relPlacement = this.model.get( + placement.RelativePlacement, + ) as IFC.IfcAxis2Placement3D; + + IfcUtils.setAxis2Placement( + this.model, + relPlacement, + this.position, + this.rotation, + ); + + this.model.set(this.attributes); + } } diff --git a/packages/clay/src/core/Elements/ElementType/index.ts b/packages/clay/src/core/Elements/ElementType/index.ts new file mode 100644 index 0000000..e9c020a --- /dev/null +++ b/packages/clay/src/core/Elements/ElementType/index.ts @@ -0,0 +1,51 @@ +import * as FRAGS from "@thatopen/fragments"; +import { IFC4X3 as IFC } from "web-ifc"; +import * as THREE from "three"; +import { ClayObject } from "../../Object"; +import { ClayGeometry } from "../../Geometry"; +import { ClayElement } from "../Element"; + +/** + * Base class of all element types in CLAY. In CLAY, types are the managers of instances. In other words: if you want to create a wall, you must first create a wall type, and then use it to create a wall instance. It manages all {@link ClayGeometry}, {@link ClayElement} and {@link FRAGS.Fragment} that belong to this type. It allows to create and delete element instances of this type. + */ +export abstract class ClayElementType< + T extends ClayElement = ClayElement, +> extends ClayObject { + /** + * The IFC data of this object type. + */ + abstract attributes: IFC.IfcElementType; + + /** + * All {@link ClayGeometry} that belong to elements of this type. + */ + geometries = new Map(); + + /** + * All {@link ClayElement} of this type. + */ + elements = new Map(); + + /** + * All {@link FRAGS.Fragment} that belong to elements of this type. + */ + fragments = new Map(); + + /** + * Adds a new instance of this type. + */ + abstract addInstance(): T; + + /** + * Deletes an existing instance of this type. + */ + abstract deleteInstance(id: number): void; + + protected newFragment() { + const geometry = new THREE.BufferGeometry(); + geometry.setIndex([]); + const fragment = new FRAGS.Fragment(geometry, this.model.material, 0); + fragment.mesh.frustumCulled = false; + return fragment; + } +} diff --git a/packages/clay/src/elements/Elements/StaticElementType/index.ts b/packages/clay/src/core/Elements/StaticElementType/index.ts similarity index 52% rename from packages/clay/src/elements/Elements/StaticElementType/index.ts rename to packages/clay/src/core/Elements/StaticElementType/index.ts index 101d0f2..3c75144 100644 --- a/packages/clay/src/elements/Elements/StaticElementType/index.ts +++ b/packages/clay/src/core/Elements/StaticElementType/index.ts @@ -1,15 +1,27 @@ import { IFC4X3 as IFC } from "web-ifc"; import * as THREE from "three"; -import { Element } from "../Element"; -import { ElementType } from "../ElementType"; +import { ClayElement } from "../Element"; +import { ClayElementType } from "../ElementType"; -export abstract class StaticElementType< - T extends Element, -> extends ElementType { +/** + * Static variation of {@link ClayElementType}, used in types that need geometry control at the type level. It's more efficient but less flexible than {@link StaticClayElementType}. + */ +export abstract class StaticClayElementType< + T extends ClayElement, +> extends ClayElementType { + /** + * {@link ClayElementType.attributes} + */ abstract attributes: IFC.IfcElementType; + /** + * The IFC data containing the geometries of this type (remember that all elements of static types share the same geometry). + */ abstract shape: IFC.IfcProductDefinitionShape; + /** + * {@link ClayElementType.addInstance}. It creates a new instance to the fragments shared by all elements. + */ addInstance(): T { const element = this.createElement(); const id = element.attributes.expressID; @@ -26,6 +38,9 @@ export abstract class StaticElementType< return element; } + /** + * {@link ClayElementType.addInstance}. Deletes a specific instance in the shared fragments. + */ deleteInstance(id: number) { const element = this.elements.get(id); if (!element) { @@ -40,9 +55,14 @@ export abstract class StaticElementType< } } + /** + * Updates all the elements of this type. + * @param updateGeometry whether to update the element geometries or not. Remember that in static types, all elements share the same geometries. + */ update(updateGeometry = false) { let first = updateGeometry; for (const [_id, element] of this.elements) { + // Geometry is shared, so only update it in first instance element.update(first); first = false; } diff --git a/packages/clay/src/elements/Elements/index.ts b/packages/clay/src/core/Elements/index.ts similarity index 100% rename from packages/clay/src/elements/Elements/index.ts rename to packages/clay/src/core/Elements/index.ts diff --git a/packages/clay/src/geometries/Geometry/index.ts b/packages/clay/src/core/Geometry/index.ts similarity index 65% rename from packages/clay/src/geometries/Geometry/index.ts rename to packages/clay/src/core/Geometry/index.ts index 60a74a7..30163df 100644 --- a/packages/clay/src/geometries/Geometry/index.ts +++ b/packages/clay/src/core/Geometry/index.ts @@ -1,17 +1,23 @@ -import { IFC4X3 as IFC, IfcLineObject } from "web-ifc"; -import { ClayObject } from "../../base"; +import { IFC4X3 as IFC } from "web-ifc"; +import { ClayObject } from "../Object"; +/** + * An object that represents an IFC geometry that can represent one or many IfcElements in 3D. It supports boolean operations. + */ export abstract class ClayGeometry extends ClayObject { + /** + * {@link ClayObject.attributes}. It can either be an IFC geometry, or the result of a boolean operation. + */ abstract attributes: | IFC.IfcGeometricRepresentationItem | IFC.IfcBooleanClippingResult; + /** + * The base IFC geometry of this object. If there are no boolean operations, it's the same as {@link ClayGeometry.attributes}. + */ abstract core: IFC.IfcGeometricRepresentationItem; - protected firstClipping: number | null = null; - protected lastClipping: number | null = null; - - clippings = new Map< + protected clippings = new Map< number, { previous: number | null; @@ -20,8 +26,28 @@ export abstract class ClayGeometry extends ClayObject { } >(); - delete() {} + protected firstClipping: number | null = null; + protected lastClipping: number | null = null; + + protected subtractedGeometriesToBools = new Map(); + + /** + * Deletes this geometry in the IFC model. + */ + delete() { + this.model.delete(this.core); + for (const [, { bool }] of this.clippings) { + this.model.delete(bool); + } + this.clippings.clear(); + this.subtractedGeometriesToBools.clear(); + } + + /** + * Adds a boolean subtraction to this geometry. + * @param geometry the geometry to subtract from this. + */ addSubtraction(geometry: ClayGeometry) { const item = geometry.attributes; @@ -62,10 +88,28 @@ export abstract class ClayGeometry extends ClayObject { this.attributes = bool; this.update(); + + this.subtractedGeometriesToBools.set( + geometry.attributes.expressID, + bool.expressID, + ); } - removeSubtraction(item: IFC.IfcBooleanOperand & IfcLineObject) { - const found = this.clippings.get(item.expressID); + /** + * Remove the specified geometry as subtraction (if it is a subtraction). + * @param geometry the geometry whose subtraction to remove. If this geometry is not a subtraction, nothing happens. + */ + removeSubtraction(geometry: ClayGeometry) { + const boolID = this.subtractedGeometriesToBools.get( + geometry.attributes.expressID, + ); + + if (boolID === undefined) { + // This geometry was not subtracted from this one + return; + } + + const found = this.clippings.get(boolID); if (!found) { return; } @@ -111,7 +155,7 @@ export abstract class ClayGeometry extends ClayObject { } // Remove bool - this.clippings.delete(item.expressID); + this.clippings.delete(boolID); this.model.delete(bool); this.update(); } diff --git a/packages/clay/src/base/model.ts b/packages/clay/src/core/Model/index.ts similarity index 65% rename from packages/clay/src/base/model.ts rename to packages/clay/src/core/Model/index.ts index 2b9f8a0..90ef6b2 100644 --- a/packages/clay/src/base/model.ts +++ b/packages/clay/src/core/Model/index.ts @@ -1,21 +1,35 @@ import * as THREE from "three"; import * as WEBIFC from "web-ifc"; -import { IfcLineObject } from "web-ifc"; +/** + * Object that represents an IFC model and manages all its data. + */ export class Model { + /** + * Opaque material of the model. All models have just 1 shared opaque and transparent material. + */ material = new THREE.MeshLambertMaterial(); + /** + * Transparent material of the model. All models have just 1 shared opaque and transparent material. + */ materialT = new THREE.MeshLambertMaterial({ transparent: true, opacity: 0.2, }); + /** + * The core of our libraries. It contains our IFC parser and geometry engine. + */ ifcAPI = new WEBIFC.IfcAPI(); private _context?: WEBIFC.IFC4X3.IfcRepresentationContext; private _modelID?: number; + /** + * The ID that identifies this IFC file. + */ get modelID() { if (this._modelID === undefined) { throw new Error("Model not initialized! Call the init() method."); @@ -23,6 +37,9 @@ export class Model { return this._modelID; } + /** + * The IFC context of this IFC file. + */ get context() { if (this._context === undefined) { throw new Error("Model not initialized! Call the init() method."); @@ -30,6 +47,9 @@ export class Model { return this._context; } + /** + * Initializes the library, allowing it to create and edit IFC data. + */ async init() { await this.ifcAPI.Init(); this._modelID = this.ifcAPI.CreateModel({ schema: WEBIFC.Schemas.IFC4X3 }); @@ -39,12 +59,21 @@ export class Model { ); } + /** + * Creates or overwrites an item in the IFC file. + * @param item the object to create or override. + */ set(item: WEBIFC.IfcLineObject) { this.ifcAPI.WriteLine(this.modelID, item); } + /** + * Deletes an item in the IFC file, and (optionally) all the items it references. + * @param item the object to delete. + * @param recursive whether to delete all items referenced by this item as well. + */ delete( - item: WEBIFC.IfcLineObject | WEBIFC.Handle | null, + item: WEBIFC.IfcLineObject | WEBIFC.Handle | null, recursive = false, ) { if (item === null) { @@ -71,6 +100,10 @@ export class Model { this.ifcAPI.DeleteLine(this.modelID, foundItem.expressID); } + /** + * Gets an object data. + * @param item the object whose data to get. + */ get(item: WEBIFC.Handle | T | null) { if (item === null) { throw new Error("Item not found!"); @@ -81,6 +114,9 @@ export class Model { return item; } + /** + * Updates a model. Necessary for applying new boolean operations. + */ update() { if (this._modelID === undefined) { throw new Error("Malformed model!"); diff --git a/packages/clay/src/core/Object/index.ts b/packages/clay/src/core/Object/index.ts new file mode 100644 index 0000000..546f9ae --- /dev/null +++ b/packages/clay/src/core/Object/index.ts @@ -0,0 +1,26 @@ +import * as WEBIFC from "web-ifc"; +import { Model } from "../Model"; + +/** + * Base object for all Clay classes. + */ +export abstract class ClayObject { + /** + * The IFC model this object belongs to. + */ + model: Model; + + /** + * The IFC data of this object. + */ + abstract attributes: WEBIFC.IfcLineObject; + + /** + * Update this object by overriding its data in the IFC model. + */ + abstract update(): void; + + protected constructor(model: Model) { + this.model = model; + } +} diff --git a/packages/clay/src/core/index.ts b/packages/clay/src/core/index.ts new file mode 100644 index 0000000..8e31264 --- /dev/null +++ b/packages/clay/src/core/index.ts @@ -0,0 +1,4 @@ +export * from "./Model"; +export * from "./Elements"; +export * from "./Geometry"; +export * from "./Object"; diff --git a/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/index.html b/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/index.html index 96380be..bfba4ca 100644 --- a/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/index.html +++ b/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/index.html @@ -1,166 +1,166 @@ - - - - - - - - - - Tools Component - - - -
- - - ---> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - gui.add(curtainWallType, "frameWidth").name("Frame Width").min(0.127).max(1).step(0.01).onChange(() => { - curtainWallType.update(true); - }); - - + + + + + diff --git a/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/index.ts b/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/index.ts index ed5a262..4a8cd37 100644 --- a/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/index.ts +++ b/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/index.ts @@ -1,9 +1,9 @@ import { IFC4X3, IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; import * as THREE from "three"; -import { Model } from "../../../base"; +import { Model, StaticClayElementType } from "../../../core"; import { IfcUtils } from "../../../utils/ifc-utils"; -import { StaticElementType } from "../../Elements"; + import { SimpleCurtainWall } from "./src"; import { SimpleMemberType } from "../../Members"; import { SimplePlateType } from "../../Plates"; @@ -12,7 +12,7 @@ import { SimplePlate } from "../../Plates/SimplePlate/src"; export * from "./src"; -export class SimpleCurtainWallType extends StaticElementType { +export class SimpleCurtainWallType extends StaticClayElementType { attributes: IFC4X3.IfcCurtainWallType; shape: IFC4X3.IfcProductDefinitionShape; diff --git a/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/src/index.ts b/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/src/index.ts index 2ae73c8..95e7620 100644 --- a/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/src/index.ts +++ b/packages/clay/src/elements/CurtainWalls/SimpleCurtainWall/src/index.ts @@ -1,11 +1,11 @@ import { IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; -import { Model } from "../../../../base"; +import { Model, ClayElement } from "../../../../core"; import { IfcUtils } from "../../../../utils/ifc-utils"; -import { Element } from "../../../Elements/Element"; + import { SimpleCurtainWallType } from "../index"; -export class SimpleCurtainWall extends Element { +export class SimpleCurtainWall extends ClayElement { attributes: IFC.IfcCurtainWall; type: SimpleCurtainWallType; diff --git a/packages/clay/src/elements/Elements/ElementType/index.ts b/packages/clay/src/elements/Elements/ElementType/index.ts deleted file mode 100644 index 1ef3421..0000000 --- a/packages/clay/src/elements/Elements/ElementType/index.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as FRAGS from "@thatopen/fragments"; -import { IFC4X3 as IFC } from "web-ifc"; -import * as THREE from "three"; -import { ClayObject } from "../../../base"; -import { ClayGeometry } from "../../../geometries/Geometry"; -import { Element } from "../Element"; - -export abstract class ElementType< - T extends Element = Element, -> extends ClayObject { - abstract attributes: IFC.IfcElementType; - - geometries = new Map(); - - elements = new Map(); - - fragments = new Map(); - - abstract addInstance(): T; - - abstract deleteInstance(id: number): void; - - protected newFragment() { - const geometry = new THREE.BufferGeometry(); - geometry.setIndex([]); - const fragment = new FRAGS.Fragment(geometry, this.model.material, 0); - fragment.mesh.frustumCulled = false; - return fragment; - } -} diff --git a/packages/clay/src/elements/Furniture/SimpleFurniture/index.html b/packages/clay/src/elements/Furniture/SimpleFurniture/index.html index c8adff7..cf424dc 100644 --- a/packages/clay/src/elements/Furniture/SimpleFurniture/index.html +++ b/packages/clay/src/elements/Furniture/SimpleFurniture/index.html @@ -1,140 +1,140 @@ - - - - - - - - - - Tools Component - - - -
- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/clay/src/elements/Furniture/SimpleFurniture/index.ts b/packages/clay/src/elements/Furniture/SimpleFurniture/index.ts index 0632458..4cf0d79 100644 --- a/packages/clay/src/elements/Furniture/SimpleFurniture/index.ts +++ b/packages/clay/src/elements/Furniture/SimpleFurniture/index.ts @@ -1,14 +1,14 @@ import { IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; -import { Model } from "../../../base"; -import { StaticElementType } from "../../Elements/StaticElementType"; +import { Model, StaticClayElementType } from "../../../core"; + import { SimpleFurniture } from "./src"; import { Brep } from "../../../geometries"; import { IfcUtils } from "../../../utils/ifc-utils"; export * from "./src"; -export class SimpleFurnitureType extends StaticElementType { +export class SimpleFurnitureType extends StaticClayElementType { attributes: IFC.IfcFurnishingElementType; shape: IFC.IfcProductDefinitionShape; diff --git a/packages/clay/src/elements/Furniture/SimpleFurniture/src/index.ts b/packages/clay/src/elements/Furniture/SimpleFurniture/src/index.ts index 5f09212..a77477a 100644 --- a/packages/clay/src/elements/Furniture/SimpleFurniture/src/index.ts +++ b/packages/clay/src/elements/Furniture/SimpleFurniture/src/index.ts @@ -1,11 +1,11 @@ import { IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; -import { Model } from "../../../../base"; +import { Model, ClayElement } from "../../../../core"; import { IfcUtils } from "../../../../utils/ifc-utils"; -import { Element } from "../../../Elements/Element"; + import { SimpleFurnitureType } from "../index"; -export class SimpleFurniture extends Element { +export class SimpleFurniture extends ClayElement { attributes: IFC.IfcFurnishingElement; type: SimpleFurnitureType; diff --git a/packages/clay/src/elements/Members/SimpleMember/index.html b/packages/clay/src/elements/Members/SimpleMember/index.html index 81f2aef..02076a7 100644 --- a/packages/clay/src/elements/Members/SimpleMember/index.html +++ b/packages/clay/src/elements/Members/SimpleMember/index.html @@ -1,106 +1,106 @@ - - - - - - - - - - Tools Component - - - -
- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/clay/src/elements/Members/SimpleMember/index.ts b/packages/clay/src/elements/Members/SimpleMember/index.ts index 81502e4..bd9360e 100644 --- a/packages/clay/src/elements/Members/SimpleMember/index.ts +++ b/packages/clay/src/elements/Members/SimpleMember/index.ts @@ -1,10 +1,10 @@ import { v4 as uuidv4 } from "uuid"; import { IFC4X3 as IFC } from "web-ifc"; -import { Model } from "../../../base"; -import { DynamicElementType } from "../../Elements"; +import { Model, DynamicClayElementType } from "../../../core"; + import { SimpleMember } from "./src"; -export class SimpleMemberType extends DynamicElementType { +export class SimpleMemberType extends DynamicClayElementType { attributes: IFC.IfcMemberType; memberType: IFC.IfcMemberTypeEnum; diff --git a/packages/clay/src/elements/Members/SimpleMember/src/index.ts b/packages/clay/src/elements/Members/SimpleMember/src/index.ts index 387bf53..febb9f9 100644 --- a/packages/clay/src/elements/Members/SimpleMember/src/index.ts +++ b/packages/clay/src/elements/Members/SimpleMember/src/index.ts @@ -1,13 +1,13 @@ import { IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; import * as THREE from "three"; -import { Element } from "../../../Elements"; -import { Model } from "../../../../base"; +import { ClayElement, Model } from "../../../../core"; + import { SimpleMemberType } from ".."; import { IfcUtils } from "../../../../utils/ifc-utils"; import { Extrusion, RectangleProfile } from "../../../../geometries"; -export class SimpleMember extends Element { +export class SimpleMember extends ClayElement { attributes: IFC.IfcMember; body: Extrusion; diff --git a/packages/clay/src/elements/Openings/SimpleOpening/index.html b/packages/clay/src/elements/Openings/SimpleOpening/index.html index e8a3e6a..a282334 100644 --- a/packages/clay/src/elements/Openings/SimpleOpening/index.html +++ b/packages/clay/src/elements/Openings/SimpleOpening/index.html @@ -1,119 +1,119 @@ - - - - - - - - - - Tools Component - - - -
- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/clay/src/elements/Openings/SimpleOpening/index.ts b/packages/clay/src/elements/Openings/SimpleOpening/index.ts index 2f97b41..a4f2c0a 100644 --- a/packages/clay/src/elements/Openings/SimpleOpening/index.ts +++ b/packages/clay/src/elements/Openings/SimpleOpening/index.ts @@ -1,14 +1,14 @@ import { IFC4X3, IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; -import { StaticElementType } from "../../Elements/StaticElementType"; +import { StaticClayElementType, Model } from "../../../core"; import { SimpleOpening } from "./src"; import { Extrusion, RectangleProfile } from "../../../geometries"; -import { Model } from "../../../base"; + import { IfcUtils } from "../../../utils/ifc-utils"; export * from "./src"; -export class SimpleOpeningType extends StaticElementType { +export class SimpleOpeningType extends StaticClayElementType { attributes: IFC4X3.IfcElementType; shape: IFC4X3.IfcProductDefinitionShape; diff --git a/packages/clay/src/elements/Openings/SimpleOpening/src/index.ts b/packages/clay/src/elements/Openings/SimpleOpening/src/index.ts index 11d5050..eb38a92 100644 --- a/packages/clay/src/elements/Openings/SimpleOpening/src/index.ts +++ b/packages/clay/src/elements/Openings/SimpleOpening/src/index.ts @@ -1,11 +1,11 @@ import { IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; -import { Element } from "../../../Elements/Element"; +import { ClayElement, Model } from "../../../../core"; import { SimpleOpeningType } from "../index"; -import { Model } from "../../../../base"; + import { IfcUtils } from "../../../../utils/ifc-utils"; -export class SimpleOpening extends Element { +export class SimpleOpening extends ClayElement { attributes: IFC.IfcOpeningElement; type: SimpleOpeningType; diff --git a/packages/clay/src/elements/Plates/SimplePlate/index.ts b/packages/clay/src/elements/Plates/SimplePlate/index.ts index f1541d8..0180880 100644 --- a/packages/clay/src/elements/Plates/SimplePlate/index.ts +++ b/packages/clay/src/elements/Plates/SimplePlate/index.ts @@ -1,10 +1,10 @@ import { v4 as uuidv4 } from "uuid"; import { IFC4X3 as IFC } from "web-ifc"; -import { Model } from "../../../base"; -import { DynamicElementType } from "../../Elements"; +import { Model, DynamicClayElementType } from "../../../core"; + import { SimplePlate } from "./src"; -export class SimplePlateType extends DynamicElementType { +export class SimplePlateType extends DynamicClayElementType { attributes: IFC.IfcPlateType; plateType: IFC.IfcPlateTypeEnum; diff --git a/packages/clay/src/elements/Plates/SimplePlate/src/index.ts b/packages/clay/src/elements/Plates/SimplePlate/src/index.ts index 91c7386..726edea 100644 --- a/packages/clay/src/elements/Plates/SimplePlate/src/index.ts +++ b/packages/clay/src/elements/Plates/SimplePlate/src/index.ts @@ -1,13 +1,13 @@ import { IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; import * as THREE from "three"; -import { Element } from "../../../Elements"; -import { Model } from "../../../../base"; +import { ClayElement, Model } from "../../../../core"; + import { SimplePlateType } from ".."; import { IfcUtils } from "../../../../utils/ifc-utils"; import { Extrusion, RectangleProfile } from "../../../../geometries"; -export class SimplePlate extends Element { +export class SimplePlate extends ClayElement { attributes: IFC.IfcPlate; body: Extrusion; diff --git a/packages/clay/src/elements/Slabs/SimpleSlab/index.html b/packages/clay/src/elements/Slabs/SimpleSlab/index.html index 0989bde..70fb39d 100644 --- a/packages/clay/src/elements/Slabs/SimpleSlab/index.html +++ b/packages/clay/src/elements/Slabs/SimpleSlab/index.html @@ -1,114 +1,114 @@ - - - - - - - - - - Tools Component - - - -
- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/clay/src/elements/Slabs/SimpleSlab/index.ts b/packages/clay/src/elements/Slabs/SimpleSlab/index.ts index 1c1eee7..7e2ffb1 100644 --- a/packages/clay/src/elements/Slabs/SimpleSlab/index.ts +++ b/packages/clay/src/elements/Slabs/SimpleSlab/index.ts @@ -1,12 +1,12 @@ import { v4 as uuidv4 } from "uuid"; import { IFC4X3, IFC4X3 as IFC } from "web-ifc"; -import { Model } from "../../../base"; -import { DynamicElementType } from "../../Elements"; +import { Model, DynamicClayElementType } from "../../../core"; + import { SimpleSlab } from "./src"; export * from "./src"; -export class SimpleSlabType extends DynamicElementType { +export class SimpleSlabType extends DynamicClayElementType { attributes: IFC4X3.IfcSlabType; constructor(model: Model) { diff --git a/packages/clay/src/elements/Slabs/SimpleSlab/src/index.ts b/packages/clay/src/elements/Slabs/SimpleSlab/src/index.ts index 31b2a83..b5ef401 100644 --- a/packages/clay/src/elements/Slabs/SimpleSlab/src/index.ts +++ b/packages/clay/src/elements/Slabs/SimpleSlab/src/index.ts @@ -1,13 +1,13 @@ import { v4 as uuidv4 } from "uuid"; import { IFC4X3 as IFC } from "web-ifc"; -import { Model } from "../../../../base"; +import { Model, ClayElement } from "../../../../core"; import { IfcUtils } from "../../../../utils/ifc-utils"; -import { Element } from "../../../Elements"; + import { SimpleSlabType } from "../index"; import { Extrusion } from "../../../../geometries"; import { ArbitraryClosedProfile } from "../../../../geometries/Profiles/ArbitraryClosedProfile"; -export class SimpleSlab extends Element { +export class SimpleSlab extends ClayElement { attributes: IFC.IfcSlab; type: SimpleSlabType; diff --git a/packages/clay/src/elements/Walls/SimpleWall/example.html b/packages/clay/src/elements/Walls/SimpleWall/example.html new file mode 100644 index 0000000..877dce8 --- /dev/null +++ b/packages/clay/src/elements/Walls/SimpleWall/example.html @@ -0,0 +1,67 @@ + + + + + + + + + + + Simple Walls + + + + +
+ + + + \ No newline at end of file diff --git a/packages/clay/src/elements/Walls/SimpleWall/example.ts b/packages/clay/src/elements/Walls/SimpleWall/example.ts new file mode 100644 index 0000000..792238b --- /dev/null +++ b/packages/clay/src/elements/Walls/SimpleWall/example.ts @@ -0,0 +1,84 @@ +import * as THREE from "three"; +import * as BUI from "@thatopen/ui"; +import Stats from "stats.js"; +import * as OBC from "@thatopen/components"; + +import * as CLAY from "../../.."; + +const container = document.getElementById("container")!; + +const components = new OBC.Components(); + +const worlds = components.get(OBC.Worlds); + +const world = worlds.create< + OBC.SimpleScene, + OBC.SimpleCamera, + OBC.SimpleRenderer +>(); + +world.scene = new OBC.SimpleScene(components); +world.renderer = new OBC.SimpleRenderer(components, container); +world.camera = new OBC.SimpleCamera(components); + +components.init(); +world.scene.setup(); +world.scene.three.background = null; + +const grids = components.get(OBC.Grids); +grids.create(world); + +const model = new CLAY.Model(); +model.ifcAPI.SetWasmPath("https://unpkg.com/web-ifc@0.0.59/", true); +await model.init(); + +const simpleWallType = new CLAY.SimpleWallType(model); +const wall1 = simpleWallType.addInstance(); +world.scene.three.add(...wall1.meshes); + +wall1.startPoint = new THREE.Vector3(1, 1, 0); +wall1.endPoint = new THREE.Vector3(-1, -1, 0); +wall1.update(true); + +// Stats + +const stats = new Stats(); +stats.showPanel(2); +document.body.append(stats.dom); +stats.dom.style.left = "0px"; +stats.dom.style.zIndex = "unset"; + +world.renderer.onBeforeUpdate.add(() => stats.begin()); +world.renderer.onAfterUpdate.add(() => stats.end()); + +// UI + +BUI.Manager.init(); + +const panel = BUI.Component.create(() => { + return BUI.html` + + + + + + `; +}); + +document.body.append(panel); + +const button = BUI.Component.create(() => { + return BUI.html` + + + `; +}); + +document.body.append(button); diff --git a/packages/clay/src/elements/Walls/SimpleWall/index.html b/packages/clay/src/elements/Walls/SimpleWall/index.html index 3758685..f26c8a2 100644 --- a/packages/clay/src/elements/Walls/SimpleWall/index.html +++ b/packages/clay/src/elements/Walls/SimpleWall/index.html @@ -1,217 +1,217 @@ - - - - - - - - - - Tools Component - - - -
- - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/clay/src/elements/Walls/SimpleWall/index.ts b/packages/clay/src/elements/Walls/SimpleWall/index.ts index 0097e72..c101b03 100644 --- a/packages/clay/src/elements/Walls/SimpleWall/index.ts +++ b/packages/clay/src/elements/Walls/SimpleWall/index.ts @@ -1,12 +1,11 @@ import { v4 as uuidv4 } from "uuid"; import { IFC4X3, IFC4X3 as IFC } from "web-ifc"; -import { Model } from "../../../base"; -import { DynamicElementType } from "../../Elements"; +import { Model, DynamicClayElementType } from "../../../core"; import { SimpleWall } from "./src"; export * from "./src"; -export class SimpleWallType extends DynamicElementType { +export class SimpleWallType extends DynamicClayElementType { attributes: IFC4X3.IfcWallType; width = 0.2; diff --git a/packages/clay/src/elements/Walls/SimpleWall/src/index.ts b/packages/clay/src/elements/Walls/SimpleWall/src/index.ts index c604d85..f6655fe 100644 --- a/packages/clay/src/elements/Walls/SimpleWall/src/index.ts +++ b/packages/clay/src/elements/Walls/SimpleWall/src/index.ts @@ -2,15 +2,13 @@ import * as THREE from "three"; import * as FRAGS from "@thatopen/fragments"; import { v4 as uuidv4 } from "uuid"; import { IFC4X3 as IFC } from "web-ifc"; -import { Model } from "../../../../base"; +import { Model, ClayElement, ClayGeometry } from "../../../../core"; import { IfcUtils } from "../../../../utils/ifc-utils"; -import { Element } from "../../../Elements"; + import { Extrusion, HalfSpace, RectangleProfile } from "../../../../geometries"; import { SimpleWallType } from "../index"; -import { SimpleOpening } from "../../../Openings"; -import { ClayGeometry } from "../../../../geometries/Geometry"; -export class SimpleWall extends Element { +export class SimpleWall extends ClayElement { attributes: IFC.IfcWall; type: SimpleWallType; @@ -25,13 +23,13 @@ export class SimpleWall extends Element { private _openings = new Map< number, - { opening: SimpleOpening; distance: number } + { opening: ClayElement; distance: number } >(); - private _corners = new Map< - number, - { wall: SimpleWall; atTheEndPoint: boolean } - >(); + // private _corners = new Map< + // number, + // { wall: SimpleWall; atTheEndPoint: boolean } + // >(); _halfSpaces = new Map(); @@ -84,7 +82,7 @@ export class SimpleWall extends Element { this.model.set(this.attributes); } - update(updateGeometry: boolean = false, updateCorners = false) { + update(updateGeometry: boolean = false) { this.updateAllOpenings(); const profile = this.body.profile; @@ -107,216 +105,216 @@ export class SimpleWall extends Element { this.updateGeometryID(); super.update(updateGeometry); - if (updateCorners) this.updateAllCorners(); - } - - extend(wall: SimpleWall, atTheEndPoint = true) { - const zDirection = new THREE.Vector3(0, 0, 1); - const normalVector = wall.direction.cross(zDirection); - const correctedNormalVector = new THREE.Vector3( - normalVector.x, - normalVector.z, - normalVector.y * -1, - ); - - const coplanarPoint = new THREE.Vector3( - wall.startPoint.x, - wall.startPoint.z, - wall.startPoint.y * -1, - ); - - const plane = new THREE.Plane().setFromNormalAndCoplanarPoint( - correctedNormalVector, - coplanarPoint, - ); - - const correctedDirection = new THREE.Vector3( - this.direction.x * -1, - this.direction.z, - this.direction.y, - ); - - if (atTheEndPoint) correctedDirection.negate(); - - const origin = atTheEndPoint ? this.startPoint : this.endPoint; - - const rayOriginPoint = new THREE.Vector3(origin.x, origin.z, origin.y * -1); - - const rayAxisWall1 = new THREE.Ray(rayOriginPoint, correctedDirection); - const intersectionPoint = rayAxisWall1.intersectPlane( - plane, - new THREE.Vector3(), - ); - - if (intersectionPoint) { - const correctedIntersectionPoint = new THREE.Vector3( - intersectionPoint?.x, - intersectionPoint?.z * -1, - intersectionPoint?.y, - ); - - wall.update(true); - this.update(true); - - return correctedIntersectionPoint; - } - return null; - } - - private calculateDistances( - wall: SimpleWall, - atTheEndPoint: boolean, - intersectionPoint: THREE.Vector3, - ) { - const distance1 = this.midPoint.distanceTo(intersectionPoint); - const distance2 = wall.midPoint.distanceTo(intersectionPoint); - - const distance3 = this.startPoint.distanceTo(this.midPoint); - const distance4 = this.startPoint.distanceTo(intersectionPoint); - - const distance5 = wall.startPoint.distanceTo(wall.midPoint); - const distance6 = wall.startPoint.distanceTo(intersectionPoint); - - let sign1 = 1; - let sign2 = 1; - - if (distance3 <= distance4 && distance5 <= distance6) { - sign1 = atTheEndPoint ? 1 : -1; - sign2 = atTheEndPoint ? 1 : -1; - } else if (distance3 >= distance4 && distance5 >= distance6) { - sign1 = -1; - sign2 = -1; - } else if (distance3 >= distance4 && distance5 <= distance6) { - sign1 = 1; - sign2 = -1; - } else if (distance3 < distance4 && distance5 > distance6) { - sign1 = -1; - sign2 = 1; - } - - const sign3 = atTheEndPoint ? 1 : -1; - - return { - distance1, - distance2, - sign1, - sign2, - sign3, - }; - } - - private updateAllCorners() { - for (const [_id, { wall, atTheEndPoint }] of this._corners) { - const intersectionPoint = this.extend(wall, atTheEndPoint); - if (!intersectionPoint) return; - - const angle = wall.rotation.z - this.rotation.z; - - const width1 = this.type.width; - const width2 = wall.type.width; - - const { distance1, distance2, sign1, sign2, sign3 } = - this.calculateDistances(wall, atTheEndPoint, intersectionPoint); - - for (const [_id, { halfSpace }] of wall._halfSpaces) { - halfSpace.position.x = - sign2 * distance1 + width1 / (2 * Math.sin(angle)); - halfSpace.rotation.y = sign3 * angle; - halfSpace.rotation.x = (sign3 * Math.PI) / 2; - halfSpace.update(); - } - - for (const [_id, { halfSpace }] of this._halfSpaces) { - halfSpace.position.x = - sign1 * distance2 + width2 / (2 * Math.sin(angle)); - halfSpace.rotation.y = angle; - halfSpace.rotation.x = -Math.PI / 2; - halfSpace.update(); - } - - wall.update(true); - } - this.update(true); - } - - addCorner(wall: SimpleWall, atTheEndPoint = true) { - const intersectionPoint = this.extend(wall, atTheEndPoint); - - if (!intersectionPoint) return; - - const angle = wall.rotation.z - this.rotation.z; - - const width1 = this.type.width; - const width2 = wall.type.width; - - const { distance1, distance2, sign1, sign2, sign3 } = - this.calculateDistances(wall, atTheEndPoint, intersectionPoint); - - const hsExteriorWall1 = new HalfSpace(this.model); - hsExteriorWall1.position.x = - sign1 * distance2 + width2 / (2 * Math.sin(angle)); - hsExteriorWall1.rotation.y = angle; - hsExteriorWall1.rotation.x = -Math.PI / 2; - hsExteriorWall1.update(); - - const hsInteriorWall2 = new HalfSpace(this.model); - hsInteriorWall2.position.x = - sign2 * distance1 + width1 / (2 * Math.sin(angle)); - hsInteriorWall2.rotation.y = sign3 * angle; - hsInteriorWall2.rotation.x = (sign3 * Math.PI) / 2; - hsInteriorWall2.update(); - - this.body.addSubtraction(hsInteriorWall2); - wall.body.addSubtraction(hsExteriorWall1); - - wall.update(true); - this.update(true); - - this._corners.set(wall.attributes.expressID, { - wall, - atTheEndPoint, - }); - - wall._corners.set(this.attributes.expressID, { - wall: this, - atTheEndPoint, - }); - - const hsInteriorWall2Id = hsInteriorWall2.attributes.expressID; - const hsExteriorWall1Id = hsExteriorWall1.attributes.expressID; - - wall._halfSpaces.set(hsInteriorWall2Id, { - halfSpace: hsInteriorWall2, - }); - - this._halfSpaces.set(hsExteriorWall1Id, { - halfSpace: hsExteriorWall1, - }); + // if (updateCorners) this.updateAllCorners(); } - addOpening(opening: SimpleOpening) { - super.addOpening(opening); - this.setOpening(opening); + // extend(wall: SimpleWall, atTheEndPoint = true) { + // const zDirection = new THREE.Vector3(0, 0, 1); + // const normalVector = wall.direction.cross(zDirection); + // const correctedNormalVector = new THREE.Vector3( + // normalVector.x, + // normalVector.z, + // normalVector.y * -1, + // ); + // + // const coplanarPoint = new THREE.Vector3( + // wall.startPoint.x, + // wall.startPoint.z, + // wall.startPoint.y * -1, + // ); + // + // const plane = new THREE.Plane().setFromNormalAndCoplanarPoint( + // correctedNormalVector, + // coplanarPoint, + // ); + // + // const correctedDirection = new THREE.Vector3( + // this.direction.x * -1, + // this.direction.z, + // this.direction.y, + // ); + // + // if (atTheEndPoint) correctedDirection.negate(); + // + // const origin = atTheEndPoint ? this.startPoint : this.endPoint; + // + // const rayOriginPoint = new THREE.Vector3(origin.x, origin.z, origin.y * -1); + // + // const rayAxisWall1 = new THREE.Ray(rayOriginPoint, correctedDirection); + // const intersectionPoint = rayAxisWall1.intersectPlane( + // plane, + // new THREE.Vector3(), + // ); + // + // if (intersectionPoint) { + // const correctedIntersectionPoint = new THREE.Vector3( + // intersectionPoint?.x, + // intersectionPoint?.z * -1, + // intersectionPoint?.y, + // ); + // + // wall.update(true); + // this.update(true); + // + // return correctedIntersectionPoint; + // } + // return null; + // } + + // private calculateDistances( + // wall: SimpleWall, + // atTheEndPoint: boolean, + // intersectionPoint: THREE.Vector3, + // ) { + // const distance1 = this.midPoint.distanceTo(intersectionPoint); + // const distance2 = wall.midPoint.distanceTo(intersectionPoint); + // + // const distance3 = this.startPoint.distanceTo(this.midPoint); + // const distance4 = this.startPoint.distanceTo(intersectionPoint); + // + // const distance5 = wall.startPoint.distanceTo(wall.midPoint); + // const distance6 = wall.startPoint.distanceTo(intersectionPoint); + // + // let sign1 = 1; + // let sign2 = 1; + // + // if (distance3 <= distance4 && distance5 <= distance6) { + // sign1 = atTheEndPoint ? 1 : -1; + // sign2 = atTheEndPoint ? 1 : -1; + // } else if (distance3 >= distance4 && distance5 >= distance6) { + // sign1 = -1; + // sign2 = -1; + // } else if (distance3 >= distance4 && distance5 <= distance6) { + // sign1 = 1; + // sign2 = -1; + // } else if (distance3 < distance4 && distance5 > distance6) { + // sign1 = -1; + // sign2 = 1; + // } + // + // const sign3 = atTheEndPoint ? 1 : -1; + // + // return { + // distance1, + // distance2, + // sign1, + // sign2, + // sign3, + // }; + // } + + // private updateAllCorners() { + // for (const [_id, { wall, atTheEndPoint }] of this._corners) { + // const intersectionPoint = this.extend(wall, atTheEndPoint); + // if (!intersectionPoint) return; + // + // const angle = wall.rotation.z - this.rotation.z; + // + // const width1 = this.type.width; + // const width2 = wall.type.width; + // + // const { distance1, distance2, sign1, sign2, sign3 } = + // this.calculateDistances(wall, atTheEndPoint, intersectionPoint); + // + // for (const [_id, { halfSpace }] of wall._halfSpaces) { + // halfSpace.position.x = + // sign2 * distance1 + width1 / (2 * Math.sin(angle)); + // halfSpace.rotation.y = sign3 * angle; + // halfSpace.rotation.x = (sign3 * Math.PI) / 2; + // halfSpace.update(); + // } + // + // for (const [_id, { halfSpace }] of this._halfSpaces) { + // halfSpace.position.x = + // sign1 * distance2 + width2 / (2 * Math.sin(angle)); + // halfSpace.rotation.y = angle; + // halfSpace.rotation.x = -Math.PI / 2; + // halfSpace.update(); + // } + // + // wall.update(true); + // } + // this.update(true); + // } + + // addCorner(wall: SimpleWall, atTheEndPoint = true) { + // const intersectionPoint = this.extend(wall, atTheEndPoint); + // + // if (!intersectionPoint) return; + // + // const angle = wall.rotation.z - this.rotation.z; + // + // const width1 = this.type.width; + // const width2 = wall.type.width; + // + // const { distance1, distance2, sign1, sign2, sign3 } = + // this.calculateDistances(wall, atTheEndPoint, intersectionPoint); + // + // const hsExteriorWall1 = new HalfSpace(this.model); + // hsExteriorWall1.position.x = + // sign1 * distance2 + width2 / (2 * Math.sin(angle)); + // hsExteriorWall1.rotation.y = angle; + // hsExteriorWall1.rotation.x = -Math.PI / 2; + // hsExteriorWall1.update(); + // + // const hsInteriorWall2 = new HalfSpace(this.model); + // hsInteriorWall2.position.x = + // sign2 * distance1 + width1 / (2 * Math.sin(angle)); + // hsInteriorWall2.rotation.y = sign3 * angle; + // hsInteriorWall2.rotation.x = (sign3 * Math.PI) / 2; + // hsInteriorWall2.update(); + // + // this.body.addSubtraction(hsInteriorWall2); + // wall.body.addSubtraction(hsExteriorWall1); + // + // wall.update(true); + // this.update(true); + // + // this._corners.set(wall.attributes.expressID, { + // wall, + // atTheEndPoint, + // }); + // + // wall._corners.set(this.attributes.expressID, { + // wall: this, + // atTheEndPoint, + // }); + // + // const hsInteriorWall2Id = hsInteriorWall2.attributes.expressID; + // const hsExteriorWall1Id = hsExteriorWall1.attributes.expressID; + // + // wall._halfSpaces.set(hsInteriorWall2Id, { + // halfSpace: hsInteriorWall2, + // }); + // + // this._halfSpaces.set(hsExteriorWall1Id, { + // halfSpace: hsExteriorWall1, + // }); + // } + + addSubtraction(element: ClayElement) { + super.addSubtraction(element); + this.setSubtraction(element); this.updateGeometryID(); } - removeOpening(opening: SimpleOpening) { - super.removeOpening(opening); - this._openings.delete(opening.attributes.expressID); + removeSubtraction(element: ClayElement) { + super.removeSubtraction(element); + this._openings.delete(element.attributes.expressID); this.updateGeometryID(); } - setOpening(opening: SimpleOpening) { + setSubtraction(element: ClayElement) { const wallPlane = new THREE.Plane(); const tempPoint = this.startPoint.clone(); tempPoint.z += 1; wallPlane.setFromCoplanarPoints(tempPoint, this.startPoint, this.endPoint); const newPosition = new THREE.Vector3(); - wallPlane.projectPoint(opening.position, newPosition); + wallPlane.projectPoint(element.position, newPosition); - opening.position.copy(newPosition); - opening.update(); + element.position.copy(newPosition); + element.update(); // The distance is signed, so that it also supports openings that are // before the startPoint by using the dot product @@ -326,9 +324,9 @@ export class SimpleWall extends Element { const dotProduct = vector.dot(this.direction); distance *= dotProduct > 0 ? 1 : -1; - const id = opening.attributes.expressID; + const id = element.attributes.expressID; - this._openings.set(id, { opening, distance }); + this._openings.set(id, { opening: element, distance }); } private updateAllOpenings() { diff --git a/packages/clay/src/elements/Windows/SimpleWindow/index.html b/packages/clay/src/elements/Windows/SimpleWindow/index.html index 0f7be0e..a321bd4 100644 --- a/packages/clay/src/elements/Windows/SimpleWindow/index.html +++ b/packages/clay/src/elements/Windows/SimpleWindow/index.html @@ -1,130 +1,130 @@ - - - - - - - - - - Tools Component - - - -
- - - ---> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/packages/clay/src/elements/Windows/SimpleWindow/index.ts b/packages/clay/src/elements/Windows/SimpleWindow/index.ts index e346ca8..95f9a49 100644 --- a/packages/clay/src/elements/Windows/SimpleWindow/index.ts +++ b/packages/clay/src/elements/Windows/SimpleWindow/index.ts @@ -1,14 +1,14 @@ import { IFC4X3, IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; -import { Model } from "../../../base"; +import { Model, StaticClayElementType } from "../../../core"; import { Extrusion, RectangleProfile } from "../../../geometries"; import { IfcUtils } from "../../../utils/ifc-utils"; -import { StaticElementType } from "../../Elements"; + import { SimpleWindow } from "./src"; export * from "./src"; -export class SimpleWindowType extends StaticElementType { +export class SimpleWindowType extends StaticClayElementType { attributes: IFC4X3.IfcFurnishingElementType; shape: IFC4X3.IfcProductDefinitionShape; diff --git a/packages/clay/src/elements/Windows/SimpleWindow/src/index.ts b/packages/clay/src/elements/Windows/SimpleWindow/src/index.ts index a3dd9aa..b2b281e 100644 --- a/packages/clay/src/elements/Windows/SimpleWindow/src/index.ts +++ b/packages/clay/src/elements/Windows/SimpleWindow/src/index.ts @@ -1,11 +1,11 @@ import { IFC4X3 as IFC } from "web-ifc"; import { v4 as uuidv4 } from "uuid"; -import { Model } from "../../../../base"; +import { Model, ClayElement } from "../../../../core"; import { IfcUtils } from "../../../../utils/ifc-utils"; -import { Element } from "../../../Elements/Element"; + import { SimpleWindowType } from "../index"; -export class SimpleWindow extends Element { +export class SimpleWindow extends ClayElement { attributes: IFC.IfcFurnishingElement; type: SimpleWindowType; diff --git a/packages/clay/src/geometries/Brep/index.ts b/packages/clay/src/geometries/Brep/index.ts index 67fcd9c..9a9ce82 100644 --- a/packages/clay/src/geometries/Brep/index.ts +++ b/packages/clay/src/geometries/Brep/index.ts @@ -1,7 +1,7 @@ import { IFC4X3 as IFC } from "web-ifc"; import * as THREE from "three"; -import { ClayGeometry } from "../Geometry"; -import { Model } from "../../base"; +import { ClayGeometry, Model } from "../../core"; + import { IfcUtils } from "../../utils/ifc-utils"; export class Brep extends ClayGeometry { diff --git a/packages/clay/src/geometries/Extrusion/index.ts b/packages/clay/src/geometries/Extrusion/index.ts index ba97504..686756f 100644 --- a/packages/clay/src/geometries/Extrusion/index.ts +++ b/packages/clay/src/geometries/Extrusion/index.ts @@ -1,8 +1,8 @@ import { IFC4X3 as IFC } from "web-ifc"; import * as THREE from "three"; -import { Model } from "../../base"; +import { Model, ClayGeometry } from "../../core"; import { Profile } from "../Profiles/Profile"; -import { ClayGeometry } from "../Geometry"; + import { MathUtils } from "../../utils/math-utils"; import { IfcUtils } from "../../utils/ifc-utils"; diff --git a/packages/clay/src/geometries/HalfSpace/index.ts b/packages/clay/src/geometries/HalfSpace/index.ts index efd7121..c8e8e11 100644 --- a/packages/clay/src/geometries/HalfSpace/index.ts +++ b/packages/clay/src/geometries/HalfSpace/index.ts @@ -1,7 +1,7 @@ import { IFC4X3 as IFC } from "web-ifc"; import * as THREE from "three"; -import { Model } from "../../base"; -import { ClayGeometry } from "../Geometry"; +import { Model, ClayGeometry } from "../../core"; + import { MathUtils } from "../../utils/math-utils"; import { IfcUtils } from "../../utils/ifc-utils"; diff --git a/packages/clay/src/geometries/MappedItems/index.ts b/packages/clay/src/geometries/MappedItems/index.ts index 96c9ab1..4b68c1c 100644 --- a/packages/clay/src/geometries/MappedItems/index.ts +++ b/packages/clay/src/geometries/MappedItems/index.ts @@ -1,7 +1,7 @@ import { IFC4X3 as IFC } from "web-ifc"; import * as THREE from "three"; -import { ClayObject, Model } from "../../base"; -import { ClayGeometry } from "../Geometry"; +import { ClayObject, Model, ClayGeometry } from "../../core"; + import { IfcUtils } from "../../utils/ifc-utils"; // TODO: Are we going to use this, or is just necessary for reading? diff --git a/packages/clay/src/geometries/Profiles/ArbitraryClosedProfile/index.ts b/packages/clay/src/geometries/Profiles/ArbitraryClosedProfile/index.ts index c8ac9ba..2f711d1 100644 --- a/packages/clay/src/geometries/Profiles/ArbitraryClosedProfile/index.ts +++ b/packages/clay/src/geometries/Profiles/ArbitraryClosedProfile/index.ts @@ -1,7 +1,7 @@ import * as THREE from "three"; import { Handle, IFC4X3 as IFC } from "web-ifc"; import { Profile } from "../Profile"; -import { Model } from "../../../base"; +import { Model } from "../../../core"; import { IfcUtils } from "../../../utils/ifc-utils"; export class ArbitraryClosedProfile extends Profile { diff --git a/packages/clay/src/geometries/Profiles/Profile/index.ts b/packages/clay/src/geometries/Profiles/Profile/index.ts index 4c8de15..ba23f31 100644 --- a/packages/clay/src/geometries/Profiles/Profile/index.ts +++ b/packages/clay/src/geometries/Profiles/Profile/index.ts @@ -1,5 +1,5 @@ import * as WEBIFC from "web-ifc"; -import { ClayObject } from "../../../base/clay-object"; +import { ClayObject } from "../../../core"; export abstract class Profile extends ClayObject { abstract attributes: WEBIFC.IFC4X3.IfcProfileDef; diff --git a/packages/clay/src/geometries/Profiles/RectangleProfile/index.ts b/packages/clay/src/geometries/Profiles/RectangleProfile/index.ts index ec41665..3eb7385 100644 --- a/packages/clay/src/geometries/Profiles/RectangleProfile/index.ts +++ b/packages/clay/src/geometries/Profiles/RectangleProfile/index.ts @@ -1,7 +1,7 @@ import * as THREE from "three"; import { IFC4X3 as IFC } from "web-ifc"; import { Profile } from "../Profile"; -import { Model } from "../../../base"; +import { Model } from "../../../core"; import { IfcUtils } from "../../../utils/ifc-utils"; export class RectangleProfile extends Profile { diff --git a/packages/clay/src/index.ts b/packages/clay/src/index.ts index f1cbab0..642eda1 100644 --- a/packages/clay/src/index.ts +++ b/packages/clay/src/index.ts @@ -3,4 +3,4 @@ export * from "./elements"; export * from "./utils"; export * from "./elements"; export * from "./geometries"; -export * from "./base"; +export * from "./core"; diff --git a/packages/clay/src/primitives/Faces/index.html b/packages/clay/src/primitives/Faces/index.html index 0270e2c..9ac759f 100644 --- a/packages/clay/src/primitives/Faces/index.html +++ b/packages/clay/src/primitives/Faces/index.html @@ -148,9 +148,6 @@ // Set up the controls to move them around - const control = new TransformControls(world.camera, world.renderer.domElement); - const helper = new THREE.Object3D(); - let transform = new THREE.Matrix4(); world.scene.add(helper); control.attach(helper); world.scene.add(control); @@ -159,9 +156,9 @@ control.addEventListener('change', () => { helper.updateMatrix(); const temp = helper.matrix.clone(); - temp.multiply(transform.invert()); + temp.multiply(controlsTransform.invert()); faces.transform(temp); - transform = helper.matrix.clone(); + controlsTransform = helper.matrix.clone(); }); const gui = new dat.GUI(); diff --git a/packages/clay/src/utils/ifc-utils.ts b/packages/clay/src/utils/ifc-utils.ts index 5f2015c..d057237 100644 --- a/packages/clay/src/utils/ifc-utils.ts +++ b/packages/clay/src/utils/ifc-utils.ts @@ -1,6 +1,6 @@ import { IFC4X3 as IFC } from "web-ifc"; import * as THREE from "three"; -import { Model } from "../base"; +import { Model } from "../core"; import { MathUtils } from "./math-utils"; export class IfcUtils { diff --git a/packages/clay/tsconfig.json b/packages/clay/tsconfig.json index e118a51..d2db1ff 100644 --- a/packages/clay/tsconfig.json +++ b/packages/clay/tsconfig.json @@ -21,7 +21,8 @@ "allowJs": false, "preserveSymlinks": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "references": [{ "path": "./tsconfig.node.json" }], "typedocOptions": { diff --git a/yarn.lock b/yarn.lock index 6b2f87f..f256046 100644 --- a/yarn.lock +++ b/yarn.lock @@ -610,6 +610,32 @@ __metadata: languageName: node linkType: hard +"@floating-ui/core@npm:^1.0.0": + version: 1.6.8 + resolution: "@floating-ui/core@npm:1.6.8" + dependencies: + "@floating-ui/utils": ^0.2.8 + checksum: 82faa6ea9d57e466779324e51308d6d49c098fb9d184a08d9bb7f4fad83f08cc070fc491f8d56f0cad44a16215fb43f9f829524288413e6c33afcb17303698de + languageName: node + linkType: hard + +"@floating-ui/dom@npm:1.6.3": + version: 1.6.3 + resolution: "@floating-ui/dom@npm:1.6.3" + dependencies: + "@floating-ui/core": ^1.0.0 + "@floating-ui/utils": ^0.2.0 + checksum: 81cbb18ece3afc37992f436e469e7fabab2e433248e46fff4302d12493a175b0c64310f8a971e6e1eda7218df28ace6b70237b0f3c22fe12a21bba05b5579555 + languageName: node + linkType: hard + +"@floating-ui/utils@npm:^0.2.0, @floating-ui/utils@npm:^0.2.8": + version: 0.2.8 + resolution: "@floating-ui/utils@npm:0.2.8" + checksum: deb98bba017c4e073c7ad5740d4dec33a4d3e0942d412e677ac0504f3dade15a68fc6fd164d43c93c0bb0bcc5dc5015c1f4080dfb1a6161140fe660624f7c875 + languageName: node + linkType: hard + "@humanwhocodes/config-array@npm:^0.11.14": version: 0.11.14 resolution: "@humanwhocodes/config-array@npm:0.11.14" @@ -635,6 +661,13 @@ __metadata: languageName: node linkType: hard +"@iconify/types@npm:^2.0.0": + version: 2.0.0 + resolution: "@iconify/types@npm:2.0.0" + checksum: 029f58542c160e9d4a746869cf2e475b603424d3adf3994c5cc8d0406c47e6e04a3b898b2707840c1c5b9bd5563a1660a34b110d89fce43923baca5222f4e597 + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -935,6 +968,22 @@ __metadata: languageName: node linkType: hard +"@lit-labs/ssr-dom-shim@npm:^1.2.0": + version: 1.2.1 + resolution: "@lit-labs/ssr-dom-shim@npm:1.2.1" + checksum: 5667c44f58e16edaa257fc3ae7f752250d5250d4eb1d071b65df0f1fce0b90b42e8528787cc2673998d76d993440143a2a20c3358ce125c62df4cd193784de8d + languageName: node + linkType: hard + +"@lit/reactive-element@npm:^2.0.4": + version: 2.0.4 + resolution: "@lit/reactive-element@npm:2.0.4" + dependencies: + "@lit-labs/ssr-dom-shim": ^1.2.0 + checksum: 368d788d9eefdde74e77721e38c78de222dc5ec87d543e0638d0d28f7a8cf530c3d7b49aa8606efeec3f3485abbb22a43b58c2f20c1e6e7f0de266d4c6d125c4 + languageName: node + linkType: hard + "@microsoft/api-extractor-model@npm:7.28.3": version: 7.28.3 resolution: "@microsoft/api-extractor-model@npm:7.28.3" @@ -1242,7 +1291,9 @@ __metadata: version: 0.0.0-use.local resolution: "@thatopen/clay@workspace:packages/clay" dependencies: + "@thatopen/components": ^2.2.11 "@thatopen/fragments": 2.2.0 + "@thatopen/ui": ^2.2.2 "@types/earcut": ^2.1.4 "@types/jest": 27.0.0 "@types/node": 20.11.30 @@ -1275,6 +1326,22 @@ __metadata: languageName: unknown linkType: soft +"@thatopen/components@npm:^2.2.11": + version: 2.2.11 + resolution: "@thatopen/components@npm:2.2.11" + dependencies: + camera-controls: 2.7.3 + fast-xml-parser: 4.4.1 + jszip: 3.10.1 + three-mesh-bvh: 0.7.0 + peerDependencies: + "@thatopen/fragments": ~2.2.0 + three: ^0.160.1 + web-ifc: 0.0.57 + checksum: 20d1a9594a1381d12a88915ae646aec4e8d90e9f2165cdb1d76eaff5208a13da81a4a995c4f7e27048c9454d23d0c00fcfaac715191347b8b2db507e90af17a9 + languageName: node + linkType: hard + "@thatopen/fragments@npm:2.2.0": version: 2.2.0 resolution: "@thatopen/fragments@npm:2.2.0" @@ -1287,6 +1354,17 @@ __metadata: languageName: node linkType: hard +"@thatopen/ui@npm:^2.2.2": + version: 2.2.2 + resolution: "@thatopen/ui@npm:2.2.2" + dependencies: + "@floating-ui/dom": 1.6.3 + iconify-icon: 2.0.0 + lit: 3.1.2 + checksum: 72bbf5ecad9f33272656b79d0338c753a4c03a63c1d2c07676476206d14de39be9c747af20d6fce9483061d8afcd39f61b584daaf001a19db286b05a70d552b6 + languageName: node + linkType: hard + "@tootallnate/once@npm:1": version: 1.1.2 resolution: "@tootallnate/once@npm:1.1.2" @@ -1500,6 +1578,13 @@ __metadata: languageName: node linkType: hard +"@types/trusted-types@npm:^2.0.2": + version: 2.0.7 + resolution: "@types/trusted-types@npm:2.0.7" + checksum: 8e4202766a65877efcf5d5a41b7dd458480b36195e580a3b1085ad21e948bc417d55d6f8af1fd2a7ad008015d4117d5fdfe432731157da3c68678487174e4ba3 + languageName: node + linkType: hard + "@types/uuid@npm:^10.0.0": version: 10.0.0 resolution: "@types/uuid@npm:10.0.0" @@ -2255,6 +2340,15 @@ __metadata: languageName: node linkType: hard +"camera-controls@npm:2.7.3": + version: 2.7.3 + resolution: "camera-controls@npm:2.7.3" + peerDependencies: + three: ">=0.126.1" + checksum: 33d5429459e44adfab3d79f6ede984b5b7a56764a62d105178ff5f8ef45dc383a1f03b1038d77349eb23deb66838515970d4a96e85bdd2a3e44c02c801452f1a + languageName: node + linkType: hard + "caniuse-lite@npm:^1.0.30001587": version: 1.0.30001615 resolution: "caniuse-lite@npm:1.0.30001615" @@ -2440,6 +2534,13 @@ __metadata: languageName: node linkType: hard +"core-util-is@npm:~1.0.0": + version: 1.0.3 + resolution: "core-util-is@npm:1.0.3" + checksum: 9de8597363a8e9b9952491ebe18167e3b36e7707569eed0ebf14f8bba773611376466ae34575bca8cfe3c767890c859c74056084738f09d4e4a6f902b2ad7d99 + languageName: node + linkType: hard + "create-require@npm:^1.1.0": version: 1.1.1 resolution: "create-require@npm:1.1.1" @@ -3296,6 +3397,17 @@ __metadata: languageName: node linkType: hard +"fast-xml-parser@npm:4.4.1": + version: 4.4.1 + resolution: "fast-xml-parser@npm:4.4.1" + dependencies: + strnum: ^1.0.5 + bin: + fxparser: src/cli/cli.js + checksum: f440c01cd141b98789ae777503bcb6727393296094cc82924ae9f88a5b971baa4eec7e65306c7e07746534caa661fc83694ff437d9012dc84dee39dfbfaab947 + languageName: node + linkType: hard + "fastq@npm:^1.6.0": version: 1.17.1 resolution: "fastq@npm:1.17.1" @@ -3799,6 +3911,15 @@ __metadata: languageName: node linkType: hard +"iconify-icon@npm:2.0.0": + version: 2.0.0 + resolution: "iconify-icon@npm:2.0.0" + dependencies: + "@iconify/types": ^2.0.0 + checksum: 9da96aadcd21cc1fbf2b95a00b8446aeced2406b8f7d13796e9931fc92863d2dec8304d75c2b53d0fa052bf43ea8fffa995d87f16028291f00e29638131ef61b + languageName: node + linkType: hard + "iconv-lite@npm:0.4.24": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" @@ -3824,6 +3945,13 @@ __metadata: languageName: node linkType: hard +"immediate@npm:~3.0.5": + version: 3.0.6 + resolution: "immediate@npm:3.0.6" + checksum: f9b3486477555997657f70318cc8d3416159f208bec4cca3ff3442fd266bc23f50f0c9bd8547e1371a6b5e82b821ec9a7044a4f7b944798b25aa3cc6d5e63e62 + languageName: node + linkType: hard + "import-fresh@npm:^3.2.1": version: 3.3.0 resolution: "import-fresh@npm:3.3.0" @@ -3877,7 +4005,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2": +"inherits@npm:2, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -4125,6 +4253,13 @@ __metadata: languageName: node linkType: hard +"isarray@npm:~1.0.0": + version: 1.0.0 + resolution: "isarray@npm:1.0.0" + checksum: f032df8e02dce8ec565cf2eb605ea939bdccea528dbcf565cdf92bfa2da9110461159d86a537388ef1acef8815a330642d7885b29010e8f7eac967c9993b65ab + languageName: node + linkType: hard + "isexe@npm:^2.0.0": version: 2.0.0 resolution: "isexe@npm:2.0.0" @@ -4865,6 +5000,18 @@ __metadata: languageName: node linkType: hard +"jszip@npm:3.10.1": + version: 3.10.1 + resolution: "jszip@npm:3.10.1" + dependencies: + lie: ~3.3.0 + pako: ~1.0.2 + readable-stream: ~2.3.6 + setimmediate: ^1.0.5 + checksum: abc77bfbe33e691d4d1ac9c74c8851b5761fba6a6986630864f98d876f3fcc2d36817dfc183779f32c00157b5d53a016796677298272a714ae096dfe6b1c8b60 + languageName: node + linkType: hard + "keyv@npm:^4.5.3": version: 4.5.4 resolution: "keyv@npm:4.5.4" @@ -4905,6 +5052,15 @@ __metadata: languageName: node linkType: hard +"lie@npm:~3.3.0": + version: 3.3.0 + resolution: "lie@npm:3.3.0" + dependencies: + immediate: ~3.0.5 + checksum: 33102302cf19766f97919a6a98d481e01393288b17a6aa1f030a3542031df42736edde8dab29ffdbf90bebeffc48c761eb1d064dc77592ca3ba3556f9fe6d2a8 + languageName: node + linkType: hard + "lines-and-columns@npm:^1.1.6": version: 1.2.4 resolution: "lines-and-columns@npm:1.2.4" @@ -4912,6 +5068,37 @@ __metadata: languageName: node linkType: hard +"lit-element@npm:^4.0.4": + version: 4.1.0 + resolution: "lit-element@npm:4.1.0" + dependencies: + "@lit-labs/ssr-dom-shim": ^1.2.0 + "@lit/reactive-element": ^2.0.4 + lit-html: ^3.2.0 + checksum: 16cc7e343fc7f872a0f6a468bb9d7f3697cd9c3c020fd66e1f29f81e15300dc8d091559a1fd2d4cb6f2eb99b76e3fbeea1991f74dd5ca77bfaadb5b6af3d85b3 + languageName: node + linkType: hard + +"lit-html@npm:^3.1.2, lit-html@npm:^3.2.0": + version: 3.2.0 + resolution: "lit-html@npm:3.2.0" + dependencies: + "@types/trusted-types": ^2.0.2 + checksum: fa566878efab2492f2dc359216bc5ccd5164466f6760984b9f9b7122c4932be19891ddf10a611bc88718e59c49f83f18e9b9e32fe193dcdc37df28f9fe05630c + languageName: node + linkType: hard + +"lit@npm:3.1.2": + version: 3.1.2 + resolution: "lit@npm:3.1.2" + dependencies: + "@lit/reactive-element": ^2.0.4 + lit-element: ^4.0.4 + lit-html: ^3.1.2 + checksum: 7776fc5f17a093aafa8d2194725692be2e233d893909722e2fc86ef0bd167f60846fa24054bbca40028bb71262dfa12947e39cb46ad1d0f949dbf0298c7754d1 + languageName: node + linkType: hard + "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -5483,6 +5670,13 @@ __metadata: languageName: node linkType: hard +"pako@npm:~1.0.2": + version: 1.0.11 + resolution: "pako@npm:1.0.11" + checksum: 1be2bfa1f807608c7538afa15d6f25baa523c30ec870a3228a89579e474a4d992f4293859524e46d5d87fd30fa17c5edf34dbef0671251d9749820b488660b16 + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -5673,6 +5867,13 @@ __metadata: languageName: node linkType: hard +"process-nextick-args@npm:~2.0.0": + version: 2.0.1 + resolution: "process-nextick-args@npm:2.0.1" + checksum: 1d38588e520dab7cea67cbbe2efdd86a10cc7a074c09657635e34f035277b59fbb57d09d8638346bf7090f8e8ebc070c96fa5fd183b777fff4f5edff5e9466cf + languageName: node + linkType: hard + "promise-retry@npm:^2.0.1": version: 2.0.1 resolution: "promise-retry@npm:2.0.1" @@ -5728,6 +5929,21 @@ __metadata: languageName: node linkType: hard +"readable-stream@npm:~2.3.6": + version: 2.3.8 + resolution: "readable-stream@npm:2.3.8" + dependencies: + core-util-is: ~1.0.0 + inherits: ~2.0.3 + isarray: ~1.0.0 + process-nextick-args: ~2.0.0 + safe-buffer: ~5.1.1 + string_decoder: ~1.1.1 + util-deprecate: ~1.0.1 + checksum: 65645467038704f0c8aaf026a72fbb588a9e2ef7a75cd57a01702ee9db1c4a1e4b03aaad36861a6a0926546a74d174149c8c207527963e0c2d3eee2f37678a42 + languageName: node + linkType: hard + "regexp.prototype.flags@npm:^1.5.2": version: 1.5.2 resolution: "regexp.prototype.flags@npm:1.5.2" @@ -5949,6 +6165,13 @@ __metadata: languageName: node linkType: hard +"safe-buffer@npm:~5.1.0, safe-buffer@npm:~5.1.1": + version: 5.1.2 + resolution: "safe-buffer@npm:5.1.2" + checksum: f2f1f7943ca44a594893a852894055cf619c1fbcb611237fc39e461ae751187e7baf4dc391a72125e0ac4fb2d8c5c0b3c71529622e6a58f46b960211e704903c + languageName: node + linkType: hard + "safe-regex-test@npm:^1.0.3": version: 1.0.3 resolution: "safe-regex-test@npm:1.0.3" @@ -6033,6 +6256,13 @@ __metadata: languageName: node linkType: hard +"setimmediate@npm:^1.0.5": + version: 1.0.5 + resolution: "setimmediate@npm:1.0.5" + checksum: c9a6f2c5b51a2dabdc0247db9c46460152ffc62ee139f3157440bd48e7c59425093f42719ac1d7931f054f153e2d26cf37dfeb8da17a794a58198a2705e527fd + languageName: node + linkType: hard + "shebang-command@npm:^2.0.0": version: 2.0.0 resolution: "shebang-command@npm:2.0.0" @@ -6260,6 +6490,15 @@ __metadata: languageName: node linkType: hard +"string_decoder@npm:~1.1.1": + version: 1.1.1 + resolution: "string_decoder@npm:1.1.1" + dependencies: + safe-buffer: ~5.1.0 + checksum: 9ab7e56f9d60a28f2be697419917c50cac19f3e8e6c28ef26ed5f4852289fe0de5d6997d29becf59028556f2c62983790c1d9ba1e2a3cc401768ca12d5183a5b + languageName: node + linkType: hard + "strip-ansi-cjs@npm:strip-ansi@^6.0.1, strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": version: 6.0.1 resolution: "strip-ansi@npm:6.0.1" @@ -6306,6 +6545,13 @@ __metadata: languageName: node linkType: hard +"strnum@npm:^1.0.5": + version: 1.0.5 + resolution: "strnum@npm:1.0.5" + checksum: 651b2031db5da1bf4a77fdd2f116a8ac8055157c5420f5569f64879133825915ad461513e7202a16d7fec63c54fd822410d0962f8ca12385c4334891b9ae6dd2 + languageName: node + linkType: hard + "supports-color@npm:^5.3.0": version: 5.5.0 resolution: "supports-color@npm:5.5.0" @@ -6790,6 +7036,13 @@ __metadata: languageName: node linkType: hard +"util-deprecate@npm:~1.0.1": + version: 1.0.2 + resolution: "util-deprecate@npm:1.0.2" + checksum: 474acf1146cb2701fe3b074892217553dfcf9a031280919ba1b8d651a068c9b15d863b7303cb15bd00a862b498e6cf4ad7b4a08fb134edd5a6f7641681cb54a2 + languageName: node + linkType: hard + "uuid@npm:^10.0.0": version: 10.0.0 resolution: "uuid@npm:10.0.0"