Jump to content

Sign in to follow this  
Andrzej

Delete points based on distance

Recommended Posts

Hey,

 

I was considering the scenario when I have the object and let say one single point/null next to it.

And base on the distance between the null and my mesh I would like to delete the mesh points gradually. I tried xpresso a bit today with point node but I cant figured out how to do it.

From my understanding I would need position attribute from my mesh points and the distance from my null to the mesh as a variables and then I can run if condition saying if the distance is less then something remove points from my geo. If you Guys can help my with that using python or coffee I would be delighted 🙂

Thanks

Share this post


Link to post
Share on other sites

Not in front of machine atm, but there is an example in sdk where edge selection is made. Here is selecting points from top of my head, hope someone will chip in...

 

import c4d

from c4d import utils

#Welcome to the world of Python

 

def main():    

 

count = obj.GetPointCount()   

selection = obj.GetPointS()     

 

for i in xrange(count): 

      selection.Select(i)


Free C4D trainings from MAXON professional on our youtube channel

 

https://www.youtube.com/c4dcafe

Share this post


Link to post
Share on other sites

here's my take on it. You have two user data entries on the Python Generator. You need to input a null in the first one and the second entry defines the distance from the null, which the points will be deleted at. It's a bit slow, but I just made this up in a hurry so... 🙂

point remover.c4d

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...