From 1022eeb23da4aec9027e908956285113f1c068fb Mon Sep 17 00:00:00 2001 From: ChenX Date: Fri, 26 Jul 2024 10:40:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91:=E7=B1=BB=E5=9E=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/BoardCutting/BoardCuttingForSweep.ts | 8 ++++---- src/Add-on/JiaJu/Import/JiaJuImport.ts | 1 + src/Add-on/JiaJu/Import/JiaJuInterface.ts | 2 +- src/Add-on/twoD2threeD/ParseBoardNameStore.ts | 2 +- src/Common/CSGIntersect.ts | 4 ++-- src/Editor/TranstrolControl/TranslateGizmo.ts | 2 +- src/Geometry/BSPGroupParse.ts | 5 ++--- src/UI/Components/Panel.tsx | 2 +- src/UI/Components/commandLineInput/InputHint.tsx | 2 +- src/UI/Store/DoorDrawerStore/DoorDrawerStore.ts | 4 ++-- src/UI/Store/DrillStore.ts | 2 +- src/UI/Store/WineRackStore.ts | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Add-on/BoardCutting/BoardCuttingForSweep.ts b/src/Add-on/BoardCutting/BoardCuttingForSweep.ts index 13b6797f1..3a8b1f5d0 100644 --- a/src/Add-on/BoardCutting/BoardCuttingForSweep.ts +++ b/src/Add-on/BoardCutting/BoardCuttingForSweep.ts @@ -4,7 +4,7 @@ import { Mat4 } from "@jscad/modeling/src/maths/mat4"; import { measureAggregateVolume } from "@jscad/modeling/src/measurements"; import { intersect, scission } from "@jscad/modeling/src/operations/booleans"; import { Vector2, Vector3 } from "three"; -import { CSGIntersect, Geom3Res } from "../../Common/CSGIntersect"; +import { CSGIntersect } from "../../Common/CSGIntersect"; import { Board } from "../../DatabaseServices/Entity/Board"; import { ExtrudeSolid } from "../../DatabaseServices/Entity/Extrude"; import { Line } from "../../DatabaseServices/Entity/Line"; @@ -197,14 +197,14 @@ export class BoardCuttingForSweep const interCSG = intersect(csg1Clone, csg2Clone); interCSG.transforms = meat.OCSInv.elements as Mat4; intersect(interCSG, interCSG); - const interCSGs = scission(interCSG as unknown as Geom3) as unknown as Geom3[]; + const interCSGs = scission(interCSG); for (const interCSG of interCSGs) { // 过滤掉小于肉的100体积的凹槽(这里甩固定值) const interVolume = measureAggregateVolume(interCSG); if (interVolume < 100) continue; - const topology = new BSPGroupParse(interCSG as unknown as Geom3Res); + const topology = new BSPGroupParse(interCSG); /** 交集部分的包围盒 */ const box = new Box3Ext(new Vector3(Infinity, Infinity, Infinity), new Vector3(-Infinity, -Infinity, -Infinity)); const ptsList = topology.Parse(); @@ -360,7 +360,7 @@ export class BoardCuttingForSweep private ProjectCSGToPts(CSG: Geom3, dir: "X" | "Y" | "Z" = "Z") { // 转为点集 - const topology = new BSPGroupParse(CSG as unknown as Geom3Res); + const topology = new BSPGroupParse(CSG); const ps: Vector3[] = []; for (let pts of topology.Parse()) { diff --git a/src/Add-on/JiaJu/Import/JiaJuImport.ts b/src/Add-on/JiaJu/Import/JiaJuImport.ts index f045ca0a7..2487732d5 100644 --- a/src/Add-on/JiaJu/Import/JiaJuImport.ts +++ b/src/Add-on/JiaJu/Import/JiaJuImport.ts @@ -38,6 +38,7 @@ import { CuttingBoardByBoard } from "../../BoardCutting/CuttingUtils2"; import { BoardMaterialLoader, MaterialInfo } from "../../CF/Import/BoardMaterialLoader"; import { FaceDirection } from "../../DrawDrilling/DrillType"; import { IBoardRectHoleType, SetBrHighHoleTypeFromRectHoleType } from "../../DrawDrilling/HoleUtils"; +import { JiaJu } from "./JiaJuInterface"; let _xmlParse: DOMParser; diff --git a/src/Add-on/JiaJu/Import/JiaJuInterface.ts b/src/Add-on/JiaJu/Import/JiaJuInterface.ts index 787301558..f64a737a0 100644 --- a/src/Add-on/JiaJu/Import/JiaJuInterface.ts +++ b/src/Add-on/JiaJu/Import/JiaJuInterface.ts @@ -1,5 +1,5 @@ //ref: https://quicktype.io/typescript -namespace JiaJu +export namespace JiaJu { export interface Bom { diff --git a/src/Add-on/twoD2threeD/ParseBoardNameStore.ts b/src/Add-on/twoD2threeD/ParseBoardNameStore.ts index 92189bfc0..de8ad2925 100644 --- a/src/Add-on/twoD2threeD/ParseBoardNameStore.ts +++ b/src/Add-on/twoD2threeD/ParseBoardNameStore.ts @@ -10,7 +10,7 @@ import { IParseBoardNameOption } from "./R2bInterface"; export class ParseBoardNameStore extends BoardStore { @observable m_Option: IParseBoardNameOption = { ...DefaultParseBoardNameOPtion }; - @observable m_UiOption: IUiOption; + @observable declare m_UiOption: IUiOption; InitOption() { Object.assign(this.m_Option, DefaultParseBoardNameOPtion); diff --git a/src/Common/CSGIntersect.ts b/src/Common/CSGIntersect.ts index 364f0e3cc..886d78cc7 100644 --- a/src/Common/CSGIntersect.ts +++ b/src/Common/CSGIntersect.ts @@ -19,11 +19,11 @@ export interface Geom3Res }>; } -export function CSGIntersect(csg1: Geom3, csg2: Geom3, csg2tranfrom: Matrix4): Geom3Res +export function CSGIntersect(csg1: Geom3, csg2: Geom3, csg2tranfrom: Matrix4): Geom3 { //因为内部使用geom3进行box cache 所以我们新建了一个geom3 避免被cache导致错误 let csg1Clone = geom3.create(csg1.polygons.concat()); let csg2Clone = geom3.create(csg2.polygons.concat()); csg2Clone.transforms = csg2tranfrom.elements as Mat4; - return intersect(csg1Clone, csg2Clone) as unknown as Geom3Res; + return intersect(csg1Clone, csg2Clone); } diff --git a/src/Editor/TranstrolControl/TranslateGizmo.ts b/src/Editor/TranstrolControl/TranslateGizmo.ts index ed4413a0f..178f749b8 100644 --- a/src/Editor/TranstrolControl/TranslateGizmo.ts +++ b/src/Editor/TranstrolControl/TranslateGizmo.ts @@ -35,7 +35,7 @@ export class TranslateGizmo extends CoorAxes implements IGizmo opacity: 0.5 }); - Picks: Group; + declare Picks: Group; constructor() { diff --git a/src/Geometry/BSPGroupParse.ts b/src/Geometry/BSPGroupParse.ts index 5d7f5f903..b2ac7e4c7 100644 --- a/src/Geometry/BSPGroupParse.ts +++ b/src/Geometry/BSPGroupParse.ts @@ -1,7 +1,6 @@ -import { Poly3 } from "@jscad/modeling/src/geometries/types"; +import { Geom3, Poly3 } from "@jscad/modeling/src/geometries/types"; import { Vec3 } from "@jscad/modeling/src/maths/vec3"; import { Vector3 } from "three"; -import { Geom3Res } from "../Common/CSGIntersect"; import { ToFixed } from "../Common/Utils"; /** @@ -15,7 +14,7 @@ import { ToFixed } from "../Common/Utils"; */ export class BSPGroupParse { - constructor(bsp?: Geom3Res, public fractionDigits = 1) + constructor(bsp?: Geom3, public fractionDigits = 1) { if (bsp) for (let poly of bsp.polygons) diff --git a/src/UI/Components/Panel.tsx b/src/UI/Components/Panel.tsx index 1081acfab..d749e563d 100644 --- a/src/UI/Components/Panel.tsx +++ b/src/UI/Components/Panel.tsx @@ -58,7 +58,7 @@ declare const version: string; export class TopPanel extends React.Component<{ store?: TopPanelStore; }, {}> { private topStore = DownPanelStore.GetInstance(); - state: TopPanelState; + declare state: TopPanelState; constructor(props) { super(props); diff --git a/src/UI/Components/commandLineInput/InputHint.tsx b/src/UI/Components/commandLineInput/InputHint.tsx index b7c3e6e75..f8f5a9b34 100644 --- a/src/UI/Components/commandLineInput/InputHint.tsx +++ b/src/UI/Components/commandLineInput/InputHint.tsx @@ -46,7 +46,7 @@ interface InputHitState @observer export class InputHint extends React.Component { - public state: InputHitState; + public declare state: InputHitState; private inputEl: HTMLInputElement; private selectIndex: number = 0; //选择历史命令索引 private isCNInput: boolean = false; diff --git a/src/UI/Store/DoorDrawerStore/DoorDrawerStore.ts b/src/UI/Store/DoorDrawerStore/DoorDrawerStore.ts index ff70fc0b0..8c4ce9b09 100644 --- a/src/UI/Store/DoorDrawerStore/DoorDrawerStore.ts +++ b/src/UI/Store/DoorDrawerStore/DoorDrawerStore.ts @@ -18,8 +18,8 @@ type IDoorDrawer = IDoorInfo | IDrawerInfo; export class DoorDrawerStore extends BoardStore { - m_Option: IDoorAndDrawerConfigOption; - protected m_UiOption: IUiOption; + declare m_Option: IDoorAndDrawerConfigOption; + protected declare m_UiOption: IUiOption; totalHeight = 0; totalWidth = 0; totalDepth = 0; diff --git a/src/UI/Store/DrillStore.ts b/src/UI/Store/DrillStore.ts index bbcb641d1..29eac895b 100644 --- a/src/UI/Store/DrillStore.ts +++ b/src/UI/Store/DrillStore.ts @@ -38,7 +38,7 @@ export class DrillStore extends BoardStore @observable rules: DrillingOption[] = []; @observable drillConfigSortType: DrillConfigSortType;//排钻类型排序方式 @observable customConfigSort: string[] = []; //自定义的排序[...Keys] - @observable m_Option: DrillingOption; + @observable declare m_Option: DrillingOption; @observable drillConfig: Map = new Map(); //类似UI_option defaultfDrillConfig: Map = new Map(); //排钻类型初始排序 deleteHoleTemps = new Set(); diff --git a/src/UI/Store/WineRackStore.ts b/src/UI/Store/WineRackStore.ts index 1ae93d7f8..0505d6a90 100644 --- a/src/UI/Store/WineRackStore.ts +++ b/src/UI/Store/WineRackStore.ts @@ -9,7 +9,7 @@ import { EWineRackStyle, IWineRackOption } from "./WineRackInterface"; export class WineRackStore extends BoardStore { - EditorTemplate: TemplateWineRackRecord; + declare EditorTemplate: TemplateWineRackRecord; @observable m_Option: IWineRackOption = Object.assign({}, DefaultWineRackConfig); HasInvailValue() {