Пример #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            var curves = new List <Curve>();

            if (!DA.GetDataList(0, curves))
            {
                return;
            }
            var polylines = curves.Select(c => c.ToPolyline());

            var variables = new List <double>();

            if (!DA.GetDataList(1, variables))
            {
                return;
            }

            GH_Target target = null;

            if (!DA.GetData(2, ref target))
            {
                return;
            }
            if (!(target.Value is CartesianTarget))
            {
                throw new Exception(" Target must be a cartesian target.");
            }

            var speeds = new List <double>();

            if (!DA.GetDataList(3, speeds))
            {
                return;
            }

            var waits = new List <double>();

            if (!DA.GetDataList(4, waits))
            {
                return;
            }

            var dos = new List <int>();

            if (!DA.GetDataList(5, dos))
            {
                return;
            }

            var environment = new List <GeometryBase>();

            DA.GetDataList(6, environment);

            var attributes = new SpatialAttributes(variables, (target.Value) as CartesianTarget, speeds, waits, dos, environment);
            var spatial    = new SpatialExtrusion(polylines, attributes);

            DA.SetDataList(0, spatial.Targets);
            DA.SetDataList(1, spatial.Display.Select(d => d.segment));
            DA.SetDataList(2, spatial.Display.Select(d => d.type));
        }
Пример #2
0
 public Vertex(int index, Point3d point, List <Vertex> vertices, SpatialAttributes att)
 {
     _index    = index;
     _point    = point;
     _vertices = vertices;
     _att      = att;
     vertices.Add(this);
 }