Display Code
-
Can anyone point me to the part of the code which is doing the conversion from CSG geometry to threejs geometry for display? I'd like to mess around with it, but I'm a little unsure where to look. Thanks!
-
@BarbourSmith is there some reason to use three.js? the primary focus of three.js is quite differnet from JSCAD.
It should be pretty trivial to convert between three.js data structures and JSCAD data structures. But don't expect either project to supply the conversions.
Maybe somone has a set of functions already, or you'll have to write some simple conversion functions.
-
@BarbourSmith If your jscad geometry is a polyhedron, you can use : https://threejs.org/docs/#api/en/geometries/PolyhedronGeometry
-
@z3dev Thank you!
I think I didn't really understand enough to ask the right question. Thanks for getting me closer. I think what I meant to ask is, "Is there an existing way to display threejs geometry in three.js?"
I looked in utils, this jscad github issue seems like the closet thing I could find.
Am I barking up the wrong tree? If I want to display jscad geometry in a browser is three.js the wrong approach?
-
This post is deleted! -
I'm assuming that you are interested in the V2 version. Here's a short summary.
The 'packages' directory contains the source code for each of the packages.
- cli contains the command line application
- core contains various things for converting, handling events, etc. (used by all apps)
- desktop contains the standalone application (still not V2)
- examples
- io contains the import/export of external formats
- modeling contains the CSG engine, etc.
- ui (un-used now)
- utils contains small components. one is the regl-renderer which does the 3D rendering
- vtree contains the experimental caching
- web contains the HTML based application