Jump to content

Recommended Posts

Posted · Joint two stl at print time from CLI

Hi all,

 

I need to create an automates prcesss from Python or whatever that takes 2 stls (a cube with a hole and a nut), slice both and print together, in this way the nut Will fit in the hole and create a single print.

 

I dont know how i can do It from command line, i can do It with cura interface but im not able to do It from CuraEngine.

 

I tried slic3r but It places stl far away each other and i need to place in a specific location

 

Any help?

  • Link to post
    Share on other sites

    Posted · Joint two stl at print time from CLI

    Forgive me if I'm missing the point here, but... can't you just combine the cube and the nut into a single model if they're going to end up printed as one? Or do you mean that you want to make a cube with a hole in it, and a nut, that print separately but then you can put the nut in the hole?

     

    STL files can contain multiple objects (not necessarily a good idea, but they can), so it's possible if you model them together and save them in a single file you can pass that to CuraEngine.

     

    CuraEngine's CLI documentation is far from comprehensive (and the documentation in its GitHub repo is more about what it does than how to use it as an end user), but if you run curaengine help it will show you the arguments you need to pass curaengine slice to slice a file. If you look at the cura.log file in the Cura configuration folder (not sure what OS you're running but you can get to it from Cura by going to Help > Show Configuration Folder) then you can see the settings that it passes to CuraEngine (although I think you might be able to create a quality profile in Cura and just pass CuraEngine the file that gets saved in).

     

    CuraEngine's help at least tells you the arguments you need to use in what order to generate a slice. I don't know if you can move objects with it or if Cura just generates a new mesh with objects in their correct position to give to CuraEngine.

     

    Speaking of Python though, I'd be very surprised if there wasn't at least one library available to play around with STL files, so that could take care of positioning.

     

    You could also probably achieve the goal of moving certain things into certain positions and such with macros for FreeCAD (I've never had reason to try, so I can't say for sure) and then export to STL from that (which I think you can do in an automated manner, but again, not sure).

     

    If you could better explain what you're starting with and the end goal you want to achieve, that might help. Although this sounds to me like the sort of project where you need to step back and think "okay, is trying to automate this going to take longer than just doing it manually?" because for me the answer has been "yes" on several of my crazy ideas.

  • Link to post
    Share on other sites

    Posted · Joint two stl at print time from CLI
    1 hour ago, Slashee_the_Cow said:

    Forgive me if I'm missing the point here, but... can't you just combine the cube and the nut into a single model if they're going to end up printed as one? Or do you mean that you want to make a cube with a hole in it, and a nut, that print separately but then you can put the nut in the hole?

     

    STL files can contain multiple objects (not necessarily a good idea, but they can), so it's possible if you model them together and save them in a single file you can pass that to CuraEngine.

     

    CuraEngine's CLI documentation is far from comprehensive (and the documentation in its GitHub repo is more about what it does than how to use it as an end user), but if you run curaengine help it will show you the arguments you need to pass curaengine slice to slice a file. If you look at the cura.log file in the Cura configuration folder (not sure what OS you're running but you can get to it from Cura by going to Help > Show Configuration Folder) then you can see the settings that it passes to CuraEngine (although I think you might be able to create a quality profile in Cura and just pass CuraEngine the file that gets saved in).

     

    CuraEngine's help at least tells you the arguments you need to use in what order to generate a slice. I don't know if you can move objects with it or if Cura just generates a new mesh with objects in their correct position to give to CuraEngine.

     

    Speaking of Python though, I'd be very surprised if there wasn't at least one library available to play around with STL files, so that could take care of positioning.

     

    You could also probably achieve the goal of moving certain things into certain positions and such with macros for FreeCAD (I've never had reason to try, so I can't say for sure) and then export to STL from that (which I think you can do in an automated manner, but again, not sure).

     

    If you could better explain what you're starting with and the end goal you want to achieve, that might help. Although this sounds to me like the sort of project where you need to step back and think "okay, is trying to automate this going to take longer than just doing it manually?" because for me the answer has been "yes" on several of my crazy ideas.

    Hi,first of all thank you for the response.

     

    The main thing its that i want to join two stl objects. These objects are complex (the cube and nut was only an example).

     

    I want to do It in a automated way because It Will be connected to a web app.

     

    Joining both stl its very resource consuming for my laptop, so i discovered that if i print two objects at the same time in the correct place they Will be merged.

     

    Take the Next image, if i have both cubes (cube a and cube b). If i can place each one in a correct place i can create a custom final part.

     

    So, in resume, im looking for a way to import two stl and place each one in a custom position (i only want X and Y axis, because all parts Will start from heigh 0, the printer bed)

     

     

    Thank you for your time,

     

    Bets regards

     

     

    IMG_20240731_151335.png

  • Link to post
    Share on other sites

    Posted · Joint two stl at print time from CLI
    19 minutes ago, Maker88 said:

    Joining both stl its very resource consuming for my laptop, so i discovered that if i print two objects at the same time in the correct place they Will be merged.

    I see you've found the "Union Overlapping Volumes" setting 🙂

     

    I think your best bet is Python 🐍 - there's a Python library for everything. In this case it's numpy-stl. The page for it there even has an example of using it to combine two files 👍

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 7 replies
    ×
    ×
    • Create New...