Bad edges in polygins

   1902   9   1
User Avatar
Member
224 posts
Joined: June 2009
Offline
I am importing some geometry from an obj file, and it is full of small issues that are making geometric processing difficult.

One thing I am struggling with is thin edges, where the edge returns on itself, as in the image.

Is there a good automated way to fix these edges?

In this case, 89 is a bad point and should be deleted.

I have tried polydoctor but could not figure out the right settings.

Attachments:
snip.PNG (10.5 KB)

Patrick
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
best if u could upload the problematic geometry, so ppl don't waste time in solutions that would not work.

The only thing I can think of is checking how many neighbors (neighbourcount vex function) for each point. IF < 2 delete point (pt 89 has only 1 connected neighbor)
But that would not work with an open curve. And again, we don't know what kind of geo you have so it's a little bit a shot in the dark.

Cheers!
User Avatar
Member
648 posts
Joined: July 2005
Offline
yep what Andr wrote,
however it may be better to fix these problems at the source, especially if you need to work with the modeler for a while.
User Avatar
Member
224 posts
Joined: June 2009
Offline
Thanks for your replies. Here it is, attached, I isolated the bad polygon.

I am thinking that probably I need to measure the internal angle, and if it is close to 360, then delete the point?

Attachments:
bad_poly.hipnc (66.6 KB)

Patrick
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
With this particular geo, I think the cheapest way to do is to append a fuse sop and slightly increase the distance parameter.
It's not very procedural, but maybe you do need a procedural solution.

How do you create the geo, inside Houdini?
User Avatar
Member
224 posts
Joined: June 2009
Offline
The geometry is imported from an obj, with 1 million polygons. So the solution needs to be procedural.
Patrick
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
I took for granted that your surface is flat: this solution using using VDB might work with the 1 million polys geo, but probably is not super-efficient/fast.
Anyway it worked with the simple geo you provided, check the attached file.

I would be curios to know better ways to fix it, I tried some wrangling and some boolean without much success.

cheers

Attachments:
bad_poly-1_vdbfix.hipnc (152.9 KB)

User Avatar
Member
224 posts
Joined: June 2009
Offline
I have solved it with a little vex code. For each vertex, I take the dot product of the two vectors, if it is close to 1, then I delete the point. Seems to work fine. See attached.

Attachments:
bad_poly.hipnc (63.4 KB)

Patrick
User Avatar
Member
224 posts
Joined: June 2009
Offline
I think I was using @elemnum in the wrong way in that last solution. When I used it with the big obj file, it cause problems. Here is the fixed version. Now it works fine.

Seems to run very fast, for 877K polygons took less than a second. (It says Last Cook 0.35 ms, but I am not sure if this is the actual execution time.)

Attachments:
bad_poly.hipnc (83.7 KB)

Patrick
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
ah, of course the dot product!
Thanks for sharing your solution. It's very interesting to me as I'm not really used to wrangle with vertices. gg
  • Quick Links