<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[dockerized OpenJSCAD]]></title><description><![CDATA[<p dir="auto">To answer <a href="https://stackoverflow.com/q/54959351/1497139" rel="nofollow ugc">https://stackoverflow.com/q/54959351/1497139</a> I tried dockerizing OpenJSCAD.</p>
<p dir="auto">The idea was to show how comparable to <a href="https://www.openjscad.org/examples/" rel="nofollow ugc">https://www.openjscad.org/examples/</a> you could setup your own "workspace"  and make it available via a Docker Volume. That way the include commands should work much easier than with the drag &amp; drop solution that mostly seems not to work with  recent browser versions of Chrome &amp; Firefox i tested.</p>
<p dir="auto">I started <a href="https://github.com/BITPlan/docker-openjscad" rel="nofollow ugc">https://github.com/BITPlan/docker-openjscad</a> inspired by<br />
<a href="https://github.com/LarsModig/openjscad-docker" rel="nofollow ugc">https://github.com/LarsModig/openjscad-docker</a></p>
<p dir="auto">I get OpenJSCAD to succesfully run locally on port 8080 on my computer this way but if I try:<br />
<a href="http://localhost:8080/examples" rel="nofollow ugc">http://localhost:8080/examples</a> i get:</p>
<p dir="auto">404 not found: /examples/</p>
<p dir="auto"><a href="http://localhost:8080/index.html#examples/globe.jscad" rel="nofollow ugc">http://localhost:8080/index.html#examples/globe.jscad</a><br />
works.</p>
<p dir="auto">Now I am going to try to make some kind of "workspace" available. Unfortunately something like<br />
<a href="http://localhost:8080/index.html#workspace/Box.jscad" rel="nofollow ugc">http://localhost:8080/index.html#workspace/Box.jscad</a></p>
<p dir="auto">does for some reason not work although<br />
<a href="http://localhost:8080/workspace/Box.jscad" rel="nofollow ugc">http://localhost:8080/workspace/Box.jscad</a></p>
<p dir="auto">does supply the required file.</p>
<p dir="auto">See <a href="https://stackoverflow.com/a/55198689/1497139" rel="nofollow ugc">https://stackoverflow.com/a/55198689/1497139</a> for the state of affairs.<br />
<strong>What am i missing here?</strong></p>
]]></description><link>https://openjscad.nodebb.com/topic/6/dockerized-openjscad</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 03:52:10 GMT</lastBuildDate><atom:link href="https://openjscad.nodebb.com/topic/6.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Mar 2019 13:57:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dockerized OpenJSCAD on Sat, 16 Mar 2019 17:33:40 GMT]]></title><description><![CDATA[<p dir="auto">There was only a very small difference ...</p>
<pre><code>diff main.jscad /Users/wf/source/scad/testinclude/main.jscad 6c6
&lt;   return myLib().b(2);
---
&gt;   return myLib.b(2);
</code></pre>
<p dir="auto">I 'v fixed the dockerized github repo and will try to fix the wiki now, too.<br />
Thanks for all the help finally I am going to work on my own designs now ...</p>
]]></description><link>https://openjscad.nodebb.com/post/21</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/21</guid><dc:creator><![CDATA[WolfgangFahl]]></dc:creator><pubDate>Sat, 16 Mar 2019 17:33:40 GMT</pubDate></item><item><title><![CDATA[Reply to dockerized OpenJSCAD on Sat, 16 Mar 2019 16:55:35 GMT]]></title><description><![CDATA[<p dir="auto">My example is here :<br />
<a href="https://github.com/gilboonet/designs/tree/master/testInclude" rel="nofollow ugc">https://github.com/gilboonet/designs/tree/master/testInclude</a><br />
You can test it by drag&amp;drop the directory to <a href="http://openjscad.org" rel="nofollow ugc">openjscad.org</a><img src="/assets/uploads/files/1552755329141-capture-d-%C3%A9cran-de-2019-03-16-17-55-14-resized.png" alt="0_1552755327117_Capture d’écran de 2019-03-16 17-55-14.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://openjscad.nodebb.com/post/19</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/19</guid><dc:creator><![CDATA[gilboonet]]></dc:creator><pubDate>Sat, 16 Mar 2019 16:55:35 GMT</pubDate></item><item><title><![CDATA[Reply to dockerized OpenJSCAD on Sat, 16 Mar 2019 16:43:41 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the swift reply. I think we are getting closer.<br />
I gave up with the "sister-directory" approach and put the workspace below the examples directory.</p>
<p dir="auto">This way</p>
<p dir="auto">docker run --publish=8080:8080 --name openjscad  -v /Users/wf/source/docker/docker-openjscad/workspace:/openjscad/packages/web/examples/workspace bitplan/openjscad:latest</p>
<p dir="auto">works and mounts my  workspace directory to the docker container. I have added a sample workspace now to <a href="https://github.com/BITPlan/docker-openjscad/tree/master/workspace" rel="nofollow ugc">https://github.com/BITPlan/docker-openjscad/tree/master/workspace</a></p>
<p dir="auto"><a href="http://localhost:8080/index.html#examples/workspace/Cube.jscad" rel="nofollow ugc">http://localhost:8080/index.html#examples/workspace/Cube.jscad</a><br />
now leads to the error:</p>
<p dir="auto">ReferenceError: Box is not defined</p>
<p dir="auto">which is a pity since it would be exactly my expectation for an include command to really include another source as if it would be part of the source that I am editing.</p>
<p dir="auto">For the "official" example from the wiki i have fixed the include statement (both in the wiki as well as in the dockerization github workspace).</p>
<p dir="auto">I also tried to follow your hint of adding a myLib() call. The result is:</p>
<p dir="auto">TypeError: myLib(...) is undefined</p>
<p dir="auto">So I think we only need one of your working examples and we'd be all set to improve the documentation and file a few issues / change requests.</p>
<p dir="auto">The general principle works with the docker approach and probably also if you include OpenJSCAD in a local browser installation.</p>
]]></description><link>https://openjscad.nodebb.com/post/18</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/18</guid><dc:creator><![CDATA[WolfgangFahl]]></dc:creator><pubDate>Sat, 16 Mar 2019 16:43:41 GMT</pubDate></item><item><title><![CDATA[Reply to dockerized OpenJSCAD on Sat, 16 Mar 2019 16:11:35 GMT]]></title><description><![CDATA[<p dir="auto">Sorry, I was not clear enough,</p>
<ul>
<li>The first point is only that the file name into the include must be the same as the file name containing the library (in the wiki example, there was vol-au-vent.jscad into and lib.jscad.</li>
<li>I have no idea how this mechanism work (I'm only a jscad user not a core developer) but I only know that without this call the content of the lib (the higher level function function of the file) is not available.</li>
<li>The syntax seems to be important (it's called anonymous function, it's not executed immediately but when called upon later) to make code a library.</li>
</ul>
<p dir="auto">I'm using this mechanism for a long time now and it works.</p>
]]></description><link>https://openjscad.nodebb.com/post/17</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/17</guid><dc:creator><![CDATA[gilboonet]]></dc:creator><pubDate>Sat, 16 Mar 2019 16:11:35 GMT</pubDate></item><item><title><![CDATA[Reply to dockerized OpenJSCAD on Sat, 16 Mar 2019 15:55:03 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for trying to explain this. I do not understand this.</p>
<p dir="auto">"The include file name must be the same as the lib name"</p>
<p dir="auto"><strong>What is a lib name and how is it specified?</strong></p>
<p dir="auto">"the call to b function from myLib must not contain parenthesis"</p>
<p dir="auto">So it seems as if there are some assumptions on how includes have to behave to be "includeable" .<br />
In this case the include would not be an "include" that includes the text of another file but some other mechanism that needs explanation.</p>
<p dir="auto"><strong>How does this mechanism work?</strong></p>
<p dir="auto">"a call to the library must be done at the beginning of main (I call this instanciation but it might be something else)."</p>
<p dir="auto">Again there is some "library" assumption. A true include would include anything not just predefined libraries. So the naming "include" seems to be misleading again and needs more explanation.</p>
<p dir="auto"><strong>What is a library that can be included?</strong></p>
<p dir="auto">The main issue seems to be that when the include fails no proper error message appears. If something is included that exists but the mechanism fails it would be helpful if one could see what's going on.</p>
]]></description><link>https://openjscad.nodebb.com/post/16</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/16</guid><dc:creator><![CDATA[WolfgangFahl]]></dc:creator><pubDate>Sat, 16 Mar 2019 15:55:03 GMT</pubDate></item><item><title><![CDATA[Reply to dockerized OpenJSCAD on Sat, 16 Mar 2019 15:18:39 GMT]]></title><description><![CDATA[<p dir="auto">To make the exemple from the wiki work, there are a few changes to make to main.jscad</p>
<ul>
<li>the include file name must be the same as the lib name</li>
<li>the call to b function from myLib must not contain parenthesis</li>
<li>a call to the library must be done at the beginning of main (I call this instanciation but it might be something else).</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1552749498043-capture-d-%C3%A9cran-de-2019-03-16-16-12-41-resized.png" alt="0_1552749495610_Capture d’écran de 2019-03-16 16-12-41.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://openjscad.nodebb.com/post/15</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/15</guid><dc:creator><![CDATA[gilboonet]]></dc:creator><pubDate>Sat, 16 Mar 2019 15:18:39 GMT</pubDate></item></channel></rss>