History Both the Sketchup Importers option too remove coplanar edges and the deletecoplanaredges plugin have given me mixed result. Geometry tend to disappear in some cases. Part of that is due to a Sketchup bug: http://forums.sketchucation.com/viewtop ... 30#p164501 and another part is due to what seem to be some inconstancy with the way Sketchup and the Ruby API deal with numbers. As of 7.1 the first issue appear to have been fixed. (Yay! ) And I have found a work around for the other issue. If you experience geometry to be lost, while using SU 7.1 - please let me know so I can look into it.
If you have geometry selected it will work on those only. Otherwise it will iterate over the current context.
Technical Jabber Prior to SU 7.1 there was a bug where in some cases deleting an coplanar edge, either via Ruby or the Eraser tool, would make its connected faces disappear. See this thread for more info and samples: http://forums.sketchucation.com/viewtop ... 30#p164496 I tried to work around that previously, but the code ended up stupidly complex trying to keep track of all the edges I couldn't erase, and no matter what I did I always ended up loosing geometry, or not managing to remove everything. With this issue fixed in SU 7.1 it's now dead easy; Find'em and Erase'em!
Update — 22 April 2010 New and improved method to detect coplanar faces. No more messing about with tolerances.
Good to see it working on other complex models. I only tried it against one complex one, large triangulated terrain with 80K+ faces. (Though that model had all the potential problems you could run into AFIK.)
Ecuadorian: I had a look at your sample file. I see the issues. I think it's a tolerance issue. I'll have to investigate a little more to tune in the tolerance.
This is strange. When I compare the dot product of various faces, I find an overlap in the return value for faces where you can erase the connecting edge:
Could you take the edge, find its connected faces. Then get the object id for those faces, and get all their vertices positions. Then delete the edge if it is planar. Then test to see if those faces still exist. If they do, move on. If they do not, then rebuild them using their vertices' positions? Painful yes, but maybe useful?
Chris Fullmer wrote:Could you take the edge, find its connected faces. Then get the object id for those faces, and get all their vertices positions. Then delete the edge if it is planar. Then test to see if those faces still exist. If they do, move on. If they do not, then rebuild them using their vertices' positions? Painful yes, but maybe useful?
Chris
I did that kind of stuff in my previous version, prior to 7.1 - wasn't stable. So many cases to take into account. Faces with inner holes etc...
Hi Thomas, I lost a texture from a face in a 61k faces model. BTW what happens when you have coplaner faces with different textures, or images placed on textured faces (say a run on a wood floor). Didn't read all the post, so sorry if already covered.
honoluludesktop wrote:Hi Thomas, I lost a texture from a face in a 61k faces model. BTW what happens when you have coplaner faces with different textures, or images placed on textured faces (say a run on a wood floor).
At the moment it doesn't take into account materials. Only geometry.
Images? You mean an actual Image entity (It says "Image" in Entity Info when you select it?)
honoluludesktop wrote:Well, I often import images (as images, not textures), and place them on textured faces.
They would be ignored. However, I do plan on adding an option for it to respect the material of the geometry. Just got to sort out some other issue first.
Jim wrote:Ack! it doesn't look at materials? Oh, and thank you!
honoluludesktop wrote:Hi Thomas, I lost a texture from a face in a 61k faces model. BTW what happens when you have coplaner faces with different textures, or images placed on textured faces (say a run on a wood floor). Didn't read all the post, so sorry if already covered.
Option to respect materials applied added. On by default.
Ecuadorian: I adjusted the tolerance so it shouldn't loose any geometry on the model you sent me. Hopefully it won't loose anything in other models either. But there is some cases where which can be removed is left behind. I hope to address this. I figured it's best to be defensive than aggressive.