|
|
|
@ -9,7 +9,7 @@ import { Line } from "../DatabaseServices/Entity/Line";
|
|
|
|
|
import { Polyline } from "../DatabaseServices/Entity/Polyline";
|
|
|
|
|
import { Spline } from "../DatabaseServices/Spline";
|
|
|
|
|
import { PromptEntityResult, PromptPointResult } from "../Editor/PromptResult";
|
|
|
|
|
import { angle, AsVector2, equaln, equalv3, isIntersect2, isParallelTo, midPoint } from "../Geometry/GeUtils";
|
|
|
|
|
import { AsVector2, angle, equaln, equalv3, isIntersect2, isParallelTo, midPoint } from "../Geometry/GeUtils";
|
|
|
|
|
import { Orbit } from "../Geometry/Orbit";
|
|
|
|
|
import { IntersectOption } from "../GraphicsSystem/IntersectWith";
|
|
|
|
|
|
|
|
|
@ -223,7 +223,7 @@ export class FilletUtils
|
|
|
|
|
let c1 = pl.GetCurveAtParam(param1);
|
|
|
|
|
let c2 = pl.GetCurveAtParam(param2);
|
|
|
|
|
|
|
|
|
|
if (equalv3(c1.GetFistDeriv(1).normalize(), c2.GetFistDeriv(0).normalize()))
|
|
|
|
|
if (equalv3(c1.GetFirstDeriv(1).normalize(), c2.GetFirstDeriv(0).normalize()))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
let es1 = new PromptEntityResult();
|
|
|
|
@ -463,7 +463,7 @@ export class FilletUtils
|
|
|
|
|
if (!c2)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
if (equalv3(c1.GetFistDeriv(1).normalize(), c2.GetFistDeriv(0).normalize()))
|
|
|
|
|
if (equalv3(c1.GetFirstDeriv(1).normalize(), c2.GetFirstDeriv(0).normalize()))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
let es1 = new PromptEntityResult();
|
|
|
|
@ -557,8 +557,8 @@ export class FilletUtils
|
|
|
|
|
let l1 = enRes1.Entity as Line;
|
|
|
|
|
let l2 = enRes2.Entity as Line;
|
|
|
|
|
|
|
|
|
|
let l1Derv = l1.GetFistDeriv(0);
|
|
|
|
|
if (!isParallelTo(l1Derv, l2.GetFistDeriv(0)))
|
|
|
|
|
let l1Derv = l1.GetFirstDeriv(0);
|
|
|
|
|
if (!isParallelTo(l1Derv, l2.GetFirstDeriv(0)))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
let vec = l2.StartPoint.sub(l1.StartPoint);
|
|
|
|
@ -686,11 +686,11 @@ export class FilletUtils
|
|
|
|
|
let a1Param = a1.GetParamAtPoint(narcP1);
|
|
|
|
|
let a2Param = a2.GetParamAtPoint(narcP2);
|
|
|
|
|
|
|
|
|
|
let a1Derv = a1.GetFistDeriv(a1Param).normalize();
|
|
|
|
|
let a2Derv = a2.GetFistDeriv(a2Param).normalize();
|
|
|
|
|
let a1Derv = a1.GetFirstDeriv(a1Param).normalize();
|
|
|
|
|
let a2Derv = a2.GetFirstDeriv(a2Param).normalize();
|
|
|
|
|
|
|
|
|
|
let narcDerv0 = narc.GetFistDeriv(0).normalize();
|
|
|
|
|
let narcDerv1 = narc.GetFistDeriv(1).normalize();
|
|
|
|
|
let narcDerv0 = narc.GetFirstDeriv(0).normalize();
|
|
|
|
|
let narcDerv1 = narc.GetFirstDeriv(1).normalize();
|
|
|
|
|
|
|
|
|
|
//裁剪圆弧
|
|
|
|
|
if (equalv3(a1Derv, narcDerv0))
|
|
|
|
@ -779,8 +779,8 @@ export class FilletUtils
|
|
|
|
|
|
|
|
|
|
//裁剪圆弧
|
|
|
|
|
let arcParam = arc.GetParamAtPoint(arcP2);
|
|
|
|
|
let arcDerv = arc.GetFistDeriv(arcParam).normalize();
|
|
|
|
|
let narcDerv = narc.GetFistDeriv(1).normalize();
|
|
|
|
|
let arcDerv = arc.GetFirstDeriv(arcParam).normalize();
|
|
|
|
|
let narcDerv = narc.GetFirstDeriv(1).normalize();
|
|
|
|
|
|
|
|
|
|
let arcExtend: ExtendType;
|
|
|
|
|
if (equalv3(arcDerv, narcDerv))
|
|
|
|
@ -852,12 +852,12 @@ export class FilletUtils
|
|
|
|
|
let cu = cuRes.Curve;
|
|
|
|
|
if (cuRes.ExtType === ExtendType.Start)
|
|
|
|
|
{
|
|
|
|
|
derv = cu.GetFistDeriv(0).normalize();
|
|
|
|
|
derv = cu.GetFirstDeriv(0).normalize();
|
|
|
|
|
dervSum.add(derv);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
derv = cu.GetFistDeriv(cu.EndParam).normalize();
|
|
|
|
|
derv = cu.GetFirstDeriv(cu.EndParam).normalize();
|
|
|
|
|
dervSum.add(derv.clone().negate());
|
|
|
|
|
}
|
|
|
|
|
return derv;
|
|
|
|
|