Converts a mesh file in the OBJ format into the JSON format
Usage
objToJSON(obj, file = NULL)
Value
A JSON object, if file is NULL
Arguments
obj
A filepath to a file of type '.obj' or an 'obj' object, the value returned by the function readOBJ.
file
A filepath to a file of type '.json' where the converted obj object will be saved. If is NULL (default) then no file is written and the JSON object is returned.
Author
Aaron Olsen
Details
This function convert a Wavefront .obj file or OBJ object into a JSON (JavaScript Object Notation) object and optionally saves this JSON object as a .json file. This function was written in order directly convert CT scan meshes exported from Horos into the JSON format for web visualization, eliminating intermediate conversions in programs such as meshlab and Blender. See readOBJ for more details and limitations in .obj file reading.
if (FALSE) {
# Convert OBJ to JSON fileobjToJSON(obj='obj_file.obj', file='json_file.json')
# Convert OBJ to JSON list objectjson_list <- objToJSON(obj='obj_file.obj')
}