Jump to content
Sign in to follow this  
Entropy

Perpenticular World Space Tangent on Surface

Recommended Posts

Hello 
is there a more efficient way to calculate the world space tangent on a surface ?

the method i use in the attached file seems limited as it uses boolean sections and polyframe to transfer the tangent to the surface
any ideas on how to improve 


thanks in advance


 

perpenticular_tangent.hipnc

Share this post


Link to post
Share on other sites

Also i just noticed that there are problems with the initial direction of the tangents
after the boolean operation some curves have their tangent direction reversed

is there some easy way to clockwise all the curves ?

thanks

Share this post


Link to post
Share on other sites

that is ridiculously simple thanks a lot @petz

any idea why the boolean operation reverses randomly the curve direction 
even when the same object copy is used to intersect ?

i use various meshes not just planes to cut - intersect surfaces with the boolean operation 
and create the surface tangents perpendicular to the curves
but there are inconsistency with the extracted curves
is there any easy way to find those problematic curves and reverse them ?

thanks in advance
 

Edited by Entropy

Share this post


Link to post
Share on other sites

due to the use of "remove shared edges" in the divideSop you got always two coincident polygons for every section. you need to delete duplicates and then make sure the normals of remaining prims are pointing into the same direction.
instead, you could also set the output of the booleanSop to "seam" and check the curve direction based on point neighbours ...

hth.
petz

Share this post


Link to post
Share on other sites

i had no success determining whether or not a curve has its points ordered clockwise or anticlockwise
 

float sum = 0.0;
for (int i = 0; i < i@numpt; i++) {
   vector v1 = point(0,"P",i);
   vector v2 = point(0,"P",i+1) % i@numpt;
   sum += (v2.x - v1.x) * (v2.y + v1.y);// * (v2.z - v1.z);
}

setprimgroup (0, "reverse", @primnum, 0, "set");
                            
if(sum > 0){
  setprimgroup (0, "reverse", @primnum, 1, "set");
}

 

obviously it is not right the above solution is for a 2d curve
any idea for the 3d equivalent  ?
 

Edited by Entropy

Share this post


Link to post
Share on other sites

Hi satoru thanks for your reply
but unfortunately this is not working for my case
i uploaded a new file to illustrate the issue
i use polycut the result is the same as with boolean operations
the unshared  edges always produse two coincident polygons as petz said

 

perpenticular_tangent_polycut.hipnc

Edited by Entropy

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×