From 08c28121aeefe6fda77a1a990e418037d09c1e7f Mon Sep 17 00:00:00 2001 From: ChenX Date: Sun, 27 Jan 2019 22:06:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E7=82=B9=E6=8B=89=E4=BC=B8=E7=BA=A6?= =?UTF-8?q?=E6=9D=9F=E6=88=90=E5=8F=AA=E8=83=BD=E6=8B=89=E4=BC=B8=E6=88=90?= =?UTF-8?q?=E6=9B=B2=E7=BA=BF=E7=9A=84=E5=9E=82=E8=B6=B3=E6=96=B9=E5=90=91?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DatabaseServices/Extrude.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/DatabaseServices/Extrude.ts b/src/DatabaseServices/Extrude.ts index b1cc57f28..94c2a6ac0 100644 --- a/src/DatabaseServices/Extrude.ts +++ b/src/DatabaseServices/Extrude.ts @@ -514,8 +514,24 @@ export class ExtureSolid extends Entity let localVec = vec.clone().applyMatrix4(this.OCSInv.setPosition(cZeroVec)); - dragType === DragPointType.Grip ? - this.ContourCurve.MoveGripPoints(indexList, localVec) : + if (dragType === DragPointType.Grip) + { + if (this.ContourCurve instanceof Polyline + && indexList.length === 1 + && indexList[0] % 2 === 1) + { + let param = indexList[0] / 2; + if (this.ContourCurve.GetBuilgeAt(Math.floor(param)) === 0) + { + let der = this.ContourCurve.GetFistDeriv(param).normalize(); + [der.x, der.y] = [der.y, -der.x]; + let d = localVec.dot(der); + localVec.copy(der).multiplyScalar(d); + } + } + this.ContourCurve.MoveGripPoints(indexList, localVec); + } + else this.ContourCurve.MoveStretchPoints(indexList, localVec); }