DBaciu Posted March 14, 2013 Share Posted March 14, 2013 See the image. The one who can help me with this issue will have a beer from me Quote Link to comment Share on other sites More sharing options...
Annon Posted March 14, 2013 Share Posted March 14, 2013 What have you tried so far? I'm not entirely sure off the top of my head but I'd have a go at: http://www.sidefx.com/docs/houdini12.1/nodes/vop/neighbour And by deduction post vop I'm sure you'll be able to get what you want. Quote Link to comment Share on other sites More sharing options...
DBaciu Posted March 14, 2013 Author Share Posted March 14, 2013 I haven't tried much so far because I'm busy , I hoped someone already know the answer to this. Quote Link to comment Share on other sites More sharing options...
acey195 Posted March 15, 2013 Share Posted March 15, 2013 Well you could in vop, loop over all the connected points and use atan2 to check the angle between two segments, the one with the smallest (positive)angle difference is the next segment I guess. Quote Link to comment Share on other sites More sharing options...
pclaes Posted March 21, 2013 Share Posted March 21, 2013 Well you could in vop, loop over all the connected points and use atan2 to check the angle between two segments, the one with the smallest (positive)angle difference is the next segment I guess. Would this be true in a 3d space, not just 2d plane? (think a fold in a geometry) - the folded angle might be less than the connected angle. Otherwise a nice solution. I would go with stepping along the neighbors (neighbour vop). And trying to find the neighbours that both point 1 and point 6 have in common. The snag is point 34 rather than point 6, so you would have to look up the neighbour of point 34 and check if its' neighbours contain a point shared by the originals. In essence you are walking along the edge till you find a point that they both have in common. In order to check if a point is a 'T-split' point or an unconnected point, you can count the number of neighbours. Quote Link to comment Share on other sites More sharing options...
acey195 Posted March 21, 2013 Share Posted March 21, 2013 (edited) Would this be true in a 3d space, not just 2d plane? (think a fold in a geometry) - the folded angle might be less than the connected angle. Otherwise a nice solution. Since its for a roof, it could easily treated as a 2d plane, just neglecting the y coordinate. (like the picture) If you want to do a true 3d next connection check, just replace atan2 with a dot product of the normalized vectors of the connections. eg: Dot(Normalize(point9-point1),Normalize(point6-point1)) is smaller than: Dot(Normalize(point9-point1),Normalize(point6-point21)) Edited March 21, 2013 by acey195 Quote Link to comment Share on other sites More sharing options...
DBaciu Posted March 22, 2013 Author Share Posted March 22, 2013 Well yeah, thank you both. Indeed, like Acey said, the y coordinate can be ignored in this case. I went with the dot product in the end, It felt better suited for the task for a number of reasons. Also I felt that the atan2 solution is less accurate. Working on this thing I learned that it's better not to test if some value is equal with 0 but if is smaller than 0.0001. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.