Table of Contents

Class ObjWriter

Namespace
GeometryHelper.Export
Assembly
GeometryHelper.dll

Writes geometry in space as a Wavefront OBJ file, to look at in any 3D viewer.

public sealed class ObjWriter
Inheritance
ObjWriter
Inherited Members

Remarks

Every shape added becomes an object of its own, named as given, so a viewer lists them separately: a body as the mesh of where its material ends, a face as its triangles, a chain as a line. Coordinates are written exactly, so what is looked at is what was computed, however far from the origin.

new ObjWriter().Add(plate, "plate").Add(bolt, "bolt").Save("clash.obj");

Methods

Add(GeoFace3, string)

Adds a face, holes left open.

Add(GeoLine3, string)

Adds a segment as a line.

Add(GeoPolyline3, string)

Adds a chain as a line through its vertices.

Add(GeoPolylineArc3, double, string)

Adds a chain with bends as a line, each bend cut into chords no further than a tolerance from it.

Add(GeoSolid3, string)

Adds a body: the mesh of where its material ends, openings cut in.

Add(GeoCellGrid3, string)

Adds the cells of a body, each an object of its own named after its indexes, so that a viewer lists them and shows or hides them one by one.

Add(GeoMesh3, string)

Adds the mesh of a flat shape, its faces sharing their vertices: a face that turns right at none of its corners as one polygon, so that a viewer shows the cells of a grid as they are, and any other as its triangles.

Add(IEnumerable<GeoTriangle3>, string)

Adds a mesh of triangles.

Save(string)

Writes the file to a path, replacing whatever is there.

ToString()

Gets the file as text.

WriteTo(TextWriter)

Writes the file to a writer.