<?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[Using JSCAD to build meshes for BabylonJS]]></title><description><![CDATA[<p dir="auto">Does anybody have experience with using JSCAD to build meshes for use in BabylonJS?</p>
<p dir="auto">I'm looking to build some dynamic models which are going beyond the capabilities of BabylonJS but I would like to use them within BabylonJS.</p>
<p dir="auto">I'm looking for any advice I can find. Thank you.</p>
<p dir="auto">For context, I started out in Babylon and ran into limitations with their path2d fuctions:</p>
<p dir="auto"><a href="https://forum.babylonjs.com/t/trying-to-build-an-extruded-path2-with-ribbon/27808/3" rel="nofollow ugc">https://forum.babylonjs.com/t/trying-to-build-an-extruded-path2-with-ribbon/27808/3</a></p>
<p dir="auto">I then tried it in JSCAD:</p>
<pre><code>/**
 * 2D Primitives Demonstration
 * @category Creating Shapes
 * @skillLevel 1
 * @description Demonstrating the basics of a variety of 2D primitives
 * @tags circle, square, line, ellipse, polygon, shape, 2d
 * @authors Simon Clark
 * @licence MIT License
 */

const { path2 } = require('@jscad/modeling').geometries
const { expand, offset } = require('@jscad/modeling').expansions
const { extrudeLinear, extrudeRectangular, extrudeRotate } = require('@jscad/modeling').extrusions
const { translate } = require('@jscad/modeling').transforms

const main = () =&gt; {
  let tdcPathCenter = path2.fromPoints({}, &lsqb;&lsqb;0,0&rsqb;&rsqb;);
  tdcPathCenter = path2.appendArc({endpoint: [-0.0596,-0.02], radius: [0.0988,0.0988]}, tdcPathCenter);
  tdcPathCenter = path2.appendPoints(&lsqb;&lsqb;-0.0922,-0.0447&rsqb;&rsqb;,tdcPathCenter);
  tdcPathCenter = path2.appendArc({endpoint: [-0.123,-0.055], radius: [0.051,0.051], clockwise: true}, tdcPathCenter);
  tdcPathCenter = path2.appendPoints(&lsqb;&lsqb;-0.2432,-0.055&rsqb;&rsqb;,tdcPathCenter);
  tdcPathCenter = path2.appendArc({endpoint: [-0.2942,-0.004], radius: [0.051,0.051], clockwise: true}, tdcPathCenter);
  tdcPathCenter = path2.appendPoints(&lsqb;&lsqb;-0.2942,1.1196&rsqb;&rsqb;,tdcPathCenter);
  tdcPathCenter = path2.appendArc({endpoint: [-0.2479,1.1704], radius: [0.051,0.051], clockwise: true}, tdcPathCenter);
  tdcPathCenter = path2.appendPoints(&lsqb;&lsqb;-0.1272,1.1803&rsqb;&rsqb;,tdcPathCenter);
  tdcPathCenter = path2.appendArc({endpoint: [-0.1002,1.1677], radius: [0.03,0.03], clockwise: true}, tdcPathCenter);
  tdcPathCenter = path2.appendArc({endpoint: [-0.0467,1.2829], radius: [0.0733,0.0733], clockwise: false, large: true}, tdcPathCenter);
  tdcPathCenter = path2.appendPoints(&lsqb;&lsqb;-0.2466,1.2664&rsqb;&rsqb;,tdcPathCenter);


  let tdcProfile = expand({delta:0.015}, tdcPathCenter);

  let tdcFlange = extrudeLinear({height: 10}, tdcProfile);

  return tdcFlange;
  }

module.exports = { main }

</code></pre>
<p dir="auto">I'm wondering how to then extract from this solid something that could be used in BabylonJS</p>
]]></description><link>https://openjscad.nodebb.com/topic/352/using-jscad-to-build-meshes-for-babylonjs</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 22:42:02 GMT</lastBuildDate><atom:link href="https://openjscad.nodebb.com/topic/352.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 22 Mar 2022 16:30:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Thu, 19 May 2022 22:24:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/746">@ajw1970</a> super!</p>
<p dir="auto">I'm interested in the final application. Why did you want to use Babylon for rendering? And do you further plans to create some online designs?</p>
]]></description><link>https://openjscad.nodebb.com/post/1185</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1185</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Thu, 19 May 2022 22:24:35 GMT</pubDate></item><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Thu, 19 May 2022 21:32:48 GMT]]></title><description><![CDATA[<p dir="auto">In the end, I imported @jscad and used Path2 and Expand to build my profile for extruding and then handed those points over to Babylon to do the extrusion to mesh. Works well.</p>
]]></description><link>https://openjscad.nodebb.com/post/1184</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1184</guid><dc:creator><![CDATA[ajw1970]]></dc:creator><pubDate>Thu, 19 May 2022 21:32:48 GMT</pubDate></item><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Thu, 24 Mar 2022 21:16:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/746">@ajw1970</a> if you just push the jscad geometries to console or generate json, you will see the data inside is pretty intutive to to go through and convert to points for babylon or whatever you need.</p>
]]></description><link>https://openjscad.nodebb.com/post/1147</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1147</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Thu, 24 Mar 2022 21:16:21 GMT</pubDate></item><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Thu, 24 Mar 2022 13:04:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/152">@hrgdavor</a> Thank you. I think for now I can just use JSCAD to get the points for my profile. I can then extrude that in BabylonJs to get the meshes.</p>
]]></description><link>https://openjscad.nodebb.com/post/1146</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1146</guid><dc:creator><![CDATA[ajw1970]]></dc:creator><pubDate>Thu, 24 Mar 2022 13:04:06 GMT</pubDate></item><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Thu, 24 Mar 2022 10:14:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/152">@hrgdavor</a> I'm working with a consultant with experience in BabylonJs. The end goal will be a full coil processing line simulator and everything I'm seeing about BabylonJs looks to be right for the job with the exception of dynamically modeling this part. <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>
]]></description><link>https://openjscad.nodebb.com/post/1145</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1145</guid><dc:creator><![CDATA[ajw1970]]></dc:creator><pubDate>Thu, 24 Mar 2022 10:14:51 GMT</pubDate></item><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Wed, 23 Mar 2022 22:21:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/746">@ajw1970</a> I am curious, do you have a lot of experience with Babylonjs ?<br />
Is there a specific reason you are using it instead of Threejs ?<br />
I am not advocating Threejs or Babylon, it is just that I already have code that converts jscad models to Threejs geometries and Babylon is only in progress.</p>
]]></description><link>https://openjscad.nodebb.com/post/1144</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1144</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Wed, 23 Mar 2022 22:21:19 GMT</pubDate></item><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Wed, 23 Mar 2022 15:39:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/1">@z3dev</a> display only.</p>
]]></description><link>https://openjscad.nodebb.com/post/1143</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1143</guid><dc:creator><![CDATA[ajw1970]]></dc:creator><pubDate>Wed, 23 Mar 2022 15:39:19 GMT</pubDate></item><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Wed, 23 Mar 2022 12:53:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/746">@ajw1970</a> welcome</p>
<p dir="auto">So, what are you expecting to,do with the meshes? Is this for display only? Or for export into models for 3D printing?</p>
<p dir="auto">JSCAD is focused on 3D printing. Of course, it can be used to display solids, but there are far better choices for creating complex renderings.</p>
]]></description><link>https://openjscad.nodebb.com/post/1142</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1142</guid><dc:creator><![CDATA[z3dev]]></dc:creator><pubDate>Wed, 23 Mar 2022 12:53:55 GMT</pubDate></item><item><title><![CDATA[Reply to Using JSCAD to build meshes for BabylonJS on Tue, 22 Mar 2022 22:28:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I am currently working on compatibility layer for 3 webgl libs I know of: relg(currenttly used in jscad), threejs, babylonjs.</p>
<p dir="auto">I have pieces needed for threejs and regl, but I have just started with Exploring creating line segments and mesh via TypedArray directly (it is important for usability with web workers and performance of postMessage)</p>
<p dir="auto">The work is part of a prototype branch,<br />
<a href="https://github.com/jscad/OpenJSCAD.org/discussions/944" rel="nofollow ugc">https://github.com/jscad/OpenJSCAD.org/discussions/944</a></p>
<p dir="auto">If you use discord, I am more active there <a href="https://discord.gg/AaqGskur93" rel="nofollow ugc">https://discord.gg/AaqGskur93</a></p>
<p dir="auto">Unfortunately email notifications do not work on this forum, and sometimes days go by before I remember to check for new topics . Actually <a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/707">@platypii</a> alerted me about your question.</p>
<p dir="auto">I will check-in here also after I produce at least some working code for Babylonjs.</p>
]]></description><link>https://openjscad.nodebb.com/post/1141</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1141</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Tue, 22 Mar 2022 22:28:15 GMT</pubDate></item></channel></rss>