api-issue-tracker
api-issue-tracker copied to clipboard
"add_face" Creates Extra Edge
When creating a face with an edge that is in exactly the same place as two shorter edges, a new long edge is used instead of using the existing short edges. This results in geometry that is non-solid.
Here is the code to reproduce the issue.
def clear_model
Sketchup.active_model.entities.clear!
Sketchup.active_model.definitions.purge_unused
end
def test_non_solid
d = Sketchup.active_model.definitions.add("Non-Solid")
Sketchup.active_model.entities.add_instance(d, IDENTITY)
d.entities.add_face([5, 0, 10], [5, 10, 10], [0, 10, 10], [0, 0, 10])
d.entities.add_face([5, 0, 10], [5, 10, 10], [10, 10, 10], [10, 0, 10])
d.entities.add_face([0, 0, 10], [0, 10, 10], [0, 10, 0], [0, 0, 0])
d.entities.add_face([10, 0, 10], [10, 10, 10], [10, 10, 0], [10, 0, 0])
d.entities.add_face([0, 10, 10], [10, 10, 10], [10, 10, 0], [0, 10, 0])
d.entities.add_face([0, 0, 10], [10, 0, 10], [10, 0, 0], [0, 0, 0])
d.entities.add_face([0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0])
end
def test_solid
d = Sketchup.active_model.definitions.add("Solid")
Sketchup.active_model.entities.add_instance(d, Geom::Point3d.new(0, 20, 0))
d.entities.add_face([0, 0, 10], [0, 10, 10], [0, 10, 0], [0, 0, 0])
d.entities.add_face([0, 10, 10], [10, 10, 10], [10, 10, 0], [0, 10, 0])
d.entities.add_face([10, 0, 10], [10, 10, 10], [10, 10, 0], [10, 0, 0])
d.entities.add_face([0, 0, 10], [10, 0, 10], [10, 0, 0], [0, 0, 0])
d.entities.add_face([0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0])
d.entities.add_face([0, 0, 10], [0, 10, 10], [5, 10, 10], [5, 0, 10])
d.entities.add_face([5, 0, 10], [5, 10, 10], [10, 10, 10], [10, 0, 10])
end
def do_tests
clear_model
test_non_solid
test_solid
end
Here are the results:

I've noticed this issue for several versions of SU. Some 3D programs I worked with could export a 'model' as a plane list, each defined by its vertices.
Some would minimize the number of vertices, so in the cube shown above, the top would be two planes, and the facing side, being a square, would have four vertices.
I wonder, does Fix Model fix anything? Or does it think everything is just fine?
Clicking Info shows this message:

Clicking Fix All shows this:

Its been a while...
I wonder, does Fix Model fix anything?
I did write code to show the problem edges. So I assume not.
'could not be automatically fixed'
I think I did the above because I concluded that it required 'user intervention', iow, code couldn't fix them. Right now, I don't recall why.
EDIT: The external programs I was working with had issues with what I'd call 'donuts' and 'sliced donuts' (various forms of a face being bounded by concentric edges), that may have been part of the reason I couldn't fix them in code...
@NeilBurkholder - I mean from Model Info > Statistics. SketchUp's own model validity check.
No

Logged as: SKEXT-2916
Hi NeilBurkholder,
As part of reproducing old bugs, I encountered this one, looks like this has been fixed in versions SU2023.1 , SU2024.0 and SU2025.0 Could you please confirm the same?
Thank you