Jump to content
Ultimaker Community of 3D Printing Experts

Skin Starts (Z-Seam) SimulationView Mod


Recommended Posts

Posted · Skin Starts (Z-Seam) SimulationView Mod

Hey. Recently I was printing some gears. I've found the location of the Z-seam* affecting the smoothness of the gears, which is important to me. So much so that I will manually edit the g-code to move it where I deem necessary, after trying my hardest to let Cura place them in inside corners.

 

The one thing I've found a bit annoying though is that it is cumbersome to check every layer, using the toolpath animation to check the start/seams. I noticed Slic3r has an option to show these, but I prefer Cura anyway.. So I thought maybe I could develop a plugin that does this, after not finding any option or plugins.. At this point I don't see how I could write a separate plugin for it, but what I found to work is to modify the original SimulationView "plugin". (The code that provides the Layer view in Cura's Preview tab).

 

Point of this topic:

Find others' thoughts in this feature, ideas / help developing it..

 

How to use:

In Cura's plugin directory: C:\Program Files\Ultimaker Cura 4.7\plugins on my installation, move the existing SimulationView folder elsewhere as backup, then place mine in there. Find mine at https://github.com/BasF0/Cura/tree/dev/plugins/SimulationView

 

 

DevTalk:

Not knowing Cura's code, or having ever written a plugin, or knowing a thing about shaders or glsl this was hard, but a few days in and here we are.

 

I walk through the LayerData and check where a new skin line occurs. (Confusingly, I've found that not to be "SkinType" but rather "Inset0Type"). The vertex that is the start of such a new line is added to a new LayerData object, created through a LayerDataBuilder. I've found that in this way, the Uranium backend will accept it 🙂 The day of writing this post, I've rewritten the code to do this inside a "Job" and it seems that SimulationView' _onSceneChanged is a good moment to recompute the starts. I have written a new shader that takes in points, and the geometry shader then emits a vertex_strip representing a 3d rectangle for each point. Perhaps a rectangle in the start is not the best shape one can think of, but a simple rectangle does the job for now. The vertex normals are probably wrong, by the way.. The size is also hardcoded in the shader because I was having some issues.

 

Debugging this was hard. I would simply reboot cura, open an stl, slice it, go to preview tab, to see my results. If I made an error in Python, the entire layer view would usually not load. If I made a syntax error inside the shader, the starts simply wouldn't be drawn, so I would manually have to check my changes. Is there an easier way for that ? I tried seeing if I could unload and reload the SimulationView plugin, but it seems not possible atm.

 

Bugs, todos and Ideas:

- currently hardcoded square height; should depend on line height I guess

- perhaps a configurable shape/size

- configurable color (or color per extruder, I dont know how cura handles that atm anyway)

- in the menu, the color indicator for the starts option does not display the correct color

- perhaps convert to a separate plugin that can be installed via the marketplace

- a way to separate the current top layer starts from the others.. perhaps simply a different color

- the "show starts" option is still visible when in compatibility mode (when the shader shouldn't be drawn)

- what would be even better is if I could drag the square to change the start! I have an idea how that might work, but am not sure of its implications:

I suppose the square should be draggable in the layer-plane (X, Z I believe?) and could then snap to each line start (visually). To adjust the polygon, we could copy the now skipped lines to the end of the current set of lines making up the skin, converting the 'skipped' lines into travel moves.

Of course, when we have many layers; perhaps some multi-layer start move should then be thought of as well.. anyway

 

 

*Not sure I like the name "Z-seam" because it has nothing to do with the Z-axis. Rather, it is the layer its skin/perimeter/wall seam.

 

 

 

 

 

starts_benchy.JPG

starts_benchy2.JPG

  • Like 1
Link to post
Share on other sites
Posted · Skin Starts (Z-Seam) SimulationView Mod

Okay, managed to fix the line width / layer height thing, as you can see in this Benchy's smoke stack the rectangles are now sized accordingly, as well as now drawn in the center of the layer.

smokestack.JPG

  • Link to post
    Share on other sites
    • 2 weeks later...
    Posted (edited) · Skin Starts (Z-Seam) SimulationView Mod

    Opening cura generated gcode now also shows the skin starts

    https://github.com/BasF0/Cura/commit/fa8b56d6adbaa06ef1f062563f7aa3faddf95919

     

    note 2 issues: (I'm on cura 4.7.0)

    1. When opening gcode it seems that the layer-widths of the bottom layer are incorrect ? Well, the print lines are drawn correctly, but the starts rectangles are really small, so perhaps its me.

    2. The height of the top layer is drawn wrong, see attached photo.

     

    However, the lack of tools in a gcode preview prevent me from opening a python console and doing further debugging, therefore I am also hesitant to open an issue on Cura's github.

    topissue.jpg

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

      • Talking additive | The 3D printing podcast
        Why should we be the only ones asking questions? Join us and ask Jabil all your questions on September 22nd 5pm CET
          • Like
        • 3 replies
      • Ultimaker masterclass: Optimizing your Ultimaker Cura workflow
        Save your seat for either broadcast on September 23.
        What will you learn?
        · Best practices for iterative print preparation and every lesson you should learn from each print
        · The right way to use per-object settings and when they are most useful
        · Easy-to-use resources for anyone who wants to develop their own printer definitions, plugins, or print profiles
        · How to optimize print profile settings and whether to “keep” or “discard” changes
        · When is the right time to export your drawing from CAD? (Based on Ultimaker Cura’s surprising power as 3D control software)
        · And a whole lot more tips and tricks!
         
        How can I join?
        This free masterclass will take place twice:
        1. 11am CEST (5pm SGT, 5am EDT)
        2. 5pm CEST (11am EDT, 8am PDT, 11pm SGT)
          • Like
        • 0 replies
      • Do you use 3D printing at work? Let us know
        It doesn't matter if you are using 1 Ultimaker or 10, there is inspiration in everything. We're looking for ...
        • 1 reply
    ×
    ×
    • Create New...