Jump to content
Sign in to follow this  
Atom

[SOLVED]Removing InLine Points?

Recommended Posts

Does anyone have any modeling tips to fix up a bad boolean cut?

Basically I am trying to convert a hand drawn shape into an all quads polygon result. So I boolean subtract the extruded outline shape from a basic grid. This does give me a mostly quads output but there are stray points along the edges that need cleaned up.

Untitled-1.jpg

Untitled-2.jpg

Edited by Atom

Share this post


Link to post
Share on other sites

Yeah, I did try that and it does not work on my particular geometry.
I also tried Fuse which does work, but gobbles up other valid points as well.

 

Maybe some magic VEX code is needed that can isolate those lone points?

Edited by Atom

Share this post


Link to post
Share on other sites

Hi there!

In your case that might be a solution. It remove point if the angle is more than a threshold and as 2 neighbours (border in your case).

int nn = neighbourcount(0,@ptnum);
@dot;
if(nn == 2)
{
    int Lp[] = neighbours(0, @ptnum);
    vector pos1 = point(0,"P",Lp[0]);
    vector pos2 = point(0,"P",Lp[1]);
    pos1 = normalize(pos1-@P);
    pos2 = normalize(pos2-@P);
    float dot = dot(pos1,pos2);
    @dot = dot;
    if(abs(dot)>0.995) //0.995 is the angle threshold
    {
        removepoint(0,@ptnum);
    }
}

I hope it will do the trick for you,

Gab. 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Gabriel. That gets about 95% of the problem points. In the GIF I am turning on and off the attribute wrangle with your code.

remove_inline_points.gif.4657b7d93d91e106b99e7181357ef42b.gif

 

When I zoom into look at the final problem point I notice that it is essentially a small triangle. Do you have any code that might detect small triangles for removal?

Untitled-1.jpg

Edited by Atom

Share this post


Link to post
Share on other sites

Actually fuse with a smaller distance picks up those really close small triangles. Then follow that up with your code in the attribute wrangle and it looks like a working solution. The only side effect seems to be that some of the quads are slightly slanted.

Untitled-1.jpg

Edited by Atom
  • Like 1

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  

×