From b7063ea572bfc89b4d7099b398da3094879267d1 Mon Sep 17 00:00:00 2001 From: ChenX Date: Tue, 23 Aug 2022 17:16:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=E5=9C=A8=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=BC=82=E5=BD=A2=E8=BD=AE=E5=BB=93=E6=97=B6,=E5=B0=9D?= =?UTF-8?q?=E8=AF=95=E5=92=8C=E6=97=A7=E7=9A=84=E5=BC=82=E5=BD=A2=E8=BD=AE?= =?UTF-8?q?=E5=BB=93=E7=9A=84=E9=AB=98=E7=BA=A7=E5=B0=81=E8=BE=B9=E5=92=8C?= =?UTF-8?q?=E6=8E=92=E9=92=BB=E8=BF=9B=E8=A1=8C=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DatabaseServices/Entity/Board.ts | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/DatabaseServices/Entity/Board.ts b/src/DatabaseServices/Entity/Board.ts index f52eeac6c..62c77aab2 100644 --- a/src/DatabaseServices/Entity/Board.ts +++ b/src/DatabaseServices/Entity/Board.ts @@ -790,7 +790,38 @@ export class Board extends ExtrudeSolid { if (this.isRect) ParseBoardRectHoleType(this, TempRectHoleOption); + else//之前不是异形,现在也不是异形时,对排钻边和封边进行映射,避免错误 + { + let size = cu.BoundingBox.getSize(new Vector3); + let isRect = equaln(size.x * size.y, cu.Area, 0.1); + + if (!isRect) + { + let indexMap: number[] = []; + + for (let i = 0; i < cu.EndParam; i++) + { + let p = cu.GetPointAtParam(i + 0.5); + + let cp = this.contourCurve.GetClosestPointTo(p, false); + let cparam = this.contourCurve.GetParamAtPoint2(cp); + indexMap.push(Math.floor(cparam)); + } + + let highDrill = []; + let highSealed = []; + for (let index of indexMap) + { + highDrill.push(this._BoardProcessOption.highDrill[index] ?? this._BoardProcessOption.drillType); + highSealed.push(this._BoardProcessOption.highSealed[index] ?? 0); + } + + this._BoardProcessOption.highDrill = highDrill; + this._BoardProcessOption.highSealed = highSealed; + } + } } + super.ContourCurve = cu; if (this.isRect && TempRectHoleOption.up)