yt.data_objects.construction_data_containers.YTSurfaceBase.export_ply

YTSurfaceBase.export_ply(filename, bounds=None, color_field=None, color_map='algae', color_log=True, sample_type='face', no_ghost=False)[source]

This exports the surface to the PLY format, suitable for visualization in many different programs (e.g., MeshLab).

Parameters:

filename : string

The file this will be exported to. This cannot be a file-like object.

bounds : list of tuples

The bounds the vertices will be normalized to. This is of the format: [(xmin, xmax), (ymin, ymax), (zmin, zmax)]. Defaults to the full domain.

color_field : string

Should a field be sample and colormapped?

color_map : string

Which color map should be applied?

color_log : bool

Should the color field be logged before being mapped?

Examples

>>> from yt.units import kpc
>>> sp = ds.sphere("max", (10, "kpc")
>>> surf = ds.surface(sp, "density", 5e-27)
>>> print surf["temperature"]
>>> print surf.vertices
>>> bounds = [(sp.center[i] - 5.0*kpc,
...            sp.center[i] + 5.0*kpc) for i in range(3)]
>>> surf.export_ply("my_galaxy.ply", bounds = bounds)