Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    BuildNgon() with only two inner edges crashes

    Cinema 4D SDK
    c++ r20 classic api
    2
    8
    1.2k
    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.
    • fwilleke80F
      fwilleke80
      last edited by fwilleke80

      Hi,

      Porting code again... this seemed to work years ago:

      ngonBase->BuildNgon(innerEdges, NULL, 2, 0, polygonsDest, pointsDest);
      

      An array with 2 inner edge indices is passed, and BuildNgon() should construct an Ngon around them.

      In R20, I am getting crashes with the following console output:
      /Volumes/Branches/build_osx/osx-4-release/depot/release/20.0/modules/model/source/dave/modeling/ngonbase.cpp(1450): CRITICAL: Stop: Degenerated Ngon Creation, an Ngon must have at least 5 vertices.

      I am well aware that the actual reason for the crash might be somewhere else... but I want to understand what's going on here. Under which conditions exactly is this error thrown? When are there less than 5 vertices in the Ngon?Does it have anything to do with the topography of the surrounding polygons?

      Thank you & greetings,
      Frank

      www.frankwilleke.de
      Only asking personal code questions here.

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by

        Hi Frank, thanks for reaching out us.

        Can you please provide us with a code snippet to reproduce the Critical Stop?

        Thanks, Riccardo

        1 Reply Last reply Reply Quote 0
        • fwilleke80F
          fwilleke80
          last edited by

          Hmm, I'll try to make something up. The project is non-public code and part of a bigger project.

          But even without a code snippet, you might know about any changes, as the code used to work.

          If I pass only one inner edge, consisting of 2 vertices, to BuildNgon(), which definitely has either a quad or a triangle at each of its sides, what could go wrong?

          Cheers,
          Frank

          www.frankwilleke.de
          Only asking personal code questions here.

          1 Reply Last reply Reply Quote 0
          • fwilleke80F
            fwilleke80
            last edited by

            I noticed it's a different error message sometimes.

            So here goes my next question: Under which circumstances does BuildNgon() print the following error message:
            /Volumes/Branches/build_osx/osx-4-release/depot/release/20.0/modules/c4dplugin/source/src/christian/ge_register.cpp(244): WARNING: Unknown baselist allocator - RegID: OBJECT
            Optout defined by Installer / Updater.

            ?

            Thanks & greetings,
            Frank

            www.frankwilleke.de
            Only asking personal code questions here.

            1 Reply Last reply Reply Quote 0
            • fwilleke80F
              fwilleke80
              last edited by

              Oh, it turns out, the last message wasn't triggered by our code. It appears anyway ๐Ÿ˜‰

              www.frankwilleke.de
              Only asking personal code questions here.

              1 Reply Last reply Reply Quote 0
              • r_giganteR
                r_gigante
                last edited by

                Hi Frank, thanks for following up.

                With regard to

                /Volumes/Branches/build_osx/osx-4-release/depot/release/20.0/modules/c4dplugin/source/src/christian/ge_register.cpp(244): WARNING: Unknown baselist allocator - RegID: OBJECT
                Optout defined by Installer / Updater.

                it has actually nothing to do with BuildNgon()

                With regard to

                /Volumes/Branches/build_osx/osx-4-release/depot/release/20.0/modules/model/source/dave/modeling/ngonbase.cpp(1450): CRITICAL: Stop: Degenerated Ngon Creation, an Ngon must have at least 5 vertices.

                it takes place if the code identifies a potential situation where the number of outer edges ( computed from the list of the inner edges ) is lower than 5 which then could create degenerate ngons (since they should be quads).
                This check has been recently introduced to avoid that 4-sides degenerated ngons were created in place of quads.

                Best, Riccardo

                1 Reply Last reply Reply Quote 0
                • fwilleke80F
                  fwilleke80
                  last edited by fwilleke80

                  Hi Ricardo!

                  OK, thanks! If there a way to ask the Ngon system for more information about that?
                  Or do we have to recreate parts of the Ngon creation algorithm to find predict degenerate Ngons before calling BuildNgon() ?

                  Cheers,
                  Frank

                  P.S.: Sorry for the late reply!

                  www.frankwilleke.de
                  Only asking personal code questions here.

                  1 Reply Last reply Reply Quote 0
                  • r_giganteR
                    r_gigante
                    last edited by

                    Hi Frank, thanks for following up ๐Ÿ™‚

                    With regard to your latest question, there are no means to "ask" the Ngon system about that.

                    Checking for the number of vertexes an n-gon is going to use before deciding to use it, it's a reasonable way to proceed.

                    Cheers, Riccardo

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post