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
pcopen - pcfilter vs attribute transfer
6182 7 3- Fest
- Member
- 184 posts
- Joined: Dec. 2008
- Offline
- Aizatulin
- Member
- 475 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.
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.
- Fest
- Member
- 184 posts
- Joined: Dec. 2008
- Offline
- Aizatulin
- Member
- 475 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.
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.
- tamte
- Member
- 8539 posts
- Joined: July 2007
- Offline
- robbieMetapixel
- 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
- BabaJ
- Member
- 2038 posts
- Joined: Sept. 2015
- Offline
- Sadjad Rabiee
- 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.
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.
-
- Quick Links