pcopen - pcfilter vs attribute transfer

   6160   7   3
User Avatar
Member
184 posts
Joined: Dec. 2008
Offline
Hi,

I d like to set several attributes based on the distance from one object to another. (I.e. a sphere is placed on a grid, the further away the points of the grid are from the points of the sphere, the lower the attribute value should be)

The attribute transfer SOP provides a blend width parameter with several kernel funcions but more controll over the falloff would be great.

In vops i have the “pcopen” vop with “pcfilter” vop. Is there a way to setup a ramp in vops along with those, to get more controll over the falloff?

Many thanks,

Lucas
Edited by Fest - March 12, 2018 06:12:50
User Avatar
Member
471 posts
Joined: July 2005
Offline
Hi,

Here is simple setup using the attribute wrangle with xyzdist(). You can use a ramp (for example) to have control over influence over the distance. The resulting “influence-”value should between 0 and 1, where 1 is maximum and 0 is minimum. This value can be used, to map attributes from one object onto another object.

Attachments:
AttributeByDistance.hipnc (78.1 KB)

User Avatar
Member
184 posts
Joined: Dec. 2008
Offline
great thank you ! do we have corresponding options in vop's?

best,
L
User Avatar
Member
471 posts
Joined: July 2005
Offline
Sure,

Here is another update with a pcfind example, but written in VEX (attribute wrangle). But you can use the attribute vop, which supports pcfind(), xydist(), and ramps without using VEX. Additionally you can use VEX aswell within the inline code node, which is very similar to the attribute wrangle.

Attachments:
AttributeByDistanceM.hipnc (122.4 KB)

User Avatar
Member
8507 posts
Joined: July 2007
Offline
you can also use Ray SOP in Minimum Distance mode, don't Transform Points and get Point Intersection Distance attribute
then remap it as you want
that would be the equivalent to xyzdist() or corresponding VOP solution
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2 posts
Joined: Dec. 2016
Offline
Aizatulin
Sure,

Here is another update with a pcfind example, but written in VEX (attribute wrangle). But you can use the attribute vop, which supports pcfind(), xydist(), and ramps without using VEX. Additionally you can use VEX aswell within the inline code node, which is very similar to the attribute wrangle.


Hi Aizatulin

In the line
int pts[];
// search for closest points
pts = pcfind(1, 'P', @P, 1e4, chi('maxN'));

Whats “le4”? I can't find it as a declared variable and I'm not familiar with it- nothing comes up for it when searched…

Many thanks
User Avatar
Member
2035 posts
Joined: Sept. 2015
Offline
1e4 is short form for 10 with exponent 4. In this case instead of having to write out 10,000;

int pts[];
// search for closest points
pts = pcfind(1, 'P', @P, 10000, chi('maxN'));
User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
Hi
Actually there are lots of ways to do that as other guys said.
All of them are correct and I want to just mention that if you want to find closest points, there is one more vex function which is a little bit faster than PC find. It is nearpoints() which give you list of all closest points to current position.

Also ray sop is faster than relative functions in vex and VOP.(e.g intersect VOP or xyz distance)

About PC filter, it is exactly same as using pcfind and compute average values in the loop, so working with pcopen an pcfiltter maybe is a little simpler. However for this subject because of speed I don't suggest you to use any point cloud methods.

In overall as others said, if you have distance of closest points to current point , you can simply control the fall off by ramp attribute or smooth function.
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
  • Quick Links