jscad / OpenJSCAD.org

JSCAD is an open source set of modular, browser and command line tools for creating parametric 2D and 3D designs with JavaScript code. It provides a quick, precise and reproducible method for generating 3D models, and is especially useful for 3D printing applications.
https://openjscad.xyz/
MIT License
2.66k stars 515 forks source link

Bug: initial_csg.canonicalized is not a function #193

Closed hobofan closed 7 years ago

hobofan commented 7 years ago

I am getting this error message when opening the default index.html with the object not rendering:

Uncaught TypeError: initial_csg.canonicalized is not a function

csgToMeshes @ openjscad.js?0.5.2:583
setCsg @ openjscad.js?0.5.2:309
updateView @ openjscad.js?0.5.2:1119
setCurrentObjects @ openjscad.js?0.5.2:1073
(anonymous function) @ openjscad.js?0.5.2:1315
w.onmessage @ jscad-worker.js?0.5.2:40

I narrowed the breaking change down to https://github.com/Spiritdude/OpenJSCAD.org/commit/df291a90ba601a4a3cf18bcea22eef4bf319f98b. The commit before that one works fine.

z3dev commented 7 years ago

@hobofan Interesting. The main improvement of Release 0.5.2 is the retention of the return objects, 1 or more.

What browser are you working with? And on which OS?

hobofan commented 7 years ago

@z3dev Chromium 53 on Ubuntu 16.04

z3dev commented 7 years ago

@hobofan Interesting indeed.

I develop and test on MacOS with Google Chrome (54 was the latest), but I would guess that Chromium is a slightly different animal.

Can you provide a stack trace from the Javascript console?

hobofan commented 7 years ago

Is there supposed to be a longer stack trace than the one in my initial comment? If you tell me how to get more than that, I'd be glad to.

z3dev commented 7 years ago

I was hoping so... but maybe not as each browser has different stack traces.

Anyway, I'm not sure why 'initial_csg' is not a proper CSG object. That shouldn't be possible given that previous routines are verifying the returned values from your JSCAD script.

Are any of the examples working?

z3dev commented 7 years ago

@hobofan I applied a fix to the MASTER branch of OpenJSCAD.org. Can you try this version?

(Don't use the DEV branch as this is a major work in progress at the moment)

hobofan commented 7 years ago

@z3dev Current master works! Thanks!