JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    using an exported STL into a script

    Design Discussions
    3
    17
    1616
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gilboonet
      gilboonet last edited by

      Hello, this week I made V2 version of simple furniture parametric designs. It's very simple scripts and they work fine (they are here : https://github.com/gilboonet/gilboonet.github.io/blob/master/outils/README.md)
      Capture d’écran de 2021-10-08 14-27-11.png

      My process then is to save the design as 3d model file, then use this file with another of my scripts to render it as a 2s skeleton that I cut. Sadly, if I try to use the exported stl file, my script has problems depending of where I want to slice. I found a workaround that is importing the stl file into Wings 3d then export it as obj and use that obj, then my script work fine. I don't see difference between the stl and obj models, so it is maybe the way they are imported to jscad (I use dynamic require). Another solution I will maybe try is to render the model using its parameters directly into the slicing script, but it's not very handy.
      Capture d’écran de 2021-10-09 11-04-17.png

      What is the 3d format you would recommend ?

      1 Reply Last reply Reply Quote 0
      • hrgdavor
        hrgdavor last edited by

        this will soon be fixed https://github.com/jscad/OpenJSCAD.org/issues/935

        1 Reply Last reply Reply Quote 0
        • gilboonet
          gilboonet @hrgdavor last edited by

          @hrgdavor It's a tablet that I used with my jscad scripts for a long time...
          IMG_20180408_064832.jpg IMG_20180203_111613.jpg

          1 Reply Last reply Reply Quote 0
          • gilboonet
            gilboonet @hrgdavor last edited by

            @hrgdavor I think Firefox 68.11.0 is the last one that can be installed in this tablet, I will try to update/install other browsers.

            1 Reply Last reply Reply Quote 0
            • hrgdavor
              hrgdavor @z3dev last edited by

              @z3dev this to do with OES_element_index_uint I have added as a step to move fwd to simplify webgl for large geometries where indices easily go over 65536.

              this check is not required right now as new code for converting to webgl buffers is not yet done.

              @gilboonet could you upgrade the browser u are using, or install a different one on that tablet ?

              gilboonet 2 Replies Last reply Reply Quote 0
              • z3dev
                z3dev @gilboonet last edited by

                @gilboonet I have a few old tablets as well, and will test this further. I think we adjusted the code to detect this properly, but may have missed something.

                hrgdavor 1 Reply Last reply Reply Quote 0
                • gilboonet
                  gilboonet @z3dev last edited by

                  @z3dev I tried to see what ES6 javascript engine it has, only saw the firefox version that is 68.11.0. It displays an error about webgl
                  IMG_20211014_082901.jpg
                  But I'm using it for years with webgl apps

                  But it is not important, it's just that is was very handy to use jscad on it and the screen is bigger than a smartphone screen.

                  z3dev 1 Reply Last reply Reply Quote 0
                  • z3dev
                    z3dev @gilboonet last edited by

                    @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 1 Reply Last reply Reply Quote 0
                    • hrgdavor
                      hrgdavor @gilboonet last edited by

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

                      1 Reply Last reply Reply Quote 0
                      • gilboonet
                        gilboonet @hrgdavor last edited by

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

                        hrgdavor z3dev 2 Replies Last reply Reply Quote 0
                        • hrgdavor
                          hrgdavor @gilboonet last edited by

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

                          gilboonet 1 Reply Last reply Reply Quote 0
                          • gilboonet
                            gilboonet @hrgdavor last edited by

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

                            hrgdavor 1 Reply Last reply Reply Quote 0
                            • hrgdavor
                              hrgdavor last edited by

                              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 🙂

                              gilboonet 1 Reply Last reply Reply Quote 0
                              • gilboonet
                                gilboonet last edited by

                                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

                                1 Reply Last reply Reply Quote 0
                                • hrgdavor
                                  hrgdavor @gilboonet last edited by

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

                                  1 Reply Last reply Reply Quote 0
                                  • gilboonet
                                    gilboonet @hrgdavor last edited by

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

                                    hrgdavor 1 Reply Last reply Reply Quote 0
                                    • hrgdavor
                                      hrgdavor last edited by

                                      @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

                                      gilboonet 1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post
                                      Powered by NodeBB | Contributors