thomthom / solid-inspector

Inspect and repair solid groups and components in SketchUp.
https://extensions.sketchup.com/en/content/solid-inspector%C2%B2
MIT License
18 stars 2 forks source link

False External Faces were detected #2 #54

Open palexvs opened 5 years ago

palexvs commented 5 years ago

False External Faces were detected: test.zip image

Maybe it could be fixed by adding

next if edge.vertices.map(&:position).any? { |pt| face.classify_point(pt) == Sketchup::Face::PointOutside }

here https://github.com/thomthom/solid-inspector/blob/2.4/src/tt_solid_inspector2/shell.rb#L368

Have not had time to check yet

Great plugin! Thanks!

thomthom commented 5 years ago

Hmm.. that's and interesting case. I'd have to look closer to see what cause it to get confused.

As for the suggested fix, I'm not seeing how that would really do anything. That section of the code is looping over the edges in the face. The vertices in that line of code would all belong to the face - and should not be "outside" the face.

palexvs commented 5 years ago

The roof face has 3!! internal loops instead of 1 as I would expect. And one loop is not on a face almost, it confuses your algorithm: image

This code should help sometimes, but not always:

next if edge.vertices.map(&:position).any? { |pt| face.classify_point(pt) == Sketchup::Face::PointOutside }

image

thomthom commented 5 years ago

hmm... that might indicate that the loops for the face isn't as they should be. This seems like a SketchUp bug to me. I'll file a bug report.

I've run into models before where the loops haven't been correct - edges referring to the same face multiple times. In these cases all bets are off for any sane analysis by extensions.