From f6a5c0c330e3321b58073b5a1848ed2826b1de54 Mon Sep 17 00:00:00 2001 From: Vishwajeet Date: Mon, 4 May 2026 00:40:52 +0200 Subject: [PATCH] chore: green up tsc --noEmit on main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Brings tsc --noEmit to a clean exit so CI can enforce it. Four discrete fixes plus one tsconfig exclusion: - tsconfig: exclude src/packages/openplans-core/src/elements/catalog/. Those files reference non-existent ../shared/* modules (~115 TS errors) and have all index.ts exports commented out, so they are not part of any build output. Full deletion deferred. - Delete src/packages/openplans-core/src/elements/solids/wall-component/ wall-engine.ts. Class was orphan (no importers anywhere) with stub method bodies. Removed the now-empty wall-component/ dir. - ViewportBlock: drop the unimplemented `implements IShape` clause and the now-unused IShape import. The class did not honor the contract (missing subElements2D / subElements3D); the declaration was misleading. - single-wall.ts and poly-wall.ts: drop `transparent: false` and `opacity: 1` from the options bag passed to solid.subtract(). opengeometry 2.0.9's BooleanExecutionOptions only accepts color, outline, fatOutlines, outlineWidth, kernel — both removed fields match the kernel defaults, so runtime behavior is unchanged. Verified: `npx tsc --noEmit` exits 0, `npm run build` green. --- .../src/elements/solids/poly-wall.ts | 6 +- .../src/elements/solids/single-wall.ts | 4 +- .../solids/wall-component/wall-engine.ts | 80 ------------------- .../src/layouts/viewport-block.ts | 3 +- tsconfig.json | 5 +- 5 files changed, 8 insertions(+), 90 deletions(-) delete mode 100644 src/packages/openplans-core/src/elements/solids/wall-component/wall-engine.ts diff --git a/src/packages/openplans-core/src/elements/solids/poly-wall.ts b/src/packages/openplans-core/src/elements/solids/poly-wall.ts index d060f0c..94ecaf2 100644 --- a/src/packages/openplans-core/src/elements/solids/poly-wall.ts +++ b/src/packages/openplans-core/src/elements/solids/poly-wall.ts @@ -800,10 +800,8 @@ export class PolyWall extends Polyline implements IShape { if (wall3D && all3DOpenings.length > 0) { try { const result3D = wall3D.subtract(all3DOpenings, { - color: this.propertySet.color, - outline: this._outlineEnabled, - transparent: false, - opacity: 1, + color: this.propertySet.color, + outline: this._outlineEnabled, }) as BooleanResult; this.subElements3D.set(this.ogid + "-3d-resolved", result3D); diff --git a/src/packages/openplans-core/src/elements/solids/single-wall.ts b/src/packages/openplans-core/src/elements/solids/single-wall.ts index 09c8632..25b8d33 100644 --- a/src/packages/openplans-core/src/elements/solids/single-wall.ts +++ b/src/packages/openplans-core/src/elements/solids/single-wall.ts @@ -368,9 +368,7 @@ export class SingleWall extends Line implements IShape { } const result3D = wall3D.subtract(all3DOpenings, { - color: this.propertySet.color, - transparent: false, - opacity: 1, + color: this.propertySet.color, }); wall3D.visible = false; diff --git a/src/packages/openplans-core/src/elements/solids/wall-component/wall-engine.ts b/src/packages/openplans-core/src/elements/solids/wall-component/wall-engine.ts deleted file mode 100644 index 24a0e51..0000000 --- a/src/packages/openplans-core/src/elements/solids/wall-component/wall-engine.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { SingleWall } from "../single-wall"; -import { WallOptions } from "../wall-types"; - - -const wallJoinTolerance: number = 0.01; // Tolerance for detecting joins - -interface WallRelationship { - wallId: string; - startLink: string | null; // ID of the wall connected at the start point - endLink: string | null; // ID of the wall connected at the end point - middleLinks: string[]; // IDs of walls that overlap in the middle -} - -/** - * Wall Engine provides a way to create new walls based on parameters. - * The Engine then resolves Wall Joins based on Overalapping Walls. - * Currently T, L, X joins are supported. - * The Wall Engine is running in the background and whenever user modifies a wall geometry or creates a new wall, the engine checks for overlapping walls and resolves the joins accordingly. - */ -export class WallEngine { - private wallMap: Map = new Map(); - private wallRelationships: Map = new Map(); // Map of wallId to wall relationship - - constructor() {} - - createWall(wallOptions: Partial): SingleWall { - const wall = new SingleWall(wallOptions); - this.addWallToSystem(wall); - this.wallMap.set(wall.ogid, wall); - return wall; - } - - addStartLink(wallId: string, connectedWallId: string) { - const relationship = this.wallRelationships.get(wallId); - if (relationship) { - relationship.startLink = connectedWallId; - this.updateWallGeometry(wallId); - } - } - - addEndLink(wallId: string, connectedWallId: string) { - const relationship = this.wallRelationships.get(wallId); - if (relationship) { - relationship.endLink = connectedWallId; - this.updateWallGeometry(wallId); - } - } - - addMiddleLink(wallId: string, connectedWallId: string) { - const relationship = this.wallRelationships.get(wallId); - if (relationship && !relationship.middleLinks.includes(connectedWallId)) { - relationship.middleLinks.push(connectedWallId); - this.updateWallGeometry(wallId); - } - } - - private updateWallGeometry(wallId: string) { - // Logic to update the wall geometry based on its relationships (joins) - // This would involve checking the type of join (L, T, X) and modifying the wall's geometry accordingly to reflect the join. - } - - private addWallToSystem(wall: SingleWall) { - // Add wall to the system and initialize its relationship - this.wallRelationships.set(wall.ogid, { - wallId: wall.ogid, - startLink: null, - endLink: null, - middleLinks: [], - }); - - // After adding the wall, resolve joins - this.resolveJoinsForWall(wall); - } - - private resolveJoinsForWall(wall: SingleWall) { - // Logic to check for overlapping walls and determine join types (L, T, X) - // This is a complex logic that involves checking the geometry of the wall against other walls in the system and determining if they are connected at the start, end, or middle. - // Based on the connections, we can then update the wall's geometry to reflect the appropriate join type. - } -} diff --git a/src/packages/openplans-core/src/layouts/viewport-block.ts b/src/packages/openplans-core/src/layouts/viewport-block.ts index be9ac76..505bc52 100644 --- a/src/packages/openplans-core/src/layouts/viewport-block.ts +++ b/src/packages/openplans-core/src/layouts/viewport-block.ts @@ -1,5 +1,4 @@ import * as THREE from "three"; -import { IShape } from "../shapes/base-type"; export type ViewCamera = 'top' | 'front' | 'right' | 'left' | 'back'; @@ -44,7 +43,7 @@ function getCameraSetup(viewCamera: ViewCamera, center: [number, number, number] } } -export class ViewportBlock extends THREE.Object3D implements IShape { +export class ViewportBlock extends THREE.Object3D { private viewportConfig: ViewportConfig; private viewportMesh!: THREE.Mesh; private viewportCamera: THREE.OrthographicCamera; diff --git a/tsconfig.json b/tsconfig.json index ffa04a4..36706d5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,5 +26,8 @@ "types": ["vite/client"] }, - "include": ["src", "src/packages"] + "include": ["src", "src/packages"], + "exclude": [ + "src/packages/openplans-core/src/elements/catalog" + ] }