Exemplo n.º 1
0
        public void Tesselate(double resolution, Storage.Builders.ITriangleBuilder3d builder)
        {
            if (resolution < 0.0 ||
                (resolution > SideA && resolution > SideB && resolution > SideC && resolution > SideD))
            {
                if (builder.IsIndexed)
                {
                    // We simply append vertices and proceed.
                    uint indexBase = builder.AddControlPoints(A, B, C, D);

                    // Add vertices if indexed

                    builder.AddIndexedTriangles(
                        new uint[] { indexBase, indexBase + 1, indexBase + 2,
                                     indexBase, indexBase + 2, indexBase + 3 }
                        );
                }
                else
                {
                    // We need to pust 2 triangles.
                    builder.AddControlPoints(A, B, C, A, C, D);
                }
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Exemplo n.º 2
0
        public void Tesselate(double resolution, Storage.Builders.ITriangleBuilder3d builder)
        {
            // We create a special line builder that will create contours.
            ContourBuilder contourBuilder = new ContourBuilder();

            Sample(resolution, contourBuilder);

            // We now invoke the algorithm.
            Algorithms.PolygonTesselation.Tesselate(contourBuilder.Contours, builder);
        }
Exemplo n.º 3
0
        public void Tesselate(double resolution, Storage.Builders.ITriangleBuilder3d builder)
        {
            // Adaptive same as normal
            if (resolution < 0)
            {
                resolution = -resolution;
            }

            throw new NotImplementedException();
        }
Exemplo n.º 4
0
        public void Tesselate(double resolution, Storage.Builders.ITriangleBuilder3d builder)
        {
            Vector3d[] points = this.ConvertToList(resolution);

            // We now tesselate points.
            List <Vector3d[]> polygons = new List <Vector3d[]>();

            polygons.Add(points);

            Algorithms.PolygonTesselation.Tesselate(polygons, builder);
        }
Exemplo n.º 5
0
        public void Tesselate(double resolution, Storage.Builders.ITriangleBuilder3d builder)
        {
            if (resolution < 0.0 ||
                (resolution > SideX && resolution > SideX && resolution > SideX))
            {
                if (!builder.IsIndexed)
                {
                    // Non indexed really isnt the best practice here ...
                    throw new NotImplementedException();
                }
                else
                {
                    // We simply append vertices and proceed.
                    uint indexBase = builder.AddControlPoints(
                        new Vector3d(Min.X, Min.Y, Min.Z),
                        new Vector3d(Max.X, Min.Y, Min.Z),
                        new Vector3d(Max.X, Min.Y, Max.Z),
                        new Vector3d(Min.X, Min.Y, Max.Z),
                        new Vector3d(Min.X, Max.Y, Min.Z),
                        new Vector3d(Max.X, Max.Y, Min.Z),
                        new Vector3d(Max.X, Max.Y, Max.Z),
                        new Vector3d(Min.X, Max.Y, Max.Z));

                    // We also need indices if indexed.

                    builder.AddIndexedTriangles(
                        new uint[] {
                        indexBase, indexBase + 1, indexBase + 2,
                        indexBase, indexBase + 2, indexBase + 3,
                        indexBase, indexBase + 5, indexBase + 1,
                        indexBase, indexBase + 4, indexBase + 5,
                        indexBase + 1, indexBase + 6, indexBase + 2,
                        indexBase + 1, indexBase + 5, indexBase + 6,
                        indexBase, indexBase + 3, indexBase + 7,
                        indexBase, indexBase + 7, indexBase + 4,
                        indexBase + 3, indexBase + 2, indexBase + 6,
                        indexBase + 3, indexBase + 6, indexBase + 7,
                        indexBase + 4, indexBase + 6, indexBase + 5,
                        indexBase + 4, indexBase + 7, indexBase + 6
                    }
                        );
                }
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Exemplo n.º 6
0
 public void Tesselate(double resolution, Storage.Builders.ITriangleBuilder3d builder)
 {
     throw new NotImplementedException();
 }