Beispiel #1
0
        public static void EdgesToStl(H3.Cell.Edge[] edges)
        {
            Shapeways mesh = new Shapeways();

            int divisions = 25;

            foreach (H3.Cell.Edge edge in edges)
            {
                Segment seg = Segment.Line(
                    Sterographic.R3toS3(edge.Start),
                    Sterographic.R3toS3(edge.End));
                Vector3D[] points = seg.Subdivide(divisions);

                ProjectAndAddS3Points(mesh, points);
            }

            for (int i = 0; i < mesh.Mesh.Triangles.Count; i++)
            {
                mesh.Mesh.Triangles[i] = new Mesh.Triangle(
                    SphericalModels.StereoToEqualVolume(mesh.Mesh.Triangles[i].a),
                    SphericalModels.StereoToEqualVolume(mesh.Mesh.Triangles[i].b),
                    SphericalModels.StereoToEqualVolume(mesh.Mesh.Triangles[i].c));
            }

            STL.SaveMeshToSTL(mesh.Mesh, @"output.stl");
        }
Beispiel #2
0
 public static Vector3D UpperHalfPlaneToIsometric(Vector3D v)
 {
     v = HyperbolicModels.UpperToPoincare(v);
     v = SphericalModels.StereoToGnomonic(v);
     return(v);
 }
Beispiel #3
0
 public static Vector3D OrthoToPoincare(Vector3D v)
 {
     return(SphericalModels.GnomonicToStereo(v));
 }
Beispiel #4
0
 public static Vector3D DiskToIsometric(Vector3D v)
 {
     // ZZZ - Check that this is correct (it's quite close if not!)
     return(SphericalModels.StereoToGnomonic(v));
 }
Beispiel #5
0
 public static Vector3D PoincareToOrtho(Vector3D v)
 {
     // This may not be correct.
     // Should probably project to hyperboloid, then remove z coord.
     return(SphericalModels.StereoToGnomonic(v));
 }