Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    From edge to polygons

    Cinema 4D SDK
    c++ r19 r20
    2
    5
    1.1k
    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.
    • C4DSC
      C4DS
      last edited by

      (1) Using PolyInfo one can get the unique edge index that is between 2 polygons of a mesh (via Neighbor::GetPolyInfo).
      (2) Using Neighbor::GetEdgePolys one could obtain the 2 polygons sharing the edge defined by 2 points making up the edge between these 2 polygons ... or only the one polygon if this edge is at the boundary o the mesh.

      But is there a way to go from a unique edge index - obtained via (1) - back to the polygons sharing that edge, without the need of iterating over all polygons and finding out if a polygon has the specified unique edge index as one of its edges via (1) ?

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hello,

        Except from what you already said, we don't see any solution to go from edge to polygons.

        Do you have performance issue with those ?

        Cheers
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        C4DSC 1 Reply Last reply Reply Quote 0
        • C4DSC
          C4DS @Manuel
          last edited by

          @m_magalhaes said in From edge to polygons:

          Do you have performance issue with those ?

          I am just investigating options for designing the better data structure to hold selected points, or edges or polygons.
          In case of edges, I was looking into the possibility to only store a single value: the unique edge index
          But iterating over all available polygons could be a potential bottleneck. As such it seems that using unique edge index as data is not the best solution.
          I will probably be better off by storing a pair of (4 * polygon + edge) values instead.

          The purpose of this exercise was to find an easy way to go from polygon to edge and back ... selecting two neighboring polygons, finding the shared edge, storing this edge value, reading the edge value, and from this knowing which are the 2 neighbor polygons.

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by

            hello,

            @C4DS said in From edge to polygons:

            I will probably be better off by storing a pair of (4 * polygon + edge) values instead.

            This look like what the edge selection tag is already doing.

            Cheers
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 2
            • C4DSC
              C4DS
              last edited by

              @C4DS said in From edge to polygons:

              storing a pair of (4 * polygon + edge) values

              ... it will be.
              Thanks for the confirmation

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