Jump to content

Vex intersect with point against curve


walter

Recommended Posts

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 by konstantin magnus
Link to comment
Share on other sites

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 by walter
Link to comment
Share on other sites

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 ?

 

image.thumb.png.6d5732134dca0ccd0ee082c6c86e45c8.png

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...