walter Posted November 26, 2021 Share Posted November 26, 2021 Hi guys, does vex intersect() not work with a point and a curve/line? it is not working unless i polyextrude my curve. I am trying to project where the point will be on the curve based on a given normal direction. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 26, 2021 Share Posted November 26, 2021 (edited) Hi Walter, intersect() does work on curves, as well. Just try intersect_all() instead, as it allows setting tolerances. float tol = chf('tolerance'); vector pos[]; int prim[]; vector uvw[]; int hits = intersect_all(1, v@P, v@N, pos, prim, uvw, tol, tol); if(hits != 0){ i@group_hit = 1; v@P = pos[0]; } intersect_all.hiplc Edited November 26, 2021 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
walter Posted November 26, 2021 Author Share Posted November 26, 2021 (edited) 15 minutes ago, konstantin magnus said: Hi Walter, intersect() does work on curves, as well. Just try intersect_all() instead, as it allows setting tolerances. float tol = chf('tolerance'); vector pos[]; int prim[]; vector uvw[]; int hits = intersect_all(1, v@P, v@N, pos, prim, uvw, tol, tol); if(hits != 0){ i@group_hit = 1; v@P = pos[0]; } intersect_all.hiplc i feel so dumb now, i realized my curve was still a surface and i had wireframe mode on all these time. that "ends" node made me realize that ;D thanks for the help! Edited November 26, 2021 by walter Quote Link to comment Share on other sites More sharing options...
vinyvince Posted November 30, 2021 Share Posted November 30, 2021 On 26/11/2021 at 9:00 AM, konstantin magnus said: Hi Walter, intersect() does work on curves, as well. Just try intersect_all() instead, as it allows setting tolerances. float tol = chf('tolerance'); vector pos[]; int prim[]; vector uvw[]; int hits = intersect_all(1, v@P, v@N, pos, prim, uvw, tol, tol); if(hits != 0){ i@group_hit = 1; v@P = pos[0]; } intersect_all.hiplc I was hoping this function solve my issue with the ray but it doesn't look like @konstantin magnus I would like to measure some value , by shooting a ray on the inverse direction of the normal of a 2d shape, like picture bellow. So my idea and expectation before trying was the point will be moved toward the other side and give me a distance. This is what im interested in. but it's not. If I play with attribute blur to jitter unique point and convert line, I get move lines, but still not a result I could use. Any idea guys ? 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.