Exemple #1
0
        private static Autodesk.DesignScript.Geometry.Helix Convert(Autodesk.Revit.DB.CylindricalHelix crv)
        {
            if (crv.IsRightHanded)
            {
                // a negative pitch and axis vector produces helix in opposite direction
                return(Autodesk.DesignScript.Geometry.Helix.ByAxis(crv.BasePoint.ToPoint(), (-1.0 * crv.ZVector).ToVector(),
                                                                   crv.GetEndPoint(0).ToPoint(), -crv.Pitch, (crv.Height / crv.Pitch) * 360.0));
            }

            // clockwise is default
            return(Autodesk.DesignScript.Geometry.Helix.ByAxis(crv.BasePoint.ToPoint(), crv.ZVector.ToVector(),
                                                               crv.GetEndPoint(0).ToPoint(), crv.Pitch, (crv.Height / crv.Pitch) * 360.0));
        }
Exemple #2
0
        public static NurbsCurve ToRhino(DB.CylindricalHelix helix)
        {
            var nurbsCurve = NurbsCurve.CreateSpiral
                             (
                AsPoint3d(helix.BasePoint),
                AsVector3d(helix.ZVector),
                AsPoint3d(helix.BasePoint) + AsVector3d(helix.XVector),
                helix.Pitch,
                helix.IsRightHanded ? +1 : -1,
                helix.Radius,
                helix.Radius
                             );

            nurbsCurve.Domain = new Interval(helix.GetEndParameter(0), helix.GetEndParameter(1));
            return(nurbsCurve);
        }
Exemple #3
0
 public static Curve ToCurve(this DB.CylindricalHelix value)
 {
     var rhino = RawDecoder.ToRhino(value); UnitConverter.Scale(rhino, UnitConverter.ToRhinoUnits); return(rhino);
 }
Exemple #4
0
 public static NurbsCurve ToRhino(this DB.CylindricalHelix helix) => RawDecoder.ToRhino(helix);