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

    Delete points based on angle

    PYTHON Development
    0
    3
    877
    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
      Helper
      last edited by

      On 25/06/2018 at 07:06, xxxxxxxx wrote:

      Hi 
      I need to iterate through a large number of ngons and delete all points that live on straight edges of each ngon.

      Is there away to delete points based on angle? and only keep points that connect two edges at an angle different than 180 or 0 degrees.

      I've been googling and searching here but not finding anything on the topic for c4d.

      http://www.evernote.com/shard/s24/sh/d3799f89-c43f-46cc-88be-95a2119ff9bc/db06bbe282f9dbcbafc4d17748237920

      The picture describes the situation on one ngon. The selected points should be deleted. Obviously I've manually selected these pionts for illustration purposes.

      Any help much appreciated 😉
      David

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

        On 27/06/2018 at 09:43, xxxxxxxx wrote:

        Hi David,

        no, there's no function which provides this functionality directly.

        The angle can be calculated easily via VectorAngle(). With this getting the desired points should be quite easy.
        Then you may run into issues with deleting those points, because managing ngons can be quite tricky. Instead I'd recommend to use SendModelingCommand() with MCOMMAND_DELETE instead.

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

          On 28/06/2018 at 02:48, xxxxxxxx wrote:

          Andreas,

          Thanks so much for your answer! Yes, I've been looking around a bit and was afraid this was the case. While I'm getting more comfortable with python, vector maths is far from a strength of mine. I was blatantly hoping that there might be an example of a similar operation somewhere, that could take me half way 😉

          Anyway I shall explore further...

          Thanks,
          David

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