JSCAD User Group

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

    platypii

    @platypii

    9
    Reputation
    5
    Profile views
    17
    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: How do you single step your code?

      Actually, you can just put a debugger statement in your design, chrome will pause at it, and then you can step through it. Neat.

      posted in Development 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: [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: JScad project showcase

      Wow this is SO COOL! 👏

      Really nice work, and a great example of the benefits of generative, web-native CAD software.

      posted in General Discussions
      platypii
      platypii
    • RE: How do you single step your code?

      Actually, you can just put a debugger statement in your design, chrome will pause at it, and then you can step through it. Neat.

      posted in Development Discussions
      platypii
      platypii
    • RE: How do you single step your code?

      @david-bolt this is kind of tricky right now, but @z3dev just merged a pull request which will make it much easier, soon.

      The problem is that chrome has a different set of break points for the Main Thread vs Web Workers. If you set a breakpoint on the main sources, it won't pause the debugger if that line of code is executed on a Web Worker. Which is a problem since JSCAD runs modeling in a worker.

      You could set the breakpoint in the worker sources. But the problem is that on the currently published version of JSCAD, it loads a NEW worker for each render. Which resets the breakpoints.

      @z3dev literally just merged a commit to master that retains the web worker, and I just tested locally, and it DOES enable you to step through:

      breakpoint.png

      So your options are:

      1. run locally and add console.log statements
      2. run locally and add debugger statements
      3. run locally latest version from master, and add breakpoints to Web Worker Sources
      4. wait for the next version to be cut (usually at least monthly), and then do (3) on the jscad website.
      posted in Development Discussions
      platypii
      platypii
    • RE: import/export of .obj file

      @gilboonet I think I understand the issue here.

      The original file st_s001.obj has 3 grouped objects within the obj file:

      g Girafe_412_blue
      ...
      g Girafe_412_lime
      ...
      g Girafe_412_orange
      

      This results in generating 3 different objects being produced:

      const obj = require("./st_s001.obj")
      console.log("number of geometries:", obj.length)
      "number of geometries: 3"
      

      Since these are not closed objects, but rather 3 seperate objects, one for each color, there are seams at the boundaries. Red lines are non-manifold edges:

      giraffe.png

      However, if you remove the "group" lines from the original .obj file, everything works. Including colors, because you can have colored faces in the same object. And since it's one seamless object, the export doesn't introduce gaps.

      Can you give that a try?

      posted in Development Discussions
      platypii
      platypii
    • RE: Load jscad directory into web jscad

      Try naming the main file inside the directory index.js

      posted in General Discussions
      platypii
      platypii
    • RE: 2000 ⭐️ ⭐️ ⭐️

      We're almost at 2000 commits too! 1997 commits now.

      posted in Announcements
      platypii
      platypii
    • RE: import/export of .obj file

      @gilboonet I suspect that the additional faces and holes might be introduced by either snap or triangulate that is applied when serializing to .obj format.

      There is a serializer option for whether to triangulate or not. We might want to add an option for whether to snap or not. But it would be easy enough to test locally.

      Can you share the obj file?

      posted in Development 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
    • 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