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

    How to get ngon center

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 305 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 06/08/2017 at 13:38, xxxxxxxx wrote:

      Hi guys!
      Anybody knows how to obtein ngon center using polygon list?
      I tried different methods, including summation of polygon centers with the subsequent division by count.
      But then I found this article and I felt somehow sad.
      https://en.wikipedia.org/wiki/Centroid

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

        On 06/08/2017 at 14:51, xxxxxxxx wrote:

        What kind of center do you want, and what for? An ngon is not necessarily planar, not necessarily convex, and not necessarily non-self-intersecting. The "center" may not even lie on the surface of an ngon even for a planar one. So what you are looking for depends on the purpose.

        Easiest mean may be (max-min)/2 for each coordinate and all points (but this will put more emphasis on outlying points). You already mention the mean of polygon centers, or you could use the mean of points (which will put emphasis on dense subpoly areas). Or you could go for the centroid as the article describes.

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