Exemplo n.º 1
0
        public static Mesh ZFunction(Func <double, double, double> z, UvSampler vertices)
        {
            SurfaceParametricEquation surface = new SurfaceParametricEquation(
                (u, v) => u,
                (u, v) => v,
                (u, v) => z(u, v)
                );

            return(Parametric(surface, vertices));
        }
Exemplo n.º 2
0
        public static Mesh Sphere(double radius)
        {
            SurfaceParametricEquation surface = new SurfaceParametricEquation(
                (u, v) => radius * Math.Cos(v) * Math.Cos(u),
                (u, v) => radius * Math.Cos(v) * Math.Sin(u),
                (u, v) => radius * Math.Sin(v)
                );
            UvSampler vertices = new UvSampler(new Interval(0, 2 * Math.PI), new Interval(-0.5 * Math.PI, 0.5 * Math.PI), 25, 31);

            return(Parametric(surface, vertices, true, true));
        }
Exemplo n.º 3
0
        public static Mesh ZFunction(Func <double, double, double> z)
        {
            UvSampler vertices = new UvSampler(new Interval(-5, 5), new Interval(-5, 5), 101, 101);

            return(MeshHelpers.ZFunction(z, vertices));
        }
Exemplo n.º 4
0
        public static Mesh HorizontalPlane(UvSampler vertices)
        {
            SurfaceParametricEquation surface = new SurfaceParametricEquation();

            return(Parametric(surface, vertices));
        }
Exemplo n.º 5
0
        public static Mesh Parametric(SurfaceParametricEquation surface, UvSampler vertices, bool closed0 = false, bool closed1 = false)
        {
            MeshBuilder mb = MeshBuilder.ParametricEquation(surface, vertices, closed0, closed1);

            return(mb.ToMesh());
        }
Exemplo n.º 6
0
        public static MeshBuilder ParametricEquation(SurfaceParametricEquation surface, UvSampler vertices, bool closed0 = false, bool closed1 = false)
        {
            var points = vertices.EvaluateSurface(surface);

            return(RectGrid(points, closed0, closed1));
        }