本文整理汇总了C#中ICurve.Trim方法的典型用法代码示例。如果您正苦于以下问题:C# ICurve.Trim方法的具体用法?C# ICurve.Trim怎么用?C# ICurve.Trim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICurve
的用法示例。
在下文中一共展示了ICurve.Trim方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateParallelogramOnSubSegOnBezierSeg
internal static bool CreateParallelogramOnSubSegOnBezierSeg(double start, double end, ICurve seg, ref Parallelogram box) {
CubicBezierSegment trimSeg = seg.Trim(start, end) as CubicBezierSegment;
B b = trimSeg.B;
Point a = b(1) - b(0);
box = new Parallelogram(b(0), a, b(3) - b(0));
if (box.Contains(b(2)))
return true;
box = new Parallelogram(b(3), b(2) - b(3), b(0) - b(3));
if (box.Contains(b(1)))
return true;
return false;
}
示例2: TrimEdgeSplineWithNodeBoundaries
internal static ICurve TrimEdgeSplineWithNodeBoundaries(ICurve sourceBoundary,
ICurve targetBoundary, ICurve spline,
bool narrowestInterval) {
var start = spline.ParStart;
var end = spline.ParEnd;
if (sourceBoundary != null)
FindNewStart(spline, ref start, sourceBoundary, narrowestInterval);
if (targetBoundary != null)
FindNewEnd(spline, targetBoundary, narrowestInterval, ref end);
double st = Math.Min(start, end);
double en = Math.Max(start, end);
return st < en ? spline.Trim(st, en) : spline;
}
示例3: GetTrimmedCurveForHookingUpAnywhere
static ICurve GetTrimmedCurveForHookingUpAnywhere(ICurve curve, PolylinePoint lastPointInside, IntersectionInfo x0, IntersectionInfo x1) {
var clockwise =
Point.GetTriangleOrientation(x1.IntersectionPoint, x0.IntersectionPoint, lastPointInside.Point) ==
TriangleOrientation.Clockwise;
double rightX = x0.Par0;
double leftX = x1.Par0;
ICurve tr0, tr1;
Curve ret;
if (clockwise) {
if (rightX < leftX)
return curve.Trim(rightX, leftX);
tr0 = curve.Trim(rightX, curve.ParEnd);
tr1 = curve.Trim(curve.ParStart, leftX);
ret = new Curve();
return ret.AddSegs(tr0, tr1);
}
if (leftX < rightX)
return curve.Trim(leftX, rightX);
tr0 = curve.Trim(leftX, curve.ParEnd);
tr1 = curve.Trim(curve.ParStart, rightX);
ret = new Curve();
return ret.AddSegs(tr0, tr1);
}