add missing argument in parser
@@ -36,6 +36,8 @@ def read_inputs():
help="a2 principal semi-axis (0, a2, 0)")
parser.add_argument('-a3', '--a3_semi_ax', dest='a3', type=float, default=None,
help="a3 principal semi-axis (0, 0, a3)")
+ parser.add_argument('-fn', '--filename', dest='filename', type=str, default=None,
+ help="output file name")
return parser.parse_args()
@@ -262,13 +264,15 @@ if __name__ == "__main__":
a1 = args.a1
a2 = args.a2
a3 = args.a3
+ filename = args.filename
# Get a unit sphere triangulation with a specified level of refinement.
# A refinement level of N will have (20*N^2) faces and (10*N^2 + 2)
# vertices
isph = icosphere(n)
vertices = isph.p
- faces = isph.tri
+ faces = isph.tri + 1 # Agrees with msms format
+
# get spherical coordinates for each point and project it to the
# corresponding point on the ellipsoid. a,b,c are the semi-major axes
@@ -281,6 +285,8 @@ if __name__ == "__main__":
vertices[:, 2] = a3*numpy.cos(spvert[:, 1])
+ numpy.savetxt(filename+'.vert', vertices, fmt='%.4f')
+ numpy.savetxt(filename+'.face', faces, fmt='%i')
