Jump to content

How does Cura detect holes and render them in the X-Ray view ?


searaider2

Recommended Posts

Posted (edited) · How does Cura detect holes and render them in the X-Ray view ?

I am digging through the code in an attempt to try and figure out how Cura detects holes in meshes and how it is able to render holes in the X-Ray view.

For example: Given a cube with a missing side, Cura is able to detect that one of the sides is missing and render that missing side red. Same with internal walls. How does it do this? Does it simply create red "error triangles" and add them to the mesh? If it can do this, why is there no setting that allows for the added triangles to be added permanently to the model being sliced.

---

Note: ignore the random side jutting out.

1.thumb.PNG.0b299a4589aaaef24195f1934a3df2c4.PNG

---

2.thumb.PNG.2b8bc34e2c99f80ee30cf79bee84937f.PNG

---

Without any mesh fixes turned on...

Layers view:

3.thumb.PNG.c9375f115e46ba1925ffa869da040ed9.PNG

---

With all of mesh fix settings turned on.. Keep disconnected faces triggers layers being added:

4.thumb.PNG.3a9d9f89fa305eda92bafc81caa9f730.PNG

---

The "Keep disconnected faces" sort of seems to be doing this.. However.. If I add an arbitrary side that juts out on an angle, it will attempt to close off the volume by connecting the side jutting out as well.

Without the side jutting out, keep disconnected faces does a good job of closing off the volume, I am just curious as to how/where this is happening in the code to allow for the X-Ray view to render holes as red faces (triangles must be getting added somewhere).

1.thumb.PNG.0b299a4589aaaef24195f1934a3df2c4.PNG

2.thumb.PNG.2b8bc34e2c99f80ee30cf79bee84937f.PNG

3.thumb.PNG.c9375f115e46ba1925ffa869da040ed9.PNG

4.thumb.PNG.3a9d9f89fa305eda92bafc81caa9f730.PNG

Edited by Guest
  • Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?

    The X-Ray renderer simply counts how many faces it encounters. If it's even, all is well. If it encounters an uneven amount of faces, there is an issue.

    It can't actually add them, because it's just a rendering trick. Even if it would add them, it would only work in very few select cases.

    • Like 1
    Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?

    Okay that sort of makes sense.. I guess I am trying to figure out how it goes from there being an issue detected, to the X-Ray view seemingly adding red polygons where there previously were none. The red has to be added somehow right? What sort of tricking is happening?

    This is what it looks without the extra bit:

    5.thumb.PNG.a2a2361dacb2c010b38187576107f575.PNG

  • Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?

    The red you are seeing is not a separately drawn face. Instead it is basically parts of the "underlying" faces that are drawn in another color by a pixel shader.

    XRay view does not add faces. That's impossible. Instead, only realize the truth... There is no face.

    • Like 2
    Link to post
    Share on other sites

    Posted (edited) · How does Cura detect holes and render them in the X-Ray view ?

    It may be detecting and showing an open edge. If your 'box' with the one side removed is 2 dimensional (no thickness on the walls) it should be seeing it as an open side with open edges. If the wall has thickness it will show as a proper empty space.

    Edited by Guest
    • Like 1
    Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?

    Okay I have a clearer understanding as to what is happening now. Thanks guys. I am now wondering how complicated it would be for Cura to have some sort of built-in tool that allows you to choose which polygons to add/remove? Obviously this would become very complex, but it would give users the ability to "fix" their models inside of Cura.

    For example: In the first model I used above, the user could remove the polygon jutting out and add a polygon where there is a "hole" in the model.

  • Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?
    ......wondering how complicated it would be for Cura to have some sort of built-in tool that allows you to choose which polygons to add/remove? Obviously this would become very complex, but it would give users the ability to "fix" their models inside of Cura.

    For example: In the first model I used above, the user could remove the polygon jutting out and add a polygon where there is a "hole" in the model.

     

    I am kinda on the side of not turning Cura into a full 3D Package. It reminds me of the days, way back when, at a time when every program was trying to shoehorn functionality into everything. Illustrator sorta became a page layout program and word processor and shifted away from pure design. While they did need word processing capabilities, it did not need to replace word perfect (showing the age here) or Msoft word or Quark.

    Dedicated 3D programs is where things like that should be addressed while programs like Cura should focus on the slicing functionality and making the printers behave.

    You can get free 3D programs to do what you are talking about and not all of them have huge learning curves to overcome. Requires a bit of diligence on the user, but, would that same diligence be required to learn in Cura?

    And Cura does already do some amazing things such as 'fix' holes and a bit of unioning of disparate parts that can be combined as well as not see everything as a unique object should you click a box.

    • Like 1
    Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?

    For example: In the first model I used above, the user could remove the polygon jutting out and add a polygon where there is a "hole" in the model.

    Even if we wanted to do this (See kmanstudios point about not becoming a modeling tool), it's also quite a challenge. It's not about getting it to work with 95% of the cases, it's the 5% that's really weird that makes it difficult. Adding a feature that only works 95% of the time will get us a lot of support calls ;)

    We are looking into automatically fixing models.

    • Like 1
    Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?

    This Thread shows just how a simple fix in a 3D Package or, just basic fundamentals can get the job done and offload that responsibility from Cura and, where it belongs, on the modeler, no matter what package to be used. They all work pretty much the same in basic philosophy, just interface differences.

    Houdini would be the exception to that rule, but it is mostly for super-duper high level stuff.

    • Like 1
    Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?

    ...

    I am kinda on the side of not turning Cura into a full 3D Package. It reminds me of the days, way back when, at a time when every program was trying to shoehorn functionality into everything.

    ...

     

     

    I am kinda on the side of not turning Cura into a full 3D Package. It reminds me of the days, way back when, at a time when every program was trying to shoehorn functionality into everything.

    ...

     

    Yes, I also prefer compact, separate, dedicated programs for each function. It is better that a program can do one thing excellent, than 100 things half-way. Because in the latter case, you have a bunch of bloatware, but you can't use it for anything.

    For example, Microsoft Word got such a nightmare, compared to the old versions '97 and 2000, that it takes me five times more clicking and searching through the mess of ribbons than before. It really decreases my productivity. And to prevent it from destroying my layout, I have to disable every automatic function (which I also did in Office '97 and 2000 of course). Microsoft calls this "autocorrect", but their idea of correct seems to be different from mine. :) So, for writing bodies of text, I switched to Notepad++, and I add the layout as the last step only in Word. And I do all corrections manually, in the way that I want it. Thus MS Word now takes gigabytes of disk space and RAM, but is less functional for me than a 20 years old Word 97, and even less than Notepad++.

    I hope Cura will not fall into this bloatware trap. At least that's my viewpoint, but of course, anyone has the right to see things differenctly. :)

  • Link to post
    Share on other sites

    Posted · How does Cura detect holes and render them in the X-Ray view ?
    For example, Microsoft Word got such a nightmare, compared to the old versions '97 and 2000, that it takes me five times more clicking and searching through the mess of ribbons than before. It really decreases my productivity.....

     

    Just to add to that nightmare on the creative side, we used to have to jump through hoops at a place I worked at doing Digital Output. I was the tech and mech guy. But MSoft really was a bear to work with as it just did not want to follow basic compatibility protocols. I was one of the few who could get it out consistently. That was a while ago, but it underpins what geert_2said.

    So, as long as the focus in on getting the machines to behave and materials to work, then I think Cura remains a winner for me. For instance, I just fixed a file in another thread that seemed to be a Cura issue and it was a modeling issue. Tiny thing, but it does make a difference. And, it could have been fixed in any 3D program as I worked n the STL file.

    I know S3D has a great rep and I actually own it, and have it installed, but have never needed to use it. So, not dissing it, just letting it be known why I cannot compare the properties.

  • 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.8 Stable released 🎉
        In the Cura 5.8 stable release, everyone can now tune their Z seams to look better than ever. Method series users get access to new material profiles, and the base Method model now has a printer profile, meaning the whole Method series is now supported in Cura!
        • 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
          • Thanks
          • Like
        • 3 replies
    ×
    ×
    • Create New...