当前位置: 首页>>代码示例>>C#>>正文


C# Autodesk.GetEndParameter方法代码示例

本文整理汇总了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());
        }
开发者ID:TheChosen0ne,项目名称:Dynamo,代码行数:18,代码来源:RevitToProtoCurve.cs

示例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());
        }
开发者ID:algobasket,项目名称:Dynamo,代码行数:19,代码来源:RevitToProtoCurve.cs

示例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);
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:31,代码来源:RevitToProtoCurve.cs


注:本文中的Autodesk.GetEndParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。