本文整理汇总了C#中Autodesk.GetEndParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Autodesk.GetEndParameter方法的具体用法?C# Autodesk.GetEndParameter怎么用?C# Autodesk.GetEndParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autodesk
的用法示例。
在下文中一共展示了Autodesk.GetEndParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Convert
/// <summary>
/// Convert a Revit Arc to a ProtoGeometry Arc
/// </summary>
/// <param name="crv"></param>
/// <returns></returns>
private static Autodesk.DesignScript.Geometry.Curve Convert(Autodesk.Revit.DB.Arc crv)
{
var isCircle = !crv.IsBound ||
Math.Abs(Math.Abs(crv.GetEndParameter(1) - crv.GetEndParameter(0)) - 2*Math.PI) < 1e-6;
if ( isCircle )
{
return Circle.ByCenterPointRadiusNormal(crv.Center.ToPoint(), crv.Radius, crv.Normal.ToVector());
}
return Arc.ByCenterPointStartPointSweepAngle(crv.Center.ToPoint(), crv.GetEndPoint(0).ToPoint(),
(crv.GetEndParameter(1) - crv.GetEndParameter(0))*180/Math.PI, crv.Normal.ToVector());
}
示例2: Convert
private static Autodesk.DesignScript.Geometry.Curve Convert(Autodesk.Revit.DB.Ellipse crv)
{
var isComplete = !crv.IsBound ||
Math.Abs(Math.Abs(crv.GetEndParameter(1) - crv.GetEndParameter(0)) - 2*Math.PI) < 1e-6;
if (!isComplete)
{
var pl = Plane.ByOriginXAxisYAxis(crv.Center.ToPoint(),
crv.XDirection.ToVector(), crv.YDirection.ToVector());
var s = crv.GetEndParameter(0).ToDegrees();
var e = crv.GetEndParameter(1).ToDegrees();
return EllipseArc.ByPlaneRadiiStartAngleSweepAngle(pl, crv.RadiusX, crv.RadiusY, s, e - s);
}
return Autodesk.DesignScript.Geometry.Ellipse.ByOriginVectors(crv.Center.ToPoint(),
(crv.XDirection*crv.RadiusX).ToVector(), (crv.YDirection*crv.RadiusY).ToVector());
}
示例3: Convert
private static Autodesk.DesignScript.Geometry.Curve Convert(Autodesk.Revit.DB.NurbSpline crv)
{
var convert = NurbsCurve.ByControlPointsWeightsKnots(crv.CtrlPoints.Select(x => x.ToPoint(false)).ToArray(),
crv.Weights.Cast<double>().ToArray(), crv.Knots.Cast<double>().ToArray(), crv.Degree );
if (!crv.IsBound) return convert;
// bound the curve parametric range
// we first get the full parametric domain from the knots
// note that some knots be negative and the domain may appear reversed
var parms = crv.Knots.Cast<double>().ToList();
var fsp = parms.First();
var fep = parms.Last();
// obtain the full domain
var fd = Math.Abs(fsp - fep);
// these are the start and end parameters of the bound curve
var sp = crv.GetEndParameter(0);
var ep = crv.GetEndParameter(1);
// get the normalized parameters for trim
var nsp = Math.Abs(fsp - sp) / fd;
var nep = Math.Abs(fsp - ep) / fd;
// if there's no trimming to do, avoid it
if (Math.Abs(nsp) < 1e-6 && Math.Abs(1 - nep) < 1e-6) return convert;
return convert.ParameterTrim(nsp, nep);
}