ghemingway / cad.js

Web-based CAD file viewer
http://ghemingway.github.io/cad.js
Apache License 2.0
667 stars 175 forks source link

Incomplete Model Rendering #12

Closed JamesWilmot closed 9 years ago

JamesWilmot commented 9 years ago

Installed per instructions and grabbed example model per these instructions: https://github.com/ghemingway/cad.js/tree/master/docs

However running express server and visiting URL (http://localhost:8080/cad.js?resource_url=/data/rear/index.xml) results in the following:

incomplete_model_rendering

Any thoughts why this might be the output?

This is a very cool project and I'm very keen to use it in a few projects.

JamesWilmot commented 9 years ago

Output of express server serving out model:

Express server listening on port 8080
Express server listening on port 8080
Express server listening on port 8080
Express server listening on port 8080
GET /cad.js?resource_url=/data/rear/index.xml 304 4ms
GET /stylesheets/jquery-ui.min.css 304 1ms
GET /stylesheets/default.css 304 17ms
GET /stylesheets/visualize.css 304 5ms
GET /stylesheets/cadjs.css 304 6ms
GET /javascript/libs/require.min.js 304 6ms
GET /stylesheets/jstree/themes/vulcan/style.css 304 12ms
GET /stylesheets/compass.css 304 11ms
GET /javascript/main.js 304 9ms
GET /javascript/cad.js 304 1ms
GET /javascript/data_loader.js 304 1ms
GET /javascript/libs/n-progress-ring.js 304 1ms
GET /javascript/libs/jquery.min.js 304 1ms
GET /javascript/libs/three.min.js 304 1ms
GET /javascript/libs/bigscreen.min.js 304 3ms
GET /javascript/assembly.js 304 4ms
GET /javascript/product.js 304 0ms
GET /javascript/shape.js 304 1ms
GET /javascript/annotation.js 304 1ms
GET /javascript/shell.js 304 0ms
GET /javascript/libs/underscore-min.js 304 3ms
GET /javascript/libs/jquery-ui.min.js 304 1ms
GET /javascript/shaders/VelvetyShader.js 304 1ms
GET /javascript/libs/threejs/EffectComposer.js 304 1ms
GET /javascript/libs/threejs/CopyShader.js 304 0ms
GET /javascript/libs/threejs/SSAOShader.js 304 1ms
GET /javascript/libs/threejs/FXAAShader.js 304 2ms
GET /javascript/libs/threejs/RenderPass.js 304 1ms
GET /javascript/libs/threejs/MaskPass.js 304 1ms
GET /javascript/text.js 304 0ms
GET /javascript/libs/jstree.min.js 304 1ms
GET /javascript/libs/visualize.js 304 4ms
GET /javascript/libs/threejs/ShaderPass.js 304 1ms
GET /javascript/shaders/VelvetyShader-vertex.glsl 304 0ms
GET /javascript/shaders/VelvetyShader-fragment.glsl 304 0ms
GET /javascript/viewer.js 304 0ms
GET /javascript/viewer_controls.js 304 0ms
GET /javascript/compass.js 304 1ms
GET /javascript/templates/compass_dom.html 304 0ms
GET /javascript/libs/TrackballControls.js 304 1ms
GET /javascript/webworker.js 304 0ms
GET /javascript/webworker.js 304 1ms
GET /javascript/webworker.js 304 1ms
GET /javascript/webworker.js 304 0ms
GET /data/rear/index.xml 304 1ms
GET /data/rear/shell_id811140.xml 304 0ms
GET /data/rear/shell_id826620.xml 304 1ms
GET /data/rear/shell_id123030.xml 304 3ms
GET /data/rear/shell_id808530.xml 304 2ms
GET /data/rear/shell_id813510.xml 304 2ms
GET /data/rear/shell_id792650.xml 304 0ms
GET /data/rear/shell_id740490.xml 304 0ms
GET /data/rear/shell_id744430.xml 304 1ms
GET /data/rear/shell_id742160.xml 304 1ms
GET /data/rear/shell_id715200.xml 304 1ms
GET /data/rear/shell_id721850.xml 304 1ms
GET /data/rear/shell_id725190.xml 304 0ms
GET /data/rear/shell_id726660.xml 304 0ms
GET /data/rear/shell_id734610.xml 304 0ms
GET /data/rear/shell_id737040.xml 304 0ms
GET /data/rear/shell_id687520.xml 304 1ms
GET /data/rear/shell_id689950.xml 304 1ms
GET /data/rear/shell_id670560.xml 304 1ms
GET /data/rear/shell_id681630.xml 304 4ms
GET /data/rear/shell_id376750.xml 304 1ms
GET /data/rear/shell_id397040.xml 304 1ms
GET /data/rear/shell_id37840.xml 304 1ms
GET /data/rear/shell_id151080.xml 304 1ms
GET /data/rear/shell_id439490.xml 304 1ms
GET /data/rear/shell_id442420.xml 304 0ms
GET /data/rear/shell_id444090.xml 304 1ms
GET /data/rear/shell_id446960.xml 304 0ms
GET /data/rear/shell_id654830.xml 304 1ms
GET /data/rear/shell_id619510.xml 304 0ms
GET /data/rear/shell_id589350.xml 304 1ms
GET /data/rear/shell_id595290.xml 304 0ms
GET /data/rear/shell_id578390.xml 304 1ms
GET /data/rear/shell_id907270.xml 304 0ms
GET /data/rear/shell_id909190.xml 304 0ms
GET /data/rear/shell_id848960.xml 304 1ms
GET /data/rear/shell_id858600.xml 304 1ms
GET /data/rear/shell_id866130.xml 304 1ms
Error: ENOENT, stat './data/rear/shell_id545460.xml'
GET /data/rear/shell_id545460.xml 404 6ms
GET /data/rear/shell_id548530.xml 304 1ms
ghemingway commented 9 years ago

This particular model was converted from STEP using an earlier version of the STEPTools converter. As a result it needs both faces of every triangle to be rendered. Easy to fix.

Uncomment line 17 in public/javascript/shaders/VelvetyShader.js. If I remember correctly, this should get you working. I think. Maybe.

JamesWilmot commented 9 years ago

Uncomment line 17 in public/javascript/shaders/VelvetyShader.js. If I remember correctly, this should get you working. I think. Maybe.

This worked perfectly! Thanks heaps for quick response!