JSCAD User Group

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

    Unfolder script for V2

    Comments & Feedback
    1
    1
    123
    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

      I rewrote my unfolder for JSCAD 2 and I'm very happy with the result. It looks almost like an application as user can enter the model file name and choose between options to see the model, scale it and see resulting dimensions, and finally choose several options for the unfolded pattern (paper size, flaps or not, exclude links, change flap attachment). I cleaned the code as possible and now it doesn't use global variables. It was the first time I used align() and it's a very handy function that allowed me to group small pieces. Due to the complexity of the script, it freezes after some time, I suspect memory leak but did not see where it could be. What would be nice with such script that has lots of parameters would be to be able to save/load parameters sets.

      The project can be found here, unzip the archive into a directory, then run jscad and open it as a project. I added some 3d files, but you can test others by putting them into the project directory and open it with jscad. It can also directly run on a script, but to do so you must edit the code and change main() (this way it can run as a standalone script file).

      Here's a link to a demo video
      Capture d’écran de 2022-01-05 13-54-17.png

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