Closed davidstutz closed 6 years ago
Functionality to export a mesh as .off file; see e.g. here for a description of the format. Roughly, the format looks as follows:
.off
OFF n_vertices n_faces n_edges v1_x v1_y v1_z v2_x v2_y v2_z ... f1_n_vertices f1_v1 f1_v2 f1_v3 ... v1_vn f2_n_vertices f2_v1 f1_v2 f2_v3 ... v2_vn ...
where n_edges is 0 when using export_off and only triangular faces are used, i.e. fi_n_vertices is always 3.
n_edges
0
export_off
fi_n_vertices
3
Usage is similar to exporting meshes as .obj or .dae:
.obj
.dae
f = lambda x, y, z: x**2 + y**2 + z**2 vertices, triangles = mcubes.marching_cubes_func((-10,-10,-10), (10,10,10), 100, 100, 100, f, 16) mcubes.export_off(vertices, triangles, "sphere.off")
Thank you!
Functionality to export a mesh as
.off
file; see e.g. here for a description of the format. Roughly, the format looks as follows:where
n_edges
is0
when usingexport_off
and only triangular faces are used, i.e.fi_n_vertices
is always3
.Usage is similar to exporting meshes as
.obj
or.dae
: