public Export ( |
||
mesh | The current mesh. | |
filename | string | The EPS filename. |
width | int | The desired width of the image (currently ignored). |
return | void |
public void Export(Mesh mesh, string filename, int width)
{
// Check file name
if (String.IsNullOrWhiteSpace(filename))
{
filename = String.Format("mesh-{0}.eps", DateTime.Now.ToString("yyyy-M-d-hh-mm-ss"));
}
if (!filename.EndsWith(".eps"))
{
filename = Path.ChangeExtension(filename, ".eps");
}
UpdateMetrics(mesh.Bounds);
using (StreamWriter eps = new StreamWriter(filename))
{
WriteHeader(filename, eps);
DrawClip(eps);
DrawTriangles(eps, mesh, false);
DrawSegments(eps, mesh);
DrawPoints(eps, mesh, false);
WriteTrailer(eps);
}
}
private void ExportEps(Mesh mesh, string filename, int width, bool compress) { var eps = new EpsImage(); eps.Export(mesh, filename, width); if (compress) { CompressFile(filename, true); } }