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
    • Recent
    • Tags
    • Users
    • Login

    Sorting a 2D quadrangle mesh

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 191 Views
    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.
    • H Offline
      Helper
      last edited by

      On 14/06/2014 at 01:48, xxxxxxxx wrote:

      Does anyone here know of any algorithms or code that can speedily reassemble a mesh comprised of square quadrangles in RAM? I'm trying to take a grid-like mesh and split it into rows and columns. Since the point order isn't guaranteed to be in any kind of sequence at all, this isn't as simple as just iterating over the polygons in order (since the polygon orders are randomized too).

      I've been searching high and low for some sort of solution to this, and I can't find anything that would even suggest someone has had to tackle this problem before. To clarify, what I have is a mesh that is equivalent to what you'd get out of a Plane object- but the point indices are all totally scrambled. I need to "reassemble" this mesh in RAM somehow so that I can address things by rows and columns in sequence (ie, row 1 = [1, 2, 3, 8, 7, 6, 5, 4, 10 11, 12, 14], etc).

      -CMPX

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 14/06/2014 at 11:04, xxxxxxxx wrote:

        Hi,

        you can "jump over the edge" from one polygon to another (ie. run over a polygon loop).
        You could use that to re-order the polygons. This is only simple to accomplish when the 
        structure really is the same as for a plane object.

        -Niklas

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