java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.IO3D

public final class IO3D extends Object
Utility class providing convenient access to 3D IO functionality. The static read and write methods here delegate to a default BoundaryIOManager3D instance. The default configuration should be sufficient for most purposes. If customization is required, consider directly creating and configuring and a BoundaryIOManager3D instance.

Examples

The example below reads an OBJ file as a stream of triangles, transforms each triangle, and writes the result as a CSV file. The data formats are inferred from the input and output file extensions.

 GeometryInput input = new FileGeometryInput(Paths.get("orig.obj"));
 GeometryOutput scaledOutput = new FileGeometryOutput(Paths.get("scaled.csv"));
 AffineTransformMatrix3D transform = AffineTransformMatrix3D.createScale(2);

 // Use the input triangle stream in a try-with-resources statement to ensure
 // all resources are properly released.
 try (Stream<Triangle3D> stream = IO3D.triangles(input, null, precision)) {
      IO3D.write(stream.map(t -> t.transform(transform)), scaledOutput, null);
 }
 
See Also: