예제 #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            List <IGH_Goo> X = new List <IGH_Goo>();

            if (!DA.GetDataList(0, X))
            {
                return;
            }

            ThreeJS tJS = new ThreeJS();


            tJS.SetHeader(new Header());
            tJS.SetFooter(new Footer());

            int          i      = 0;
            List <wMesh> Meshes = new List <wMesh>();

            foreach (IGH_Goo Obj in X)
            {
                wMesh M = new wMesh();
                Obj.CastTo(out M);

                fMesh tMesh = new fMesh(M);
                tMesh.BuildThreeGeometry(i);
                tJS.AddGeometry(tMesh);
                i += 1;
            }
            tJS.Assemble();
            DA.SetData(0, tJS);
        }
예제 #2
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare variables
            string F = null;
            bool   S = false;

            ThreeJS Y = new ThreeJS();

            // Access the input parameters
            if (!DA.GetData(0, ref Y))
            {
                return;
            }
            if (!DA.GetData(1, ref F))
            {
                return;
            }
            if (!DA.GetData(2, ref S))
            {
                return;
            }

            Compile3JS X = new Compile3JS(Y);

            string FilePath = "C:\\Users\\Public\\Documents\\untitled.svg";

            if (F == null)
            {
                if (this.OnPingDocument().FilePath != null)
                {
                    FilePath = Path.GetDirectoryName(this.OnPingDocument().FilePath) + "\\" + Path.GetFileNameWithoutExtension(this.OnPingDocument().FilePath) + ".svg";
                }
            }
            else
            {
                FilePath = F;
            }

            if (S)
            {
                X.Save(FilePath);
            }

            DA.SetData(0, FilePath);
        }
예제 #3
0
 public Compile3JS(ThreeJS ThreeJSassembly)
 {
     ThreeJSAssembly = ThreeJSassembly;
 }