Пример #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)
        {
            Mesh mesh = new Mesh();
            Mesh img  = new Mesh();

            if (!DA.GetData(0, ref mesh))
            {
                return;
            }

            API.MeshAPI_CS api_cs = new API.MeshAPI_CS();
            api_cs.loadFrom(ref mesh);
            API.Param_UFB_ARAP_CS(ref api_cs);

            Mesh rstMesh = new Mesh();

            rstMesh.CopyFrom(mesh);
            api_cs.updateTexCoordTo(ref rstMesh);

            List <float> texCoord_X = new List <float>();
            List <float> texCoord_Y = new List <float>();

            for (int i = 0; i < rstMesh.Vertices.Count; i++)
            {
                texCoord_X.Add(rstMesh.TextureCoordinates[i].X);
                texCoord_Y.Add(rstMesh.TextureCoordinates[i].Y);
            }

            DA.SetData(0, rstMesh);
            DA.SetDataList(1, texCoord_X);
            DA.SetDataList(2, texCoord_Y);
        }
Пример #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)
        {
            Curve curve    = null;
            int   pointNum = new int();

            if (!DA.GetData(0, ref curve))
            {
                return;
            }
            if (!DA.GetData(1, ref pointNum))
            {
                return;
            }
            if (pointNum < 3)
            {
                base.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "PointNum is should be larger than 3.");
                return;
            }

            API.MeshAPI_CS api_cs = new API.MeshAPI_CS();
            api_cs.loadFrom(ref curve, pointNum);

            Mesh mesh = new Mesh();

            API.MinSrfCurve_CS(ref api_cs, ref mesh);

            //api_cs.convertTo(ref mesh);

            DA.SetData(0, mesh);
        }
Пример #3
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)
        {
            Mesh mesh = new Mesh();

            if (!DA.GetData(0, ref mesh))
            {
                return;
            }

            API.MeshAPI_CS api = new API.MeshAPI_CS();
            api.loadFrom(ref mesh);

            API.MinSrfLocal_CS(ref api);

            Mesh rstM = new Mesh();

            rstM.CopyFrom(mesh);
            api.convertTo(ref rstM);

            DA.SetData(0, rstM);
        }