Delete points based on angle



  • 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



  • 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.



  • 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


Log in to reply