<?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[Embedding a design in a website]]></title><description><![CDATA[<p dir="auto">I'd like to embed a 3D visualization of a jscad model in my website. It would be cool if people can drag the object around instead of just a screenshot. I was wondering if anyone has suggestions for the best approach?</p>
<p dir="auto">Approaches I've considered:</p>
<ul>
<li>Embed jscad directly in the website. The problem with this is that first of all I'm not sure if there is a straightforward way to do that with the library. Plus I don't need the entire editor experience, and I don't even really need to compile the jscad source on the fly, I just have a static model.</li>
<li>Export in some format and render using another library such as three.js directly. My question then is what format to use? I would like to preserve colors if possible, so STL is no good. DXF or OBJ maybe?</li>
</ul>
<p dir="auto">Curious what others have done.</p>
]]></description><link>https://openjscad.nodebb.com/topic/308/embedding-a-design-in-a-website</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Mar 2026 16:26:12 GMT</lastBuildDate><atom:link href="https://openjscad.nodebb.com/topic/308.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Oct 2021 22:39:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Embedding a design in a website on Tue, 24 Oct 2023 10:55:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/152">@hrgdavor</a> and <a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a>.  Thank you for your contributions and for sharing the repos.  The work completed here is certainly impressive.  I look forward to digging into the code to learn other creative and productive ways of using the JSCAD viewer.  The <a href="https://jscad.app" rel="nofollow ugc">https://jscad.app</a> has a fresh modern cad application feel. Especially with the addition of the orientation cube.</p>
]]></description><link>https://openjscad.nodebb.com/post/1372</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1372</guid><dc:creator><![CDATA[cdub]]></dc:creator><pubDate>Tue, 24 Oct 2023 10:55:04 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Mon, 23 Oct 2023 21:33:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/809">@cdub</a> I have been slowly working on providing bits and pieces to create different apps/websites with jscad embeded in different ways here<br />
<a href="https://github.com/hrgdavor/jscadui/" rel="nofollow ugc">https://github.com/hrgdavor/jscadui/</a> ... contributors are welcome</p>
<p dir="auto">one of demos is about making a new version of jscad web <a href="https://jscad.app" rel="nofollow ugc">https://jscad.app</a> that was actually made by <a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a></p>
<p dir="auto">Although my progress is slow there, that is also one place where you could find useful stuff.</p>
]]></description><link>https://openjscad.nodebb.com/post/1371</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1371</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Mon, 23 Oct 2023 21:33:35 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Mon, 23 Oct 2023 19:51:51 GMT]]></title><description><![CDATA[<p dir="auto">Hi Folks.  There hasn't been much activity on this topic, but I was hoping to kick this around some more.   I'm very interested in the idea of embedding the JSCad viewer into a webpage.  More specifically with dynamic user parameter implementation like the current JSCad web implementation.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/1">@z3dev</a> wrote the Vue wrapper and was extremely helpful in dissecting this stuff.   Tutorial6 gets me most of the way,</p>
<p dir="auto">With the tutorial6 code, I was able to add a numeric spinner to change a radius value (z3dev implemented already).  This works o.k. and the new geometries are added to the view after 'compile'.</p>
<p dir="auto">My question is:  After the new geometries are added to the JScad viewer, how do I refresh the render to only show the newly added geometries?   I don't fully understand the rendering code to know how to approach this.  Any help is appreciated.</p>
]]></description><link>https://openjscad.nodebb.com/post/1370</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1370</guid><dc:creator><![CDATA[cdub]]></dc:creator><pubDate>Mon, 23 Oct 2023 19:51:51 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Thu, 14 Oct 2021 06:08:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a> Very cool!</p>
<p dir="auto">The combining of design and JSCAD components is a very clean solution. Kudos!</p>
<p dir="auto">I especially like the ability to embed the 'assembled' model directly into GitHub CI.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/251">@SimonClark</a> should be interested in the feedback as he is working on a community site for sharing designs / parts.</p>
]]></description><link>https://openjscad.nodebb.com/post/982</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/982</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Thu, 14 Oct 2021 06:08:17 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Tue, 12 Oct 2021 11:10:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a> that is great <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /> for situations where only one model is shown webpack must be doing some tree shaking, because when I tested jscad/modeling package is 150k minimized.</p>
<p dir="auto">Your case is really extreme size optimization, great job.</p>
<p dir="auto">A demo project on git that does this for some simple model would be cool <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /></p>
<p dir="auto">another use case is a minimal build to run a model, but one that is reusable, it would be bit bigger as it would include whole 150k modeling package, but would be reusable for multiple scripts/models.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/1">@z3dev</a> maybe we could create an md or wiki page to list interesting projects done using jscad.</p>
]]></description><link>https://openjscad.nodebb.com/post/976</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/976</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Tue, 12 Oct 2021 11:10:03 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Tue, 12 Oct 2021 06:15:01 GMT]]></title><description><![CDATA[<p dir="auto">Final update, I have a solution I am happy with.</p>
<p dir="auto">I use <code>browserify</code> plus a small <a href="https://github.com/platypii/ParaDrone/blob/480c5677809e86faf422783921f55a2a380f9fef/website/render.js" rel="nofollow ugc">script</a> to combine my designs + jscad modeling + regl-renderer into a single <code>bundle.js</code>. Then all I just include that script via standard <code>&lt;script&gt;</code> tag on my page.</p>
<p dir="auto">Final size of bundle.js: 99.9kb gzipped</p>
<p dir="auto">Less than 100kb for a fully draggable, zoomable 3d design, directly from CAD files! That's smaller than a screenshot would be.</p>
<p dir="auto">Design is live <a href="https://paradr.one/" rel="nofollow ugc">here</a> if you're curious (but the rest of the project is still work-in-progress).</p>
<hr />
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/1">@z3dev</a> not sure where it should go in docs. But there's a couple cool things I've done with JSCAD that would be hard to do with any other CAD software.</p>
<ul>
<li>From the same source files, I can generate both the colorized "assembled" model above, and a "print version" that has the parts arranged for 3D printing.</li>
<li>Integrated into github CI/CD so that I know immediately if I broke my designs. Could easily write tests for things like bounding box size.</li>
<li>Use eslint to enforce style rules. Browserify to bundle with any other javascript.</li>
<li>Able to put the design in a website super efficiently. Directly from the source CAD files, without rendering to a huge mesh file format.</li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1634018950050-parts.png" alt="parts.png" class=" img-responsive img-markdown" /></p>
]]></description><link>https://openjscad.nodebb.com/post/970</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/970</guid><dc:creator><![CDATA[platypii]]></dc:creator><pubDate>Tue, 12 Oct 2021 06:15:01 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Tue, 12 Oct 2021 04:10:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a> said in <a href="/post/954">Embedding a design in a website</a>:</p>
<blockquote>
<p dir="auto">This is exactly what I was looking for! Talk about an under-hyped feature</p>
</blockquote>
<p dir="auto">Cool! Nice to know that your going full speed again.</p>
<p dir="auto">So, there are many ways to put together applications now. Any good suggestions on where to put this information?</p>
]]></description><link>https://openjscad.nodebb.com/post/967</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/967</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Tue, 12 Oct 2021 04:10:36 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Mon, 11 Oct 2021 07:20:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/714">@OrganicPanda</a> thanks <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /> ... I will post it on the forum,</p>
<p dir="auto">I am preparing a branch on jscad to experiment, and will open a discussion page for it. That branch will contain whatever code, so it will not be added to jscad directly, but serve as starting point for proper implementation after I am satisfied with the prototype.</p>
<p dir="auto">One cool thing that was easy to make in threejs was 3d view: anaglyph(red,blue) and stereo side-by.side .. so it will also be part of the exepriments.</p>
<p dir="auto"><a href="http://3d.hrg.hr/jscad/three/threejscad2.html?stereo=Anaglyph&amp;uri=model.logos.js" rel="nofollow ugc">http://3d.hrg.hr/jscad/three/threejscad2.html?stereo=Anaglyph&amp;uri=model.logos.js</a><br />
<a href="http://3d.hrg.hr/jscad/three/threejscad2.html?stereo=SideBySide&amp;uri=model.logos.js" rel="nofollow ugc">http://3d.hrg.hr/jscad/three/threejscad2.html?stereo=SideBySide&amp;uri=model.logos.js</a><br />
<a href="http://3d.hrg.hr/jscad/three/threejscad2.html?stereo=ParallaxBarrier&amp;uri=model.logos.js" rel="nofollow ugc">http://3d.hrg.hr/jscad/three/threejscad2.html?stereo=ParallaxBarrier&amp;uri=model.logos.js</a></p>
<p dir="auto">This idea was pushed by one of users that likes to do VR stuff. I also trid to enable VR, but that experiment was not as easy, somethig got messed-up</p>
]]></description><link>https://openjscad.nodebb.com/post/964</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/964</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Mon, 11 Oct 2021 07:20:16 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sun, 10 Oct 2021 20:52:27 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/152">@hrgdavor</a>! Well I'm loving your work anyway - where is good to follow you for updates on those efforts?</p>
]]></description><link>https://openjscad.nodebb.com/post/963</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/963</guid><dc:creator><![CDATA[OrganicPanda]]></dc:creator><pubDate>Sun, 10 Oct 2021 20:52:27 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sun, 10 Oct 2021 19:41:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a> yes, jscad has moved from custom syntax to <code>require</code> from V1 to V2, but in menatime ES6 <code>import</code> is becomming more and more popular,  and is looking to take over <code>require</code> in the long run <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--disappointed" title=":(" alt="😞" /> .</p>
<p dir="auto">I am putting <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--disappointed" title=":(" alt="😞" /> not because I dont like import/export, as it has plenty of advantages(easy tree shaking...). I am <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61e.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--disappointed" title=":(" alt="😞" /> because it is also another layer of confusion for new users ... especially those unfamiliar with javascript and if it takes over require completely, then jscad will need refactoring in the future.</p>
]]></description><link>https://openjscad.nodebb.com/post/962</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/962</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Sun, 10 Oct 2021 19:41:49 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sun, 10 Oct 2021 18:19:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/152">@hrgdavor</a> all my code will be open source. Technically it already is, but I haven't completed PRs yet. <a href="https://github.com/platypii/ParaDrone/blob/regl-jscad/html/index.html#L59-L61" rel="nofollow ugc">[1]</a> <a href="https://github.com/platypii/ParaDrone/blob/regl-jscad/html/js/render.js" rel="nofollow ugc">[2]</a></p>
<p dir="auto">Really I just took the regl-renderer demo.html that <a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/1">@z3dev</a> linked to and used it for my models. The only things I changed:</p>
<ul>
<li>Include from <a href="http://unpkg.com" rel="nofollow ugc">unpkg.com</a></li>
<li>Remove the axes and grid</li>
<li>Added auto-rotate code so that it would spin</li>
<li>Some code style cleanup, mostly object value shorthand <code>{camera, controls}</code></li>
<li>Fought with CommonJS vs ES6 module differences.</li>
</ul>
<p dir="auto">The CommonJS vs ES6 module issue is preventing me from using the <em>exact</em> same jscad code for development and rendering. Right now I'm converting jscad CommonJS into ES6 for use in the browser. I might need to use babel or requirejs or something.</p>
<p dir="auto">This is how I'm looking to show off the designs in my site:<br />
<img src="/assets/uploads/files/1633889603602-screenshot-at-2021-10-10-11-08-15.png" alt="Screenshot at 2021-10-10 11-08-15.png" class=" img-responsive img-markdown" /></p>
]]></description><link>https://openjscad.nodebb.com/post/961</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/961</guid><dc:creator><![CDATA[platypii]]></dc:creator><pubDate>Sun, 10 Oct 2021 18:19:21 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sun, 10 Oct 2021 11:16:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a> that is excellent news. If you could share the code in some way, so other jscad users could make use of it <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /></p>
<p dir="auto">regl has an advantage over threejs as it has less features, so can easily be more compact.</p>
<p dir="auto">I was also able to reduce threejs to 420k (minimized, not gzipped) for the needs of rendering jscad models.</p>
<p dir="auto">Some may need full set of features form threejs and maybe already have included full threejs in their website, but others will also likely want a small optimized version of any of those libs (regl, threejs), so sharing both types of examples will benefit the community. We will just need to see where to put links to them.</p>
]]></description><link>https://openjscad.nodebb.com/post/960</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/960</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Sun, 10 Oct 2021 11:16:59 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sat, 09 Oct 2021 23:19:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/1">@z3dev</a> said:</p>
<blockquote>
<p dir="auto">Also, please take a look at the minimal viewer, which is really compact.<br />
<a href="https://github.com/jscad/OpenJSCAD.org/blob/master/packages/utils/regl-renderer/demo.html" rel="nofollow ugc">https://github.com/jscad/OpenJSCAD.org/blob/master/packages/utils/regl-renderer/demo.html</a></p>
</blockquote>
<p dir="auto">This is exactly what I was looking for! Talk about an under-hyped feature <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":-)" alt="🙂" /></p>
<p dir="auto">I'm now able to render my design in the browser, live, in less than 300kb total, using the regl-renderer! Even less bytes when gzipped.</p>
<p dir="auto">And what's cool is these are my <em>actual</em> CAD files used in production, rendered in the browser super efficiently.</p>
<p dir="auto">THANK YOU!</p>
]]></description><link>https://openjscad.nodebb.com/post/954</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/954</guid><dc:creator><![CDATA[platypii]]></dc:creator><pubDate>Sat, 09 Oct 2021 23:19:11 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sat, 09 Oct 2021 13:48:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/714">@OrganicPanda</a> that is neat example of jscad integrated into react-fiber. <a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/1">@z3dev</a> it would be cool to mention that one too as example of integration.</p>
<p dir="auto"><a href="https://codesandbox.io/s/react-three-fiber-threejscad-m2w4c?file=/src/App.js" rel="nofollow ugc">https://codesandbox.io/s/react-three-fiber-threejscad-m2w4c?file=/src/App.js</a></p>
]]></description><link>https://openjscad.nodebb.com/post/952</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/952</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Sat, 09 Oct 2021 13:48:21 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sat, 09 Oct 2021 10:16:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/714">@OrganicPanda</a> those scripts are a bloody mess. Next iteration is to make them little better and to separate out the code that is bridge between jscad and threejs so it can be independently used to render jscad in any webgl lib (regl, threejs, babylon, etc...)</p>
<p dir="auto">And those will be part of jscad, so yes on npm <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /></p>
<p dir="auto">I am looking forward to cooperating with you to make demos that do stuff with less megabytes <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /> ... so don't give up, stay tuned, and lets make some fun stuff,</p>
]]></description><link>https://openjscad.nodebb.com/post/951</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/951</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Sat, 09 Oct 2021 10:16:34 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sat, 09 Oct 2021 01:40:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a> if interested there's an outstanding issue to <a href="https://github.com/jscad/OpenJSCAD.org/issues/515" rel="nofollow ugc">add a new OBJ serializer</a>, which would be pretty easy. <img src="https://openjscad.nodebb.com/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=k4h1pp0pk3c" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /></p>
<p dir="auto">Also, please take a look at the minimal viewer, which is really compact.</p>
<p dir="auto"><a href="https://github.com/jscad/OpenJSCAD.org/blob/master/packages/utils/regl-renderer/demo.html" rel="nofollow ugc">https://github.com/jscad/OpenJSCAD.org/blob/master/packages/utils/regl-renderer/demo.html</a></p>
]]></description><link>https://openjscad.nodebb.com/post/946</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/946</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Sat, 09 Oct 2021 01:40:52 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Sat, 09 Oct 2021 01:08:24 GMT]]></title><description><![CDATA[<p dir="auto">The thing that I don't like about my approach so far:</p>
<p dir="auto">Size of my jscad code: 12.4kb<br />
Size of rendered obj file: 1.8mb<br />
Size of three.module.js: 1.2mb<br />
Size of jscad-web.min.js: 1.2mb</p>
<p dir="auto">So now I'm thinking about how to render a relatively simple object without increasing the page size by megabytes. That being said, jscad viewer looking more attractive by the above math...</p>
]]></description><link>https://openjscad.nodebb.com/post/945</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/945</guid><dc:creator><![CDATA[platypii]]></dc:creator><pubDate>Sat, 09 Oct 2021 01:08:24 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Fri, 08 Oct 2021 22:10:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/152">@hrgdavor</a> Those scripts are amazing - thank you for that! Would you consider publishing them to npm for consumption? I put together a codesandbox showing a model from the jscad docs rendering in threejs via react-three-fiber <a href="https://codesandbox.io/s/react-three-fiber-threejscad-m2w4c?file=/src/App.js" rel="nofollow ugc">https://codesandbox.io/s/react-three-fiber-threejscad-m2w4c?file=/src/App.js</a></p>
]]></description><link>https://openjscad.nodebb.com/post/944</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/944</guid><dc:creator><![CDATA[OrganicPanda]]></dc:creator><pubDate>Fri, 08 Oct 2021 22:10:13 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Fri, 08 Oct 2021 04:48:36 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the ideas! I'm leaning more toward using three.js to render the file.</p>
<p dir="auto">Currently the best path I've found after some experimentation:</p>
<ol>
<li>Use jscad to export as .x3d</li>
<li>Convert that to .obj using external program (meshlab)</li>
<li>Render obj with three.js directly using OBJLoader</li>
</ol>
<p dir="auto">Color is preserved. Not terrible workflow. Ideal would be a OBJ or GLTF serializer in jscad so I could directly export to a format supported by three.js. I may look into how complicated that would be to write...</p>
]]></description><link>https://openjscad.nodebb.com/post/942</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/942</guid><dc:creator><![CDATA[platypii]]></dc:creator><pubDate>Fri, 08 Oct 2021 04:48:36 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Thu, 07 Oct 2021 02:40:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a> You can also try one of the components that other users have built, based on common reactive frameworks.</p>
<p dir="auto">VUE framework : <a href="https://github.com/z3dev/vue-components" rel="nofollow ugc">https://github.com/z3dev/vue-components</a><br />
REACT framework : <a href="https://github.com/kenianbei/jscad-react" rel="nofollow ugc">https://github.com/kenianbei/jscad-react</a></p>
]]></description><link>https://openjscad.nodebb.com/post/941</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/941</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Thu, 07 Oct 2021 02:40:34 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Wed, 06 Oct 2021 11:16:33 GMT]]></title><description><![CDATA[<p dir="auto">Unfortunately, things that would make this possible  easily are still in develompment.</p>
<h2>option1 (future)</h2>
<p dir="auto">3mf serializer is on the way and with it you would be able to export colors I think and then use threjs 3mf import</p>
<h2>Option 2 (you can do right now)</h2>
<p dir="auto">you can use my nasty coded(below linked) jscad prototype to load jscad script(only single file scripts currently) and do 3mf export there(it does have a bug with instances right now, but I could get to fixing it if you rly need this).</p>
<h2>Option 3 (you can do right now)</h2>
<p dir="auto">If you are eager to do it and not have time to wait these things in jscad core, here is a link to my nasty code that runs jscad using threejs instead of regl<br />
<a href="http://3d.hrg.hr/jscad/three/threejscad2.html" rel="nofollow ugc">http://3d.hrg.hr/jscad/three/threejscad2.html</a>?</p>
<p dir="auto">You need to export json (it is just JSON.stringify of the geometries)</p>
<p dir="auto">Make a page with threejs, load json, and then convert those to BufferGeometry</p>
<p dir="auto">code I have to convert from jscad to threejs is in these 2 scripts:</p>
<p dir="auto"><a href="http://3d.hrg.hr/jscad/three/CSGToBuffers.js" rel="nofollow ugc">http://3d.hrg.hr/jscad/three/CSGToBuffers.js</a><br />
<a href="http://3d.hrg.hr/jscad/three/CSG2Object3D.js" rel="nofollow ugc">http://3d.hrg.hr/jscad/three/CSG2Object3D.js</a></p>
<p dir="auto">I have cleaning to do to bring this to jscad, along with some other changes needed in jscad inernally.</p>
<p dir="auto">If you want to use this right now, and you have questions about the scripts I can also be reached on discord.</p>
]]></description><link>https://openjscad.nodebb.com/post/940</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/940</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Wed, 06 Oct 2021 11:16:33 GMT</pubDate></item><item><title><![CDATA[Reply to Embedding a design in a website on Tue, 05 Oct 2021 01:48:42 GMT]]></title><description><![CDATA[<p dir="auto">If the visualization doesn't need the input of parameters then a static design can be loaded, i.e. json. You can try this by exporting to JSON, and then drag and drop the JSON file to the WEB UI.</p>
<p dir="auto">The benefit is there's no compilation of code, no conversion of format, just loading of the geometries (objects) from the JSON file.</p>
]]></description><link>https://openjscad.nodebb.com/post/939</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/939</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Tue, 05 Oct 2021 01:48:42 GMT</pubDate></item></channel></rss>