Ejemplo n.º 1
0
 public static Mesh <V> GetMesh(int slices, int stacks)
 {
     return(MeshTools.Join(
                GetFrontMesh(slices, stacks),
                GetBorderMeshes(slices, 1),
                GetBackMesh(slices, stacks)));
 }
Ejemplo n.º 2
0
        private static Mesh <V> GetBorderMeshes(int slices, int stacks)
        {
            var meshes = new[]
            {
                MyManifold <V> .Lofted(slices, stacks,
                                       t => bottomLeftCurve.GetPoint(1 - t),
                                       t => bottomLeftCurve.GetPoint(1 - t) + float3.back),
                MyManifold <V> .Lofted(slices, stacks,
                                       t => bottomRightCurve.GetPoint(t),
                                       t => bottomRightCurve.GetPoint(t) + float3.back),
                MyManifold <V> .Lofted(slices, stacks,
                                       t => topLeftCurve.GetPoint(1 - t),
                                       t => topLeftCurve.GetPoint(1 - t) + float3.back),
                MyManifold <V> .Lofted(slices, stacks,
                                       t => topRightCurve.GetPoint(t),
                                       t => topRightCurve.GetPoint(t) + float3.back)
            };

            return(MeshTools.Join(meshes).Weld());
        }