From df7d4757e6b4924270773901772a847426ff7bde Mon Sep 17 00:00:00 2001 From: ChenX Date: Sat, 13 May 2023 15:53:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=E9=81=BF=E5=85=8D=E7=B2=BE?= =?UTF-8?q?=E5=BA=A6=E8=AF=AF=E5=B7=AE=E5=AF=BC=E8=87=B4=E7=9A=84ParseHing?= =?UTF-8?q?e=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/DrawBoard/ParseHinge.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Add-on/DrawBoard/ParseHinge.ts b/src/Add-on/DrawBoard/ParseHinge.ts index a5cdb98f7..2f8f2a90e 100644 --- a/src/Add-on/DrawBoard/ParseHinge.ts +++ b/src/Add-on/DrawBoard/ParseHinge.ts @@ -3,6 +3,7 @@ import { app } from "../../ApplicationServices/Application"; import { arrayPushArray } from "../../Common/ArrayExt"; import { Log } from "../../Common/Log"; import { Intent } from "../../Common/Toaster"; +import { FuzzyFactory } from "../../csg/core/FuzzyFactory"; import { CADObject } from "../../DatabaseServices/CADObject"; import { Board } from "../../DatabaseServices/Entity/Board"; import { Entity } from "../../DatabaseServices/Entity/Entity"; @@ -144,6 +145,8 @@ function ParseHingeToDoor(door: Entity, hingObjId: ObjectId[], hingeM { let doorBox = door.Clone().ApplyMatrix(door.SpaceOCSInv).BoundingBox; + let fuzz = new FuzzyFactory(1, 0.1); + for (let hid of hingObjId) { let hw = hid?.Object as HardwareCompositeEntity; @@ -160,7 +163,7 @@ function ParseHingeToDoor(door: Entity, hingObjId: ObjectId[], hingeM posArr = []; hingeMap.set(key, posArr); } - posArr.push(new Vector2(Math.round(pos.x), Math.round(pos.z))); + posArr.push(new Vector2(fuzz.lookupOrCreate([pos.x], Math.round(pos.x)), Math.round(pos.z))); } } }