JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Hermann-SW
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 27
    • Best 2
    • Controversial 0
    • Groups 0

    Hermann-SW

    @Hermann-SW

    2
    Reputation
    5
    Profile views
    27
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Hermann-SW Unfollow Follow

    Best posts made by Hermann-SW

    • JSCAD preview faster than "same" model OpenSCAD preview

      I completed implentation of 6coloring for JSCAD, JSCAD_ and OpenSCAD today:
      https://forums.raspberrypi.com/viewtopic.php?p=2032727#p2032727

      My planar graph playground tool "node.tetra.js" now creates planar graph sphere embeddings for JSCAD/OpenSCAD using the "same" spherical polygon and great circle arc (for graph edges) implementations:
      https://forums.raspberrypi.com/download/file.php?id=56354

      When playing with both models, JSCAD preview mode is much faster than OpenSCAD preview for rotating the model, not sure whether it is a simpler preview or just better. Has anybody noticed similar?

      Here is sample JSCAD model to play with online:
      https://www.openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/JSCAD.C60.6coloring.vtype.js

      20KB JSCAD file:
      https://stamm-wilbrandt.de/en/forum/JSCAD.C60.6coloring.vtype.js

      Here is "same" sample OpenSCAD model (32KB) for download:
      https://stamm-wilbrandt.de/en/forum/C60.6coloring.vtype.scad

      posted in Design Discussions
      Hermann-SW
      Hermann-SW
    • RE: Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"?

      @hrgdavor Thanks, done:
      https://github.com/jscad/OpenJSCAD.org/issues/1318

      posted in Design Discussions
      Hermann-SW
      Hermann-SW

    Latest posts made by Hermann-SW

    • RE: Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"?

      @hrgdavor Thanks, done:
      https://github.com/jscad/OpenJSCAD.org/issues/1318

      posted in Design Discussions
      Hermann-SW
      Hermann-SW
    • RE: Small "shift+enter" bug in openjscad.xyz?

      @hrgdavor Thanks:
      https://github.com/jscad/OpenJSCAD.org/issues/1317

      posted in Development Discussions
      Hermann-SW
      Hermann-SW
    • RE: Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"?

      @hrgdavor Sure, Hermann-SW.
      Should I create the issue against this repo?
      https://github.com/jscad/OpenJSCAD.org

      9/2022 I created thread on user user callbacks:
      https://openjscad.nodebb.com/topic/384/are-there-jscad-user-callbacks?_=1705433092538
      Should I create a freature request issue on that as well?

      Regards,

      Hermann.

      posted in Design Discussions
      Hermann-SW
      Hermann-SW
    • Small "shift+enter" bug in openjscad.xyz?

      Open some design in openscad.xyz, eg.:
      https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/JSCAD.minimal.js

      Then open the editor and press "shift+enter" to update the view.

      processing,
      please wait

      appears on left side and disappears then.
      Now press "shift+enter" again, this time

      processing,
      please wait

      appears, but does not go away.
      Appending a space to editor window and pressing "shift+enter" again works once, but does not clean up when pressed 2nd time.

      So the update mechanism is not prepared for "shift+enter" cleanup for 2nd, 3rd, ... time on identical source.

      Regards,

      Hermann.

      posted in Development Discussions
      Hermann-SW
      Hermann-SW
    • Can "openjscad.xyz/?uri=..." support "data" protocol in addition to "http(s)"?

      I have minimal JSCAD file:

      $ cat JSCAD.minimal.js 
      module.exports=function main(){return require('@jscad/modeling').primitives.sphere({radius: 50})}
      $
      

      I have it online on my webserver as well, and can start openjscad.xyz with it easily, and it just works:
      https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/JSCAD.minimal.js

      Then I tried to use "data" protocol:

      $ cat doit
      #!/bin/bash
      browser=firefox
      browser=chromium-browser
      
      $browser "openjscad.xyz?uri=data:text/plain;base64,`base64 -w 0 $1`"
      $ ./doit JSCAD.minimal.js 
      Opening in existing browser session.
      $ 
      

      But that URI does not work:
      https://openjscad.xyz/?uri=data:text/plain;base64,bW9kdWxlLmV4cG9ydHM9ZnVuY3Rpb24gbWFpbigpe3JldHVybiByZXF1aXJlKCdAanNjYWQvbW9kZWxpbmcnKS5wcmltaXRpdmVzLnNwaGVyZSh7cmFkaXVzOiA1MH0pfQo=

      Is there a reason why data scheme does not work for "?uri=data..."?
      If not, can it be enabled?

      I ask because this method would allow to share simple JSCAD files in the URL without storing them somewhere ...

      I tested, and there is an 8KB URI length limitation on openjscad.xyz. But in case data scheme would work, maybe "...?uri=data:application/gzip,base64;..." would work as well, allowing for scripts with gzipped length of up to 6KB ...

      Regards,

      Hermann.

      P.S:
      My GraphvizFiddle tool has a similar Share button approach, allowing to share a design via URL, eg:
      https://stamm-wilbrandt.de/GraphvizFiddle/?1705330894960#digraph%20G%20%7Brankdir%3DLR%3B%20JS-%3ECAD%7D%0A

      posted in Design Discussions
      Hermann-SW
      Hermann-SW
    • RE: Are there JSCAD user callbacks?

      Not exactly what I asked for, but OpenSCAD shows stack trace when right clicking on an object, here for "edge2()":
      https://forums.raspberrypi.com/viewtopic.php?t=333342&start=50#p2022797
      Has JSCAD similar functionality?
      https://stamm-wilbrandt.de/en/forum/OpenSCAD.object.stack_trace.png

      posted in Development Discussions
      Hermann-SW
      Hermann-SW
    • Are there JSCAD user callbacks?

      I have a JSCAD model of C36.10 fullerene graph embedded onto sphere:
      https://openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/C36.10.concave.jscad

      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:
      C36.10.concave.jscad.anim.gif

      Since JSCAD is JavaScript in browser, it should be possible to add callback for mouse click event.
      But is there some helper function that tells me which JSCAD object I have clicked on I can use in callback?

      posted in Development Discussions
      Hermann-SW
      Hermann-SW
    • JSCAD preview faster than "same" model OpenSCAD preview

      I completed implentation of 6coloring for JSCAD, JSCAD_ and OpenSCAD today:
      https://forums.raspberrypi.com/viewtopic.php?p=2032727#p2032727

      My planar graph playground tool "node.tetra.js" now creates planar graph sphere embeddings for JSCAD/OpenSCAD using the "same" spherical polygon and great circle arc (for graph edges) implementations:
      https://forums.raspberrypi.com/download/file.php?id=56354

      When playing with both models, JSCAD preview mode is much faster than OpenSCAD preview for rotating the model, not sure whether it is a simpler preview or just better. Has anybody noticed similar?

      Here is sample JSCAD model to play with online:
      https://www.openjscad.xyz/?uri=https://stamm-wilbrandt.de/en/forum/JSCAD.C60.6coloring.vtype.js

      20KB JSCAD file:
      https://stamm-wilbrandt.de/en/forum/JSCAD.C60.6coloring.vtype.js

      Here is "same" sample OpenSCAD model (32KB) for download:
      https://stamm-wilbrandt.de/en/forum/C60.6coloring.vtype.scad

      posted in Design Discussions
      Hermann-SW
      Hermann-SW
    • RE: How to generate JSCAD model in browser JS and display like demo.html?

      @hrgdavor I tried that with openjscad.xyz and it did not work. But it does work with locally hosted demo.html !
      Thanks, until now I had browser console open right, editor in middle and only half of 3D view left. After drag and drop, I can close the editor and see new graphs whenever I run node.tetra.js to produce a different x.jscad. So much easier to work now ...

      posted in Design Discussions
      Hermann-SW
      Hermann-SW
    • RE: How to generate JSCAD model in browser JS and display like demo.html?

      @hrgdavor I follow up on graph algorithm work I stopped 28 years ago:
      https://stamm-wilbrandt.de/en/TR/IAI-TR-93-10.ps.pdf
      I built undirected graph library as basis already, it will grow over time. Currently output formats of the tools are SVG, PostScript, and OpenSCAD and JSCAD for sphere embeddings:
      https://github.com/Hermann-SW/planar_graph_playground

      All planar graphs can be 4-colored (face as well as vertex, faces/vertices sharing an edge have to get different colors), there is a linear time algorithm for 5coloring, and I have built an even simpler 6coloring algorithm: https://github.com/Hermann-SW/planar_graph_playground/blob/main/undirected_graph.js#L311-L332
      Yesterday I made 6coloring work for JSCAD sphere embedding, 6coloring for embedding into the plane worked long ago:
      https://forums.raspberrypi.com/viewtopic.php?p=2032214#p2032214
      6coloring algorithm did use 5 colors only for sphere spherical face coloring (of C60 fullerene) left:
      https://www.youtube.com/watch?v=Zl-KumZDBbQ
      https://stamm-wilbrandt.de/en/forum/6coloring.spherical_plane.png

      posted in Design Discussions
      Hermann-SW
      Hermann-SW