Пример #1
0
        //--------------------------------------------- FROM RHINO TYPES

        public static GH_Curve CastFromPLine(Polyline crv)
        {
            GH_Curve outcv = new GH_Curve();

            outcv.CastFrom(crv);
            return(outcv);
        }
Пример #2
0
        /// <summary>
        /// Build curves representation with 1D tree structure. branch = one curve
        /// </summary>
        /// <param name="inputPlanes"></param>
        /// <returns></returns>
        private GH_Structure <GH_Curve> BuildStructureAsCurves(GH_Structure <GH_Plane> inputPlanes)
        {
            GH_Structure <GH_Curve> curves = new GH_Structure <GH_Curve>();

            for (int i = 0; i < inputPlanes.PathCount; i++)
            {
                List <Point3d> cp = new List <Point3d>();
                foreach (GH_Plane plane in inputPlanes.get_Branch(i))
                {
                    cp.Add(plane.Value.Origin);
                }
                GH_Curve cv = new GH_Curve();
                cv.CastFrom(Curve.CreateInterpolatedCurve(cp, 3));
                curves.Append(cv, new GH_Path(i));
            }
            return(curves);
        }
Пример #3
0
        /// <summary>
        /// Path[0] = joint; Path[1] = member
        /// </summary>
        /// <param name="inputPlanes"></param>
        /// <returns></returns>
        private GH_Structure <GH_Curve> BuildStructureAsCurves()
        {
            GH_Structure <GH_Curve> curves = new GH_Structure <GH_Curve>();

            for (int i = 0; i < Utility.GetMainBranchCount(inputPlanes.Paths); i++)
            {
                int subBranchCount = Utility.GetSecondaryBranchCount(inputPlanes.Paths, i);
                for (int j = 0; j < subBranchCount; j++)
                {
                    GH_Path        path = new GH_Path(i, j);
                    List <Point3d> cp   = new List <Point3d>();
                    foreach (GH_Plane plane in inputPlanes.get_Branch(path))
                    {
                        cp.Add(plane.Value.Origin);
                    }
                    GH_Curve cv = new GH_Curve();
                    cv.CastFrom(Curve.CreateInterpolatedCurve(cp, 3));
                    curves.Append(cv, path);
                }
            }
            return(curves);
        }