using an exported STL into a script



  • @gilboonet said in using an exported STL into a script:

    One advantage that Cascade Studio has over jscad is that it works even on old android tablets that used to be able to run jscad but doesn't anymore.

    I would guess that those old tablets have a non-ES6 compatible JavaScript engine. The V2 JSCAD code is taking advantage of some of the newer JavaScript features, such as spread operator, etc.



  • @gilboonet it is hard to say why jscad does not work on old tablet, could be many different reasons. It should, but who knows what error happens that it fails. We try to keep it compatible.



  • @hrgdavor The geometries are good. It's something I'm trying to do with jscad for more than 5 years now and for years, before v2 and last build of v1, it wasn't. I already tried to start from union of difference of rectangles and then extrude, but the STL i get is the same as the one I get from union of difference of cuboids. For me, the advantage that jscad has over Cascade Studio is that it renders 2d, I mostly only use web versions, so the size of a build doesn't matter. One advantage that Cascade Studio has over jscad is that it works even on old android tablets that used to be able to run jscad but doesn't anymore.



  • @gilboonet for the examples you have here on the screenshots you may get better results by doing booleans in 2d and then extrude.

    The boolean operations in jscad are based on polygons of the geometries and it is a generic algorithm, it is possible from there that you get resulting geometry that looks good, but creates difficulties when slicing.

    You of course want to use the tool that gives you good results right now, but if you have time to investigate this further it would be appreciated.

    It is interesting to me to see if this is something that could be fixed, or at least if there could be a workaround.

    one advantage jscad has over OpenCascade is that regular build of WASM for OCCT is 12MB.



  • @hrgdavor what is breaking my flow using jscad is that it produces 3d models that seems to be hard to slice but only from some coordinates. It is maybe due to the way it splits polygons from its center.



  • is this due to different output genrated for the same 3d geometry ?

    cascade studio uses OCCT that could be preserving surfaces closer to what u expect.

    it should be possible to use OCCT inside jscad in the future, but you should use tool that gives you better results right now.

    If you find out what is breaking your flow while using jscad, let us know 🙂



  • It could maybe help to see unfold volumes of the same kind, a column :
    rendered with JSCAD
    Capture d’écran de 2021-10-10 10-23-02.png

    rendered with Cascade Studio
    Capture d’écran de 2021-10-10 10-27-15.png



  • @gilboonet np, keep the cool tools comming 🙂 I will let you know as soon as I have a simplified way to integrate with jscad.



  • @hrgdavor Thank you for your suggestion. For the moment I'm simply using another tool to run those scripts, Cascade Studio, that produces an STL output that can be used without errors with my scripts, it can also save to OBJ that is handy for my unfolder.



  • @gilboonet you could try export JSON. The json export will give you exact copy of the objects you return from the main method. Then you can continue using the objects in your other script the same as it would be inside the main


Log in to reply