transform P and volume gradient

   3263   5   1
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi All , I have an irregular sized polygon tube. I am looking for a solution to create a line down the centre of the tube.My initial idea was to turn the tube into a SDF > with some scattered points throughout the volume. Then in Vops move the points to the boundary of the volume being zero.The some how invert a value or use N to move the point to the centre of the volume along the gradient N vector.

I am not even sure if you can do this as I have the feeling any point inside a volume has a value of -1 in the volume and the gradient only can tell you how far away from the surface you are. Maybe I cannot see the wood for the trees and there's a simpler solution to create a line along the centre of a tube,and no you cannot use the curve sop in the example file.

any ideas on this brain teaser ?
Edited by circusmonkey - Oct. 13, 2016 02:51:46
Gone fishing
User Avatar
Member
648 posts
Joined: July 2005
Offline
1st attempt, see attached.
I have a feeling there's a much better way to do it… like using some obscure SOP in a way it was never intended…

Attachments:
curve_from_tube.hiplc (164.3 KB)

User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
A interesting approach but I cannot get it to work with my example file

ROb
Gone fishing
User Avatar
Member
373 posts
Joined: March 2009
Offline
If the polygon tube has a nice topology, ie: the same number of points around each row, you can separate it out by rows (convert sop), get the center of each row, and use that. Otherwise, you can scatter points on the outside of your geo, and then raymarch inwards until the sign of the gradient flips then tell it to stop moving and you will have your center. If you're tying to create a curve from this, you should start with an edge loop on your poly tube or something so you have a good point order to create the new curve.
Ian Farnsworth
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Solitude
If the polygon tube has a nice topology, ie: the same number of points around each row, you can separate it out by rows (convert sop), get the center of each row, and use that. Otherwise, you can scatter points on the outside of your geo, and then raymarch inwards until the sign of the gradient flips then tell it to stop moving and you will have your center. If you're tying to create a curve from this, you should start with an edge loop on your poly tube or something so you have a good point order to create the new curve.

Thanks for the reply Ian, the tube topology is bad. I did think I could do what your saying by slicing up the tube into thin sections to make it more manageable.Your idea sounds interesting,to wait for the gradient to flip.

Rob
Gone fishing
User Avatar
Member
252 posts
Joined:
Offline
Hi, I took a spin on this. But I'm not entirely sure if this usable on your scene.
I used a Tetrahedralize SOP followed by a Findshortestpath SOP to get a base poly line crawling from a start point, towards an end point. Then I tried detecting the tunnel centers nearest to the points.. It's still a bit raw on some parts, but hopefully it can be further refined


H15.5.607 Indie

Attachments:
find_center_path.JPG (37.9 KB)
find_center_path_v01.03.hiplc (164.9 KB)

  • Quick Links