中点拉伸约束成只能拉伸成曲线的垂足方向.

pull/241/MERGE
ChenX 6 years ago
parent 886b28dd55
commit 08c28121ae

@ -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);
}

Loading…
Cancel
Save