# Class _ObjExporter

java.lang.Object
org.jmol.export.___Exporter
org.jmol.export.__CartesianExporter
org.jmol.export._ObjExporter

public class _ObjExporter extends __CartesianExporter
Class to export Wavefront OBJ files. The format is described at
http://en.wikipedia.org/wiki/Wavefront_.obj_file
and
http://www.martinreddy.net/gfx/3d/OBJ.spec
At least two files are produced: the object in the .obj file and the materials in the .mtl file. An additional image file is produced for each surface. All should be kept in the same directory.
The exporter has been tested for ball and stick models, but not for:

- outputFace (not used)
- outputCone
- outputTextPixel
- outputTriangle
- outputSurface (only some possibilities tested)

Adapted for JavaScript by Bob Hanson 2/2014 using javajs.util.OC OutputChannel instead of File. This is way more flexible.

Author:
  ken@kenevans.net

## Field Summary

### Fields inherited from class __CartesianExporter

`canCapCylinders, noColor, sphereMatrix, viewpoint`

### Fields inherited from class ___Exporter

`apertureAngle, backgroundColix, cameraDistance, cameraPosition, center, commandLineOptions, commentChar, degreesPerRadian, depthZ, export3D, exportScale, fileName, fixedRotationCenter, gdata, lightSource, lineWidthMad, out, privateKey, referenceCenter, scalePixelsPerAngstrom, screenHeight, screenWidth, slabZ, solidOnly, tempP1, tempP2, tempP3, tempV1, tempV2, tm, vwr`

## Constructor Summary

Constructors
Constructor
Description
`_ObjExporter()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`debugPrint(String string)`
Debug print utility.
`protected void`
`drawSurface(MeshSurface meshSurface, short colix)`
`protected String`
`finalizeOutput()`
`protected void`
`output(T3 pt)`
`protected void`
`outputCircle(P3 pt1, P3 pt2, float radius, short colix, boolean doFill)`
`protected void`
`outputCone(P3 ptBase, P3 ptTip, float radius, short colix)`
`protected boolean`
`outputCylinder(P3 ptCenter, P3 pt1, P3 pt2, short colix, byte endcaps, float radius, P3 ptX, P3 ptY, boolean checkRadius)`
`protected void`
`outputEllipsoid(P3 center, P3[] points, short colix)`
`protected void`
`outputFace(int[] face, int[] map, int faceVertexMax)`
`protected void`
`outputHeader()`
`protected void`
`outputSphere(P3 center, float radius, short colix, boolean checkRadius)`
`protected void`
`outputTextPixel(P3 pt, int argb)`
`protected void`
`outputTriangle(T3 pt1, T3 pt2, T3 pt3, short colix)`

### Methods inherited from class __CartesianExporter

`fillTriangle, getCameraPosition, getCoordinateMap, getModelCenter, getNormalMap, outputIndices, outputSolidPlate, setSphereMatrix`

### Methods inherited from class ___Exporter

`finalizeOutput2, fixScreenZ, getByteCount, getColorList, getConeMesh, getExportDate, getJmolPerspective, getRotationMatrix, getRotationMatrix, getTriad, getTriadC, initOutput, opacityFractionalFromArgb, opacityFractionalFromColix, output, outputComment, outputFooter, outputJmolPerspective, outputSurface, outputVertex, outputVertices, rgbFractionalFromArgb, rgbFractionalFromColix, round, round, setTempVertex, translucencyFractionalFromColix`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### _ObjExporter

public _ObjExporter()

## Method Details

### debugPrint

protected void debugPrint(String string)
Debug print utility. Only prints if debug is true.

Parameters:
  `string` -

### outputFace

protected void outputFace(int[] face, int[] map, int faceVertexMax)

Specified by:
  `outputFace` in class `__CartesianExporter`

### outputCircle

protected void outputCircle(P3 pt1, P3 pt2, float radius, short colix, boolean doFill)

Specified by:
  `outputCircle` in class `__CartesianExporter`

### outputCone

protected void outputCone(P3 ptBase, P3 ptTip, float radius, short colix)

Specified by:
  `outputCone` in class `__CartesianExporter`

### outputCylinder

protected boolean outputCylinder(P3 ptCenter, P3 pt1, P3 pt2, short colix, byte endcaps, float radius, P3 ptX, P3 ptY, boolean checkRadius)

Specified by:
  `outputCylinder` in class `__CartesianExporter`

### outputEllipsoid

protected void outputEllipsoid(P3 center, P3[] points, short colix)

Specified by:
  `outputEllipsoid` in class `__CartesianExporter`

### outputSphere

protected void outputSphere(P3 center, float radius, short colix, boolean checkRadius)

Specified by:
  `outputSphere` in class `__CartesianExporter`

### outputTextPixel

protected void outputTextPixel(P3 pt, int argb)

Specified by:
  `outputTextPixel` in class `__CartesianExporter`

### outputTriangle

protected void outputTriangle(T3 pt1, T3 pt2, T3 pt3, short colix)

Specified by:
  `outputTriangle` in class `__CartesianExporter`

### outputHeader

protected void outputHeader()

Specified by:
  `outputHeader` in class `___Exporter`

### output

protected void output(T3 pt)

Specified by:
  `output` in class `___Exporter`

### drawSurface

protected void drawSurface(MeshSurface meshSurface, short colix)

### finalizeOutput

protected String finalizeOutput()

Overrides:
  `finalizeOutput` in class `___Exporter`