Jump to content

Platform model duplicated when moved


Go to solution Solved by DaBrain0815,

Recommended Posts

Posted (edited) · Platform model duplicated when moved

Hi all,

I hope this is the right forum here for my topic.
My Cura plugin moves the platform model/STL via SetPosition:

setPosition(Vector(offset[0], offset[1], offset[2]))

However the movement results in an additional platform at the new coordinates instead of just moving the original one:

image.thumb.png.c42ed51b757b95a706f855a1361e17cd.png
 

This happens under Cura 4.13.1 and 5.4.
When iterating through the nodes using BreadthFirstIterator it seems to create new platform nodes during the movement process.
I already tried setting the visibility to False for a platform but this is not really working or sets the wrong platform to be invisible.

 

Is there any advice available or code example on how to get this done?

Thanks in advance,

Brian

Edited by DaBrain0815
  • Link to post
    Share on other sites

    Posted (edited) · Platform model duplicated when moved

    BreadthFirstIterator You mean DepthFirstIterator ?

     

    Is you use DepthFirstIterator you must check if the node "isSliceable"

     

    Me = CuraApplication.getInstance()
    for node in DepthFirstIterator(Me.getController().getScene().getRoot()):
          if node.callDecoration("isSliceable"):
                node.setPosition(Vector(position.x(), position.y(), position.z()))

     

    Note : setPosition should only "Move" the node so if you also copy there is something else in your code

    Edited by Cuq
  • Link to post
    Share on other sites

    • Solution
    Posted (edited) · Platform model duplicated when moved

    Thank you for your feedback.

    There is BreadthFirstIterator and DepthFirstIterator, see: https://github.com/Ultimaker/Cura/wiki/Cura-Scene-Graph#accessing-scenenodes-in-the-scene

    Why should the printer platform itself be sliceable?
    Not that you mistake me: I talk about the platform that represents the printer itself in Cura as seen in my screenshot.

    Currently I'm iterating through the nodes and save the seemingly right on in a variable to later process it to save time and resources, maybe this somehow copies the platform.

    Will check this.

     

    EDIT:

    With separate iterator-loops where I move all platform nodes it is working like a charm and does not seem to produce some memory leaks.
    That is some good news in the morning. 😄

    Edited by DaBrain0815
  • 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

      • Help Us Improve Cura – Join the Ultimaker Research Program
        🚀 Help Shape the Future of Cura and Digital Factory – Join Our Power User Research Program!
        We’re looking for active users of Cura and Digital Factory — across professional and educational use cases — to help us improve the next generation of our tools.
        Our Power User Research Program kicks off with a quick 15-minute interview to learn about your setup and workflows. If selected, you’ll be invited into a small group of users who get early access to features and help us shape the future of 3D printing software.

        🧪 What to Expect:
        A short 15-minute kickoff interview to help us get to know you If selected, bi-monthly research sessions (15–30 minutes) where we’ll test features, review workflows, or gather feedback Occasional invites to try out early prototypes or vote on upcoming improvements
        🎁 What You’ll Get:
         
        Selected participants receive a free 1-year Studio or Classroom license Early access to new features and tools A direct voice in what we build next
        👉 Interested? Please fill out this quick form
        Your feedback helps us make Cura Cloud more powerful, more intuitive, and more aligned with how you actually print and manage your workflow.
        Thanks for being part of the community,

        — The Ultimaker Software Team
        • 0 replies
      • Cura 5.10 stable released!
        The full stable release of Cura 5.10 has arrived, and it brings support for the new Ultimaker S8, as well as new materials and profiles for previously supported UltiMaker printers. Additionally, you can now control your models in Cura using a 3D SpaceMouse and more!
          • Like
        • 18 replies
    ×
    ×
    • Create New...