Exemplo n.º 1
0
        /***************************************************/

        public static RHG.Surface ToRhino(this BHG.Loft loft)
        {
            if (loft == null)
            {
                return(null);
            }

            List <BHG.ICurve> bCurves = loft.Curves;

            if (bCurves.Count <= 1)
            {
                return(null);
            }

            List <RHG.Curve> rCurves = new List <RHG.Curve>();

            for (int i = 0; i < bCurves.Count; i++)
            {
                rCurves.Add(bCurves[i].IToRhino());
            }
            bool isClosed = bCurves[0].IIsEqual(bCurves[bCurves.Count - 1]);

            RHG.Brep rloft = RHG.Brep.CreateFromLoft(rCurves, RHG.Point3d.Unset, RHG.Point3d.Unset, RHG.LoftType.Normal, isClosed).FirstOrDefault();

            return(rloft?.Surfaces.FirstOrDefault());
        }
Exemplo n.º 2
0
        /***************************************************/

        public static void RenderMeshes(BHG.Loft surface, Rhino.Display.DisplayPipeline pipeline, DisplayMaterial material)
        {
            pipeline.DrawBrepShaded(RHG.Brep.CreateFromSurface(surface.ToRhino()), material);
        }
Exemplo n.º 3
0
        /***************************************************/

        public static void RenderWires(BHG.Loft surface, Rhino.Display.DisplayPipeline pipeline, Color bhColour)
        {
            RHG.Surface rSurface = surface.ToRhino();
            pipeline.DrawSurface(rSurface, bhColour, 2);
        }