fuse SOP distance

   6077   7   2
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
With the fuse sop if I set a radius of 1.5 to fuse points. How come I get points within that boundary that are not fused ?

rob

Attachments:
rse_test_fuseBydistance.hip (107.5 KB)

Gone fishing
User Avatar
Member
512 posts
Joined: July 2009
Offline
good question, can't really explain it,
I tend to snap the points together (you can use average position) based on a dist threshold, which gives way better results and then have another fuse SOP consolidate them (or facet SOP).
http://vimeo.com/user2522760 [vimeo.com]
http://stormbornvfx.com/ [stormbornvfx.com]
Manuel Tausch
User Avatar
Staff
138 posts
Joined: Dec. 2010
Offline
interesting. probably a bug.
An approach you might consider is to use a ForEach Sop to iteratively fuse points with a gradually increasing threshold distance.

In the attached file, the distance parameter expression in the foreach sop is set to fuse up to a maximum of 1 unit:
clamp(…) * 1
if you want the threshold to be 1.5 as you originally stated, change the *1 to *1.5

Attachments:
j_fuseloop.hipnc (107.0 KB)

john mariella
Senior Technical Director
SideFX
www.sidefx.com
User Avatar
Member
1743 posts
Joined: March 2012
Offline
It's because the fuse SOP uses the L1-norm distance (a.k.a. Manhattan distance) [en.wikipedia.org] instead of the usual L2-norm distance (a.k.a. Euclidean distance). The L1-norm is the sum of the absolute differences in x, y, and z; the L2-norm is the square root of the sum of the square differences in x, y, and z, so the L1 distance can be up to 73.2% longer than the L2 distance.

I don't know why it does this, but it does, and someone suggested that it shouldn't be an issue in any realistic case. I'm less certain of that, if only because it's so counterintuitive and uncommon in 3D graphics to use the L1-norm. It means that if you rotate a model, you can get completely different fusing behaviour because the L1-norm isn't rotation invariant.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
150 posts
Joined: Feb. 2009
Offline
im guessing that its much cheaper to use the manhattan distance to calculate if points should be fused…

to get the distance between two points requires calculation of length of a vector, meaning a root or trig will be in the calculation as opposed to straight subraction/addition of the vector components. doing that to a large number of points would mean a big difference in performance.
https://openfirehawk.com/ [openfirehawk.com]
Support Open Firehawk - An open source cloud rendering project for Houdini on Patreon.
This project's goal is to provide an open source framework for cloud computing for heavy FX based workflows and allows end users to pay the lowest possible price for cloud resources.
User Avatar
Member
345 posts
Joined:
Offline
ndickson
It's because the fuse SOP uses the L1-norm distance instead of the usual L2-norm distance

I wonder if the same thing happens in facetSOP?…
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
So what solutions to we have. The task would be loop through all the points fins the ones that are with a radius and then fuse so none intersect. I have hacked together this using a PC open and the PC furthest. The points that need fusing are green.

I would love to be able to control this per X Y Z . So you could pick all points within X radius to be fused and then set a different value for Z .

Rob

Attachments:
rse_test_pc_thenfuse.hip (124.7 KB)
test.gif (5.0 KB)

Gone fishing
User Avatar
Member
1743 posts
Joined: March 2012
Offline
kuba
I wonder if the same thing happens in facetSOP?…
A quick experiment with rotating a cube suggests that the Fuse SOP does something similar to the Facet SOP with Consolidate Points Fast. I'm not sure what Consolidate Points Slow does differently, but it seems to also use something like an L1-norm, just with different results sometimes.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
  • Quick Links