修复:平行线倒角避免出现Z=-1的圆弧

pull/1832/MERGE
ChenX 3 years ago
parent b78771b243
commit 6723d7ca07

@ -156,13 +156,11 @@ export class CommandFillet implements Command
if (enRes1.Entity instanceof RoomWallBase)
{
let wall = new RoomWallArc(res.arc.Center, res.arc.Radius, res.arc.StartAngle, res.arc.EndAngle, res.arc.IsClockWise, enRes1.Entity.Thickness);
wall.OCS = res.arc.OCSNoClone;
app.Database.ModelSpace.Append(wall);
}
else if (enRes2.Entity instanceof RoomWallBase)
{
let wall = new RoomWallArc(res.arc.Center, res.arc.Radius, res.arc.StartAngle, res.arc.EndAngle, res.arc.IsClockWise, enRes2.Entity.Thickness);
wall.OCS = res.arc.OCSNoClone;
app.Database.ModelSpace.Append(wall);
}
else

@ -565,8 +565,6 @@ export class FilletUtils
if (isParallelTo(vec, l1Derv))
return;
let planeNormal = vec.cross(l1Derv).normalize();
let par1 = l2.GetClosestAtPoint(l1.StartPoint, true).param;
let par2 = l2.GetClosestAtPoint(l1.EndPoint, true).param;
if (!isIntersect2(0, 1, par1, par2))
@ -609,8 +607,12 @@ export class FilletUtils
//平面矩阵
let xVec = new Vector3();
let yVec = new Vector3();
Orbit.ComputUpDirection(planeNormal, yVec, xVec);
let mtx = new Matrix4().makeBasis(xVec, yVec, planeNormal.negate());
let zVec = vec.cross(l1Derv).normalize();
let l1Normal = l1.Normal;
if (isParallelTo(zVec, l1Normal)) zVec = l1Normal;
Orbit.ComputUpDirection(zVec, yVec, xVec);
let mtx = new Matrix4().makeBasis(xVec, yVec, zVec);
let mtxInv = new Matrix4().getInverse(mtx);
//变换
sv.applyMatrix4(mtxInv);

Loading…
Cancel
Save