I've encountered an issue with exporting models in Clara.io. According to their instructions, exporting a selection should create a file for JSONLoader and exporting the full scene should result in a file for ObjectLoader. However, none of the export functions seem to be working properly with JSONLoader ().
In my application, I only require the geometry from the model to build a Points object. Therefore, I am searching for methods to either convert a loaded object to Mesh or perform some sort of geometry subtraction directly from the object itself. The documentation and examples from both Three.js and Clara.io only show one action with a loaded object - scene.add(object)
.
import THREE from 'three/build/three.module';
import {Scene,PerspectiveCamera,Fog,WebGLRenderer,ObjectLoader,Geometry} from 'three/build/three.module';
....
var loader = new ObjectLoader();
loader.load( 'assets/models/rabbit.json', function ( object ) {
//I don't need to add object here but this is the only thing that works
//scene.add(object);
//I need to do something like this
geometry2 = new Geometry();
geometry2.vertices = object.geometry.vertices; // ???
particles = new Points( geometry2, new PointsMaterial( { color: 0xff0000, size:5 } ) );
scene.add(particles)
});