Jump to content
Sign in to follow this  
br1

delete points on curve except first and last

Recommended Posts

Hi,

I'm trying to remember how to do this.

I'm using a pattern to delete points on a curve, something like !*:10 but I want to exclude the first and the last point.

Bruno

Share this post


Link to post
Share on other sites

I think there are many ways to do this. I would use this pattern:

0 $N

and set it to "Delete Non-Selected".

Edited by magneto

Share this post


Link to post
Share on other sites

try this as a python expression in the pattern field


inc = 10
points2delete = range(1,len(hou.pwd().inputs()[0].geometry().points())-1,inc)
return points2delete
[/CODE]

Edited by sanostol

Share this post


Link to post
Share on other sites

I think there are many ways to do this. I would use this pattern:

0 $N

and set it to "Delete Non-Selected".

Mmm, maybe I didn't state it correctly. I don' t want to delete all points between first and last, only a percentage based on the pattern !*:10

Share this post


Link to post
Share on other sites

try this as a python expression in the pattern field


inc = 10
points2delete = range(1,len(hou.pwd().inputs()[0].geometry().points())-1,inc)
return points2delete
[/CODE]

It gives me an error :

Error: Unable to evaluate expression (Syntax error - extra tokens detected in expression (/obj/curve_object1/Br1_fence1/delete1/pattern)).

My bad, it was not correctly set to python. Seems to work now :)

Edited by br1

Share this post


Link to post
Share on other sites

you can as well just use this pattern

!*:10 ^0 ^$N[/CODE]

  • Like 2

Share this post


Link to post
Share on other sites

you can as well just use this pattern

!*:10 ^0 ^$N[/CODE]

Exactly what I was looking for, Tomas !

Looks so simply now :), thanks !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×