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

    How to select Non-Planar Polygons? [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 432 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 07/08/2015 at 01:53, xxxxxxxx wrote:

      Hi guys,

      I want to select all Non-Planar Polygons like you can do in the attributes>project info(mode)>structure panel. I want to do this with python but cant find anything about this so i'm wondering if this is even possible.

      Thanks guys!

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

        On 07/08/2015 at 02:36, xxxxxxxx wrote:

        Hello,

        this functionality of the "Project Info" mode cannot be access from the outside so you have to rebuild that functionality.

        From a given PolygonObject you can access the polygon selection that is stored in a BaseSelect object with GetPolygonS(). Then you can loop trough all polygons returned by GetAllPolygons(), check if a certain polygon is planar or not and select it.

        Best wishes,
        Sebastian

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

          On 07/08/2015 at 03:41, xxxxxxxx wrote:

          Thanks Sebastian,

          I already thought that wasn't possible.  :frowning2:

          I know how to iterate through the polygons of object and select them. But i don't know how to check if a certain polygon is planar or not. Do i need to do this mathematically?

          Greets, 
          Gianni

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

            On 07/08/2015 at 08:57, xxxxxxxx wrote:

            Hello,

            yes, you have to solve this problem mathematically. But since this is a very common task you should be able to find many resource like this one: "Using dot product to determine if point lies on a plane".

            Best wishes,
            Sebastian

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

              On 10/08/2015 at 01:10, xxxxxxxx wrote:

              Thanks Sebastian i have got it working!

              found a python script made by pim grooff http://blog.grooff.eu/?p=90 
              im checking if the cross corner points lines are intersecting if not its a non planar poly

              Greets,
              Gianni

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