/// <summary> /// Exports specified <see cref="Visual3D"/> /// </summary> /// <param name="visual">The <see cref="Visual3D"/> to export.</param> /// <param name="stream">The output stream to export to</param> public override void Export(Visual3D visual, Stream stream) { var writer = Create(stream); int triangleIndicesCount = 0; visual.Traverse <GeometryModel3D>((m, t) => triangleIndicesCount += ((MeshGeometry3D)m.Geometry).TriangleIndices.Count); ExportHeader(writer, triangleIndicesCount / 3); visual.Traverse <GeometryModel3D>((m, t) => ExportModel(writer, m, t)); Close(writer); }
/// <summary> /// Exports the specified visual. /// </summary> /// <param name="visual">The visual.</param> /// <param name="stream">The output stream.</param> public virtual void Export(Visual3D visual, Stream stream) { var writer = this.Create(stream); this.ExportHeader(writer); visual.Traverse <GeometryModel3D>((m, t) => this.ExportModel(writer, m, t)); this.Close(writer); }