I would like to load multiple files with OpenJSCAD
.
I tried 1 without any success.
I'm using OpenJSCAD
with Firefox on Ubuntu 18.04. I tried both the offline and online versions.
I would like to load multiple files with OpenJSCAD
.
I tried 1 without any success.
I'm using OpenJSCAD
with Firefox on Ubuntu 18.04. I tried both the offline and online versions.
I have improved the section on include of the Userguide
You should be able to try it out with any of the three examples mentioned by putting the files of the examples in a folder and then drag and drop to OpenJSCAD
The result should be as in https://openjscad.org/#examples/platonics
Welcome in a world where complicated things are easy and easy things are complicated!
The include command of OpenJSCAD will search for include file relatively to the URL of the including file and there are limits to this when you try to drag&drop files via the browser and the behavior seems to be much browser dependent.
So it would be easier if your "workspace" with the file you'd like to use would reside within the webservice that the OpenJSCAD solution offers.
In the examples section of OpenJSCAD there seems to be one use of the "include" statement at this time see:
https://www.openjscad.org/examples/globe.jscad
You can try it out via https://www.openjscad.org/index.html#examples/globe.jscad
Please note that how on refresh you get an error message:
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /openjscad.jscadplatonics/maths_geodesic.jscad was not found on this server.</p>
<hr>
<address>Apache/2.4.25 (Debian) Server at www.openjscad.org Port 443</address>
</body></html>
To get the same effect locally you'd have to create a sister directory of "examples" in your local installation. This will not work if you call "index.html" with a file url
file:///usr/local/lib/node_modules/@jscad/openjscad/index.html#examples/globe.jscad
To show the principle of a "workspace" directory i have created a dockerized OpenJSCAD version which is available at:
It's also available via Docker Hub so you can simply try it out by running the command:
docker run --publish=8080:8080 --name openjscad bitplan/openjscad:latest
You should now have an OpenJSCAD running in a docker container on your computer which you can try out with e.g.
and specifically
to see the include usage.
Now we need to apply this principle to the workspace directory which is prepared in the docker container and ready to be mounted locally.
To get this working some rules need to be followed which are currently discussed at: https://openjscad.nodebb.com/topic/6/dockerized-openjscad
Mount your workspace directory
docker run \
--publish=8080:8080 \
--name openjscad \
--volume $HOME/openjscad/workspace:/openjscad/packages/web/examples/workspace \
bitplan/openjscad:latest
now the file from your workspace should be available via the corresponding url. To try things out you might want to copy the platonics folder from
https://github.com/jscad/OpenJSCAD.org/tree/master/packages/examples/platonics
to your workspace folder and try the access with:
http://localhost:8080/index.html#examples/workspace/platonics
now you should be all set to use
include()
as requested