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"); }
public static Vector3D UpperHalfPlaneToIsometric(Vector3D v) { v = HyperbolicModels.UpperToPoincare(v); v = SphericalModels.StereoToGnomonic(v); return(v); }
public static Vector3D OrthoToPoincare(Vector3D v) { return(SphericalModels.GnomonicToStereo(v)); }
public static Vector3D DiskToIsometric(Vector3D v) { // ZZZ - Check that this is correct (it's quite close if not!) return(SphericalModels.StereoToGnomonic(v)); }
public static Vector3D PoincareToOrtho(Vector3D v) { // This may not be correct. // Should probably project to hyperboloid, then remove z coord. return(SphericalModels.StereoToGnomonic(v)); }