Ejemplo n.º 1
0
        protected override void GerarGeometriaRadial(float angulo, float raio_min, float raio_max, int lados)
        {
            float rad = (float)(Math.PI * 2 / lados);

            for (int i = 0; i < lados; i++)
            {
                Vertice2 v = new Vertice2(this);

                if (i % 2 == 0)
                {
                    v.X    = (float)(Math.Cos(i * rad + Util2D.Angulo2Radiano(angulo)) * raio_min);
                    v.Y    = (float)(Math.Sin(i * rad + Util2D.Angulo2Radiano(angulo)) * raio_min);
                    v.Raio = raio_min;
                }
                else
                {
                    v.X    = (float)(Math.Cos(i * rad + Util2D.Angulo2Radiano(angulo)) * raio_max);
                    v.Y    = (float)(Math.Sin(i * rad + Util2D.Angulo2Radiano(angulo)) * raio_max);
                    v.Raio = raio_max;
                }
                v.Rad = i * rad;
                AdicionarVertice(v);
            }

            CriarArestasConvexa();
        }
Ejemplo n.º 2
0
        protected override void GerarGeometriaRadial(float angulo, float raio, int lados)
        {
            float rad = (float)(Math.PI * 2 / lados);

            for (int i = 0; i < lados; i++)
            {
                Vertice2 v = new Vertice2(this);
                v.X = (float)(Math.Cos(i * rad + Util2D.Angulo2Radiano(angulo)) * (raio * 1.5));
                v.Y = (float)(Math.Sin(i * rad + Util2D.Angulo2Radiano(angulo)) * raio);
                AdicionarVertice(v);
            }
        }
Ejemplo n.º 3
0
        protected override void GerarGeometriaRadial(float angulo, float raio, int lados)
        {
#warning Verificar lados+1 se está duplicando a última vértice. Se sim modificar solução.
            float rad = (float)(Math.PI * 2 / /*Verificar*/ (lados + 1));
            for (int i = 0; i < lados; i++)
            {
                Vertice2 v = new Vertice2(this);
                v.X = (float)(Math.Sin(i * rad + Util2D.Angulo2Radiano(angulo)) * raio);
                v.Y = (float)(Math.Cos(i * rad + Util2D.Angulo2Radiano(angulo)) * raio);
                AdicionarVertice(v);
            }
        }
Ejemplo n.º 4
0
        public List <Polyline> Remesh(List <Line> x)
        {
            List <Vertice2> vs; List <IndexPair> id;

            Vertice2.CreateCollection(x, out id, out vs);
            vs = Vertice2.CleanEdge(vs);
            for (int i = 0; i < vs.Count; i++)
            {
                vs[i].Sort(vs);
            }
            for (int i = 0; i < vs.Count; i++)
            {
                Vertice2 v = vs[i];
                GetDirections(ref v);
                vs[i] = v;
            }
            return(Vertice2.Remesh(vs));
        }
Ejemplo n.º 5
0
 public virtual void GetDirections(ref Vertice2 vertice)
 {
     //Vertice2.computeNormal
     return;
 }