Jump to content

[SOLVED]Removing InLine Points?


Atom

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
Link to comment
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
Link to comment
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 4
Link to comment
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
Link to comment
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
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...