<?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[Are there JSCAD user callbacks?]]></title><description><![CDATA[<p dir="auto">I have a JSCAD model of C36.10 fullerene graph embedded onto sphere:<br />
<a href="https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/C36.10.concave.jscad" rel="nofollow ugc">https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/C36.10.concave.jscad</a></p>
<p dir="auto">I would like to be able to click on a vertex, and then that vertex should be moved to centroid polar coordinate of its neighbors, like vertex 7 here:<br />
<img src="https://camo.nodebb.org/c0d65c2b14f2ea28af071f8dbf2251f97a6495b8?url=https%3A%2F%2Fstamm-wilbrandt.de%2Fen%2Fforum%2FC36.10.concave.jscad.anim.gif" alt="C36.10.concave.jscad.anim.gif" class=" img-responsive img-markdown" /></p>
<p dir="auto">Since JSCAD is JavaScript in browser, it should be possible to add callback for mouse click event.<br />
But is there some helper function that tells me which JSCAD object I have clicked on I can use in callback?</p>
]]></description><link>https://openjscad.nodebb.com/topic/384/are-there-jscad-user-callbacks</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Mar 2026 12:20:32 GMT</lastBuildDate><atom:link href="https://openjscad.nodebb.com/topic/384.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Sep 2022 16:21:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Are there JSCAD user callbacks? on Thu, 10 Aug 2023 03:37:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/761">@Hermann-SW</a> said in <a href="/post/1264">Are there JSCAD user callbacks?</a>:</p>
<blockquote>
<p dir="auto">tionality?</p>
</blockquote>
<p dir="auto">Wouldn't that also be displayed in the browser stack trace?</p>
]]></description><link>https://openjscad.nodebb.com/post/1339</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1339</guid><dc:creator><![CDATA[Jason Sprouse]]></dc:creator><pubDate>Thu, 10 Aug 2023 03:37:56 GMT</pubDate></item><item><title><![CDATA[Reply to Are there JSCAD user callbacks? on Mon, 05 Sep 2022 21:12:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://openjscad.nodebb.com/uid/761">@Hermann-SW</a> this is one of many thing we would like to implement, but it is not implemented, or even specified as a possible future feature.</p>
<p dir="auto">Current 3d engine is regl, and I am working on interchangeable support for Three.js and Babylon.js.</p>
<p dir="auto">regl has slowed down with development but Three.js and Babylon.js are very much active<br />
Getting info what object is clicked or mouse over is easy in Three.js and Babylon , but for regl I am not sure (it may or may not be easy to do).</p>
<p dir="auto">You likely want to use jacad to generate geometries, give them some identifiers, interact with them and then upon interaction change the model with performance in mind by updating only things that changed.</p>
<p dir="auto">This is something we could colaborate on, but it is not something that can be simply implemented as part of jscad script runner. Because the current workflow for jscad is:</p>
<ul>
<li>make a script</li>
<li>expose <code>getParameterDefinitions</code> - jscad can generate params form</li>
<li>expose <code>main</code> method - jscad will call it with parameters and display result<br />
As you can see there is no concept of partial interactions or reactive changes, it is more like a commandline program that you write, and jscad calls to display it's output in 3d (and provide export option)</li>
</ul>
<p dir="auto">there are several building blocks that make this combo <code>getParameterDefinitions</code> + <code>main</code> work, with proper separation of those building blocks users would be allow to create much more than just scripts that produce 3d geometry. But such efforts take time, and we are low on man-power.</p>
<p dir="auto">One such reusable block I started creating is code editor <a href="https://github.com/hrgdavor/jsx6/tree/main/libs/editor-monaco" rel="nofollow ugc">https://github.com/hrgdavor/jsx6/tree/main/libs/editor-monaco</a> although there are nice code editors, they are not too easy to use or combine with JS projects (takes too much knowledge) so I am aiming to create more friendly wrappers. Each editor is stuck with their own cool build process and tooling that was popular at the time of the project start.</p>
<p dir="auto">I am also improving my skills with web workers, and babel transformations to provide building blocks for script execution with proper line numbers in stack traces and built-in browser's debugger integration.</p>
<p dir="auto">so, slowly something is comming along ... slowly...</p>
]]></description><link>https://openjscad.nodebb.com/post/1265</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1265</guid><dc:creator><![CDATA[hrgdavor]]></dc:creator><pubDate>Mon, 05 Sep 2022 21:12:54 GMT</pubDate></item><item><title><![CDATA[Reply to Are there JSCAD user callbacks? on Sun, 04 Sep 2022 07:19:06 GMT]]></title><description><![CDATA[<p dir="auto">Not exactly what I asked for, but OpenSCAD shows stack trace when right clicking on an object, here for "edge2()":<br />
<a href="https://forums.raspberrypi.com/viewtopic.php?t=333342&amp;start=50#p2022797" rel="nofollow ugc">https://forums.raspberrypi.com/viewtopic.php?t=333342&amp;start=50#p2022797</a><br />
Has JSCAD similar functionality?<br />
<img src="https://camo.nodebb.org/f06d535bb2a3ecbc9184eed370e8e77ca96f79d2?url=https%3A%2F%2Fstamm-wilbrandt.de%2Fen%2Fforum%2FOpenSCAD.object.stack_trace.png" alt="https://stamm-wilbrandt.de/en/forum/OpenSCAD.object.stack_trace.png" class=" img-responsive img-markdown" /></p>
]]></description><link>https://openjscad.nodebb.com/post/1264</link><guid isPermaLink="true">https://openjscad.nodebb.com/post/1264</guid><dc:creator><![CDATA[Hermann-SW]]></dc:creator><pubDate>Sun, 04 Sep 2022 07:19:06 GMT</pubDate></item></channel></rss>