Navigation

    JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. platypii
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 10
    • Best 5
    • Groups 0

    platypii

    @platypii

    7
    Reputation
    2
    Profile views
    10
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    platypii Unfollow Follow

    Best posts made by platypii

    • JSCAD geometry engine project

      Hey everyone. I was just added as a maintainer of JSCAD 👋

      I've recently been getting a bunch of commits in (with the help of @z3dev, @hrgdavor, and others) trying to make the geometry internals of JSCAD both rock solid, and super fast.

      Some recent improvements:

      • 100x speedup of toOutlines for large polys
      • 150x speedup of hullPath2 for large polys
      • 2.6x speedup of expandShell for 3D expansions. Also produces cleaner output geometry.
      • 300x speedup of offsetFromPoints for 2D expansions. Also cleaner output geometry.

      Some bigger projects I'm working on:

      • Earcut triangulation. Currently extrusions use toPolygons to turn non-convex geometries into convex polygons. But there are known bugs (#907). I believe this can be done faster, and produce air-tight geometry!
      • Fixes to offsetFromPoints. A user reported a bug in our offset code (#1017). Polygon offsetting is a hard problem in computational geometry. I think we can fix the user bug, but getting a fully general solution may not be easy.
      • Eliminate non-manifold geometry from the output of BSP trees. Still early in experiments, but I think it's possible to efficiently produce manifold geometry. This would be more robust to floating point errors (quantization would not break edges). And allow non-linear transforms (for example, bending an object #598).

      I really like the JSCAD API. V2 was a beautiful upgrade. I want to make the engine implementing that API as fast and accurate as humanly possible.

      posted in Development Discussions
      platypii
      platypii
    • RE: Embedding a design in a website

      @z3dev said:

      Also, please take a look at the minimal viewer, which is really compact.
      https://github.com/jscad/OpenJSCAD.org/blob/master/packages/utils/regl-renderer/demo.html

      This is exactly what I was looking for! Talk about an under-hyped feature 🙂

      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.

      And what's cool is these are my actual CAD files used in production, rendered in the browser super efficiently.

      THANK YOU!

      posted in General Discussions
      platypii
      platypii
    • RE: V2 JSCAD RELEASED!!!

      HAPPY ANNIVERSARY TO JSCAD V2!

      As someone who was a user of V1, then migrated to V2, and now a maintainer of the project, I have to say that JSCAD has grown an incredible amount in the last year!

      There is certainly still room for improvements. But JSCAD has tackled a very ambitious goal: bring constructive solid geometry to the web. There's really nothing similar out there. And according to Atwood's Law:

      Any application that can be written in JavaScript, will eventually be written in JavaScript

      So thanks @z3dev and everyone else who has contributed! Really excited to see where this project will go.

      posted in Announcements
      platypii
      platypii
    • RE: Embedding a design in a website

      @hrgdavor all my code will be open source. Technically it already is, but I haven't completed PRs yet. [1] [2]

      Really I just took the regl-renderer demo.html that @z3dev linked to and used it for my models. The only things I changed:

      • Include from unpkg.com
      • Remove the axes and grid
      • Added auto-rotate code so that it would spin
      • Some code style cleanup, mostly object value shorthand {camera, controls}
      • Fought with CommonJS vs ES6 module differences.

      The CommonJS vs ES6 module issue is preventing me from using the exact 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.

      This is how I'm looking to show off the designs in my site:
      Screenshot at 2021-10-10 11-08-15.png

      posted in General Discussions
      platypii
      platypii
    • RE: [Christmas Update!]New application of JSCAD: Fully 3D-printed music box

      Wow very cool! Hard to imagine how that would even be possible with traditional CAD software 🙂

      posted in General Discussions
      platypii
      platypii

    Latest posts made by platypii

    • RE: V2 JSCAD RELEASED!!!

      HAPPY ANNIVERSARY TO JSCAD V2!

      As someone who was a user of V1, then migrated to V2, and now a maintainer of the project, I have to say that JSCAD has grown an incredible amount in the last year!

      There is certainly still room for improvements. But JSCAD has tackled a very ambitious goal: bring constructive solid geometry to the web. There's really nothing similar out there. And according to Atwood's Law:

      Any application that can be written in JavaScript, will eventually be written in JavaScript

      So thanks @z3dev and everyone else who has contributed! Really excited to see where this project will go.

      posted in Announcements
      platypii
      platypii
    • JSCAD geometry engine project

      Hey everyone. I was just added as a maintainer of JSCAD 👋

      I've recently been getting a bunch of commits in (with the help of @z3dev, @hrgdavor, and others) trying to make the geometry internals of JSCAD both rock solid, and super fast.

      Some recent improvements:

      • 100x speedup of toOutlines for large polys
      • 150x speedup of hullPath2 for large polys
      • 2.6x speedup of expandShell for 3D expansions. Also produces cleaner output geometry.
      • 300x speedup of offsetFromPoints for 2D expansions. Also cleaner output geometry.

      Some bigger projects I'm working on:

      • Earcut triangulation. Currently extrusions use toPolygons to turn non-convex geometries into convex polygons. But there are known bugs (#907). I believe this can be done faster, and produce air-tight geometry!
      • Fixes to offsetFromPoints. A user reported a bug in our offset code (#1017). Polygon offsetting is a hard problem in computational geometry. I think we can fix the user bug, but getting a fully general solution may not be easy.
      • Eliminate non-manifold geometry from the output of BSP trees. Still early in experiments, but I think it's possible to efficiently produce manifold geometry. This would be more robust to floating point errors (quantization would not break edges). And allow non-linear transforms (for example, bending an object #598).

      I really like the JSCAD API. V2 was a beautiful upgrade. I want to make the engine implementing that API as fast and accurate as humanly possible.

      posted in Development Discussions
      platypii
      platypii
    • RE: [Christmas Update!]New application of JSCAD: Fully 3D-printed music box

      Wow very cool! Hard to imagine how that would even be possible with traditional CAD software 🙂

      posted in General Discussions
      platypii
      platypii
    • RE: threejs integration

      @Ion-0 said in threejs integration:

      I alao strongly feel like the rendering is much inferior to threejs

      Could you be more specific? I personally really like the regl renderer, primarily because it is very small and fast, but I also think it looks pretty good. I like hrgdavor's approach decoupling jscad from the renderer so that both can be supported. I know three has many more options. But I'm curious what more you would like to see from regl?

      posted in General Discussions
      platypii
      platypii
    • RE: Embedding a design in a website

      Final update, I have a solution I am happy with.

      I use browserify plus a small script to combine my designs + jscad modeling + regl-renderer into a single bundle.js. Then all I just include that script via standard <script> tag on my page.

      Final size of bundle.js: 99.9kb gzipped

      Less than 100kb for a fully draggable, zoomable 3d design, directly from CAD files! That's smaller than a screenshot would be.

      Design is live here if you're curious (but the rest of the project is still work-in-progress).


      @z3dev 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.

      • 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.
      • 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.
      • Use eslint to enforce style rules. Browserify to bundle with any other javascript.
      • Able to put the design in a website super efficiently. Directly from the source CAD files, without rendering to a huge mesh file format.

      parts.png

      posted in General Discussions
      platypii
      platypii
    • RE: Embedding a design in a website

      @hrgdavor all my code will be open source. Technically it already is, but I haven't completed PRs yet. [1] [2]

      Really I just took the regl-renderer demo.html that @z3dev linked to and used it for my models. The only things I changed:

      • Include from unpkg.com
      • Remove the axes and grid
      • Added auto-rotate code so that it would spin
      • Some code style cleanup, mostly object value shorthand {camera, controls}
      • Fought with CommonJS vs ES6 module differences.

      The CommonJS vs ES6 module issue is preventing me from using the exact 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.

      This is how I'm looking to show off the designs in my site:
      Screenshot at 2021-10-10 11-08-15.png

      posted in General Discussions
      platypii
      platypii
    • RE: Embedding a design in a website

      @z3dev said:

      Also, please take a look at the minimal viewer, which is really compact.
      https://github.com/jscad/OpenJSCAD.org/blob/master/packages/utils/regl-renderer/demo.html

      This is exactly what I was looking for! Talk about an under-hyped feature 🙂

      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.

      And what's cool is these are my actual CAD files used in production, rendered in the browser super efficiently.

      THANK YOU!

      posted in General Discussions
      platypii
      platypii
    • RE: Embedding a design in a website

      The thing that I don't like about my approach so far:

      Size of my jscad code: 12.4kb
      Size of rendered obj file: 1.8mb
      Size of three.module.js: 1.2mb
      Size of jscad-web.min.js: 1.2mb

      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...

      posted in General Discussions
      platypii
      platypii
    • RE: Embedding a design in a website

      Thanks for the ideas! I'm leaning more toward using three.js to render the file.

      Currently the best path I've found after some experimentation:

      1. Use jscad to export as .x3d
      2. Convert that to .obj using external program (meshlab)
      3. Render obj with three.js directly using OBJLoader

      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...

      posted in General Discussions
      platypii
      platypii
    • Embedding a design in a website

      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?

      Approaches I've considered:

      • 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.
      • 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?

      Curious what others have done.

      posted in General Discussions
      platypii
      platypii