示例#1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            GH_String        style = new GH_String("");
            GH_String        layer = new GH_String("");
            GH_Point         stop  = new GH_Point();
            GH_Point         sbtm  = new GH_Point();
            List <Parameter> param = new List <Parameter>();

            if (!DA.GetDataList <Parameter>("Parameters", param))
            {
                param = new List <Parameter>();
            }

            DA.GetData <GH_String>("Style", ref style);
            DA.GetData <GH_String>("Layer", ref layer);

            DA.GetData <GH_Point>("PointTop", ref stop);
            DA.GetData <GH_Point>("PointBottom", ref sbtm);

            Column s = new Column(style.Value, layer.Value, param, sbtm.ToGrevitPoint(), stop.ToGrevitPoint(), "", true);

            SetGID(s);

            Rhino.Geometry.Circle  c   = new Rhino.Geometry.Circle(sbtm.Value, 0.5);
            Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d(new Rhino.Geometry.Point3d(stop.Value.X - sbtm.Value.X, stop.Value.Y - sbtm.Value.Y, stop.Value.Z - sbtm.Value.Z)));
            SetPreview(s.GID, srf.ToBrep());
            DA.SetData("GrevitComponent", s);
        }
示例#2
0
        public void drawColumn(Rhino.Geometry.Point3d point1, double length, double radius)
        {
            Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(point1, radius);

            Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(),
                                                                                     new Rhino.Geometry.Vector3d(0, 0, (length * -1)));

            SetPreview(srf.ToBrep());
        }
示例#3
0
        public void drawColumn(Rhino.Geometry.Point3d point1, Rhino.Geometry.Point3d point2, double radius)
        {
            Rhino.Geometry.Plane  plane = new Rhino.Geometry.Plane(point1, new Rhino.Geometry.Vector3d((point2 - point1)));
            Rhino.Geometry.Circle c     = new Rhino.Geometry.Circle(plane, point1, radius);

            Rhino.Geometry.Surface srf = Rhino.Geometry.Surface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d((point2 - point1)));

            SetPreview(srf.ToBrep());
        }
示例#4
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData <Types.Assembly>("Material", ref assembly);


            GH_Point   point          = new GH_Point();
            GH_Integer piles          = new GH_Integer(1);
            GH_Number  radius         = new GH_Number(0);
            GH_Number  plateThickness = new GH_Number(0);
            GH_Number  plateLength    = new GH_Number(0);
            GH_Number  plateWidth     = new GH_Number(0);
            GH_Number  pileLength     = new GH_Number(0);

            DA.GetData <GH_Point>("Point", ref point);
            DA.GetData <GH_Number>("Pile Radius", ref radius);
            DA.GetData <GH_Integer>("Piles", ref piles);
            DA.GetData <GH_Number>("Plate Thickness", ref plateThickness);
            DA.GetData <GH_Number>("Plate Length", ref plateLength);
            DA.GetData <GH_Number>("Plate Width", ref plateWidth);
            DA.GetData <GH_Number>("Pile Length", ref pileLength);


            drawExtrusion(point.Value, plateLength.Value, plateWidth.Value, plateThickness.Value);
            Rhino.Geometry.Circle circle = new Rhino.Geometry.Circle(point.Value, (plateWidth.Value / 2) * 0.8);

            double numberOfPiles = piles.Value;

            for (int i = 1; i <= piles.Value; i++)
            {
                double iteration = i;
                double factor    = 2.0 * Math.PI * (iteration / numberOfPiles);
                Rhino.Geometry.Point3d center = (piles.Value == 1)? point.Value : circle.ToNurbsCurve().PointAt(factor);
                drawColumn(center, pileLength.Value, radius.Value);
            }


            double calculationVolume = (piles.Value * pileLength.Value * radius.Value) + (plateThickness.Value * plateLength.Value * plateWidth.Value);


            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential     = new Types.UnitDouble <Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationVolume),
                Acidification              = new Types.UnitDouble <Types.LCA.kgSO2>(assembly.Acidification.Value * calculationVolume),
                DepletionOfNonrenewbles    = new Types.UnitDouble <Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationVolume),
                DepletionOfOzoneLayer      = new Types.UnitDouble <Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationVolume),
                Eutrophication             = new Types.UnitDouble <Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationVolume),
                FormationTroposphericOzone = new Types.UnitDouble <Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationVolume)
            };



            DA.SetData("LCA Result", result);
        }
示例#5
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            GH_Point point = new GH_Point();

            Grevit.Types.Wall wall = null;


            GH_String layer = new GH_String("");
            GH_String style = new GH_String("");

            List <Parameter> param = new List <Parameter>();

            if (!DA.GetDataList <Parameter>("Parameters", param))
            {
                param = new List <Parameter>();
            }

            DA.GetData <GH_Point>("Point", ref point);
            DA.GetData <GH_String>("Layer", ref layer);
            DA.GetData <GH_String>("Style", ref style);
            DA.GetData <Wall>("wall", ref wall);


            Door d = new Door();

            SetGID(d);
            d.stalledForReference = true;
            d.TypeOrLayer         = layer.Value;
            d.FamilyOrStyle       = style.Value;
            d.locationPoint       = point.ToGrevitPoint();
            d.parameters          = param;
            SetGID(d);



            Rhino.Geometry.Circle  c   = new Rhino.Geometry.Circle(point.Value, 0.5);
            Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d(0, 0, 2));



            SetPreview(d.GID, srf.ToBrep());


            GH_Surface ghb = new GH_Surface(srf);

            DA.SetData("GrevitComponent", d);
        }
示例#6
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            GH_String level = new GH_String("none");
            GH_String family = new GH_String("none");
            GH_String type = new GH_String("none");
            GH_Point topPoint = new GH_Point();
            GH_Point bottomPoint = new GH_Point();
            GH_String gid = new GH_String("");
            List<Parameter> parameters = new List<Parameter>();
            if (!DA.GetDataList<Parameter>("Parameters", parameters)) parameters = new List<Parameter>();



            DA.GetData<GH_String>("Family", ref family);
            DA.GetData<GH_String>("Type", ref type);
            DA.GetData<GH_String>("Level", ref level);
            DA.GetData<GH_Point>("PointTop", ref topPoint);
            DA.GetData<GH_Point>("PointBottom", ref bottomPoint);
            DA.GetData<GH_String>("GID", ref gid);

            Column column = new Column(family.Value,type.Value,parameters, topPoint.ToGrevitPoint(), bottomPoint.ToGrevitPoint(),level.Value,true);


            SetGID(column);

            Rhino.Geometry.Circle circle = new Rhino.Geometry.Circle(bottomPoint.Value,0.5);
  
            Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(circle.ToNurbsCurve(), new Rhino.Geometry.Vector3d(new Rhino.Geometry.Point3d(topPoint.Value.X-bottomPoint.Value.X,topPoint.Value.Y-bottomPoint.Value.Y,topPoint.Value.Z-bottomPoint.Value.Z)));

            SetPreview(column.GID, srf.ToBrep());

            DA.SetData("GrevitComponent", column);
        }
示例#7
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            GH_String style = new GH_String("");
            GH_String layer = new GH_String("");
            GH_Point stop = new GH_Point();
            GH_Point sbtm = new GH_Point();
            List<Parameter> param = new List<Parameter>();
            if (!DA.GetDataList<Parameter>("Parameters", param)) param = new List<Parameter>();

            DA.GetData<GH_String>("Style", ref style);
            DA.GetData<GH_String>("Layer", ref layer);

            DA.GetData<GH_Point>("PointTop", ref stop);
            DA.GetData<GH_Point>("PointBottom", ref sbtm);

            Column s = new Column(style.Value,layer.Value,param,sbtm.ToGrevitPoint(),stop.ToGrevitPoint(),"",true );
            SetGID(s);

            Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(sbtm.Value, 0.5);
            Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d(new Rhino.Geometry.Point3d(stop.Value.X - sbtm.Value.X, stop.Value.Y - sbtm.Value.Y, stop.Value.Z - sbtm.Value.Z)));
            SetPreview(s.GID, srf.ToBrep());
            DA.SetData("GrevitComponent", s);
        }
示例#8
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            GH_Point point = new GH_Point();
            Grevit.Types.Wall wall = null;

            GH_String layer = new GH_String("");
            GH_String style = new GH_String("");

            List<Parameter> param = new List<Parameter>();
            if (!DA.GetDataList<Parameter>("Parameters", param)) param = new List<Parameter>();

            DA.GetData<GH_Point>("Point", ref point);
            DA.GetData<GH_String>("Layer", ref layer);
            DA.GetData<GH_String>("Style", ref style);
            DA.GetData<Wall>("wall", ref wall);

            Door d = new Door();
            SetGID(d);
            d.stalledForReference = true;
            d.TypeOrLayer = layer.Value;
            d.FamilyOrStyle = style.Value;
            d.locationPoint = point.ToGrevitPoint();
            d.parameters = param;
            SetGID(d);

               Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(point.Value, 0.5);
               Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d(0,0, 2));

            SetPreview(d.GID, srf.ToBrep());

            GH_Surface ghb = new GH_Surface(srf);

            DA.SetData("GrevitComponent", d);
        }
示例#9
0
        public void drawColumn(Rhino.Geometry.Point3d point1, double length, double radius)
        {
            Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(point1,radius);

            Rhino.Geometry.Surface srf = Rhino.Geometry.NurbsSurface.CreateExtrusion(c.ToNurbsCurve(),
                new Rhino.Geometry.Vector3d(0,0,(length*-1)));

            SetPreview(srf.ToBrep());
        }
示例#10
0
        public void drawColumn(Rhino.Geometry.Point3d point1, Rhino.Geometry.Point3d point2, double radius)
        {
            Rhino.Geometry.Plane plane = new Rhino.Geometry.Plane(point1, new Rhino.Geometry.Vector3d((point2 - point1)));
            Rhino.Geometry.Circle c = new Rhino.Geometry.Circle(plane,point1,radius);

            Rhino.Geometry.Surface srf = Rhino.Geometry.Surface.CreateExtrusion(c.ToNurbsCurve(), new Rhino.Geometry.Vector3d((point2 - point1)));

            SetPreview(srf.ToBrep());
        }
示例#11
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Types.Assembly assembly = new Types.Assembly();
            DA.GetData<Types.Assembly>("Material", ref assembly);

            GH_Point point = new GH_Point();
            GH_Integer piles = new GH_Integer(1);
            GH_Number radius = new GH_Number(0);
            GH_Number plateThickness = new GH_Number(0);
            GH_Number plateLength = new GH_Number(0);
            GH_Number plateWidth = new GH_Number(0);
            GH_Number pileLength = new GH_Number(0);

            DA.GetData<GH_Point>("Point", ref point);
            DA.GetData<GH_Number>("Pile Radius", ref radius);
            DA.GetData<GH_Integer>("Piles", ref piles);
            DA.GetData<GH_Number>("Plate Thickness", ref plateThickness);
            DA.GetData<GH_Number>("Plate Length", ref plateLength);
            DA.GetData<GH_Number>("Plate Width", ref plateWidth);
            DA.GetData<GH_Number>("Pile Length", ref pileLength);

            drawExtrusion(point.Value, plateLength.Value, plateWidth.Value, plateThickness.Value);
            Rhino.Geometry.Circle circle = new Rhino.Geometry.Circle(point.Value, (plateWidth.Value / 2) * 0.8);

            double numberOfPiles = piles.Value;

            for (int i = 1; i <= piles.Value; i++)
            {
                double iteration = i;
                double factor = 2.0 * Math.PI * (iteration / numberOfPiles);
                Rhino.Geometry.Point3d center = (piles.Value == 1)? point.Value : circle.ToNurbsCurve().PointAt(factor);
                drawColumn(center, pileLength.Value, radius.Value);
            }

            double calculationVolume = (piles.Value * pileLength.Value * radius.Value) + (plateThickness.Value * plateLength.Value * plateWidth.Value);

            Types.Result result = new Types.Result()
            {
                GlobalWarmingPotential = new Types.UnitDouble<Types.LCA.CO2e>(assembly.GlobalWarmingPotential.Value * calculationVolume),
                Acidification = new Types.UnitDouble<Types.LCA.kgSO2>(assembly.Acidification.Value * calculationVolume),
                DepletionOfNonrenewbles = new Types.UnitDouble<Types.LCA.MJ>(assembly.DepletionOfNonrenewbles.Value * calculationVolume),
                DepletionOfOzoneLayer = new Types.UnitDouble<Types.LCA.kgCFC11>(assembly.DepletionOfOzoneLayer.Value * calculationVolume),
                Eutrophication = new Types.UnitDouble<Types.LCA.kgPhostphate>(assembly.Eutrophication.Value * calculationVolume),
                FormationTroposphericOzone = new Types.UnitDouble<Types.LCA.kgNOx>(assembly.FormationTroposphericOzone.Value * calculationVolume)
            };

            DA.SetData("LCA Result", result);
        }