It is currently Thu Sep 02, 2010 9:47 pm

Registration
Login Help

Advertise Here

[Plugin] Cleanup (2.0.0) — 09 May 2010

FAQMembersRegisterLogin

[Plugin] Cleanup (2.0.0) — 09 May 2010

Postby thomthom on Wed Oct 21, 2009 6:36 pm

cleanup.png


Features
Cleanup ModelVersion 1.1.0
Plugins->Cleanup->Cleanup Entire Model
Presents the user with a dialog box of various cleanup operations to be perform on the entire model. Especially useful to clean up imported 3D models from other formats.

Cleanup Local Context
Plugins->Cleanup->Cleanup Local Context

About
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: viewtopic.php?f=180&t=10599&start=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! :berserk: ) 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.

Version 2.0.0
  • Supports ThomThom's Menu
  • Persistent preferences.
  • Settings for global and local cleanup synced.
  • Repairs split edges. (Based on Carlo Roosen's Repair Broken Edges)
  • Removes duplicate faces.
  • Fixes duplicate component definition names.
  • Runs Validity Check at the end.
CleanupMenu.png
CleanupModel.png



cleanup_ui.png


Requirements
  • Sketchup 7.1 - You can run it on older versions, but it will not yield a predictable result - you will be warned about this.

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: viewtopic.php?f=180&t=10599&start=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. :berserk:
You do not have the required permissions to view the files attached to this post.
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby Ecuadorian on Wed Oct 21, 2009 6:42 pm

Thank you, man. I have the perfect file to test it. :D
Are you reading signatures? Dude, you need to get out more often.
User avatar
Ecuadorian
 
Posts: 1213
Joined: Thu Jan 15, 2009 10:20 pm
Location: Guayaquil, Ecuador
Name: Miguel Lescano
Operating system: Windows 7 Pro 64-bit
SketchUp version: 7.1

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby thomthom on Wed Oct 21, 2009 6:44 pm

Ecuadorian wrote:Thank you, man. I have the perfect file to test it. :D

A particular troublesome file? Please let me know how it goes. Not sure if I've got it fully tuned in yet.
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby remus on Wed Oct 21, 2009 6:45 pm

Cheers thom, a very useful script.
User avatar
remus
Global Moderator
 
Posts: 7995
Joined: Fri Nov 30, 2007 8:48 am
Location: UK
Name: remus
Operating system: vista
SketchUp version: 7.whatever

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby Ecuadorian on Wed Oct 21, 2009 6:51 pm

:shock: Wow... no more lost faces (as happened with other cleanup scripts), and cleanup is top-notch.
before.jpg

after.jpg


Here it is applied only to the horizontal white borders:
before2.jpg

after2.jpg


You do realize the importance of this script in the history of SketchUp, do you? Thanks again! :thumb:
You do not have the required permissions to view the files attached to this post.
Are you reading signatures? Dude, you need to get out more often.
User avatar
Ecuadorian
 
Posts: 1213
Joined: Thu Jan 15, 2009 10:20 pm
Location: Guayaquil, Ecuador
Name: Miguel Lescano
Operating system: Windows 7 Pro 64-bit
SketchUp version: 7.1

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby thomthom on Wed Oct 21, 2009 6:56 pm

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.)
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby Jim on Wed Oct 21, 2009 7:05 pm

Ack! it doesn't look at materials?

Oh, and thank you! :thumb:
I probably over-simplified that.
sketchup plugins & news blog
Jim
 
Posts: 2875
Joined: Mon Nov 12, 2007 10:13 pm
Name: Jim Foltz
Operating system: XP Pro SP3
SketchUp version: Google Pro 8.0

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby thomthom on Wed Oct 21, 2009 7:07 pm

Jim wrote:Ack! it doesn't look at materials?

Oh, and thank you! :thumb:

No, but that's a very good suggestion.

Ecuadorian did find some issues with some geometry, so I'll push an update when I've gotten around to look at it.
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby thomthom on Wed Oct 21, 2009 7:13 pm

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.
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby Ecuadorian on Wed Oct 21, 2009 7:25 pm

Thanks! I think I now remember what the problem might be, also. The model is scaled a lot. :?
Are you reading signatures? Dude, you need to get out more often.
User avatar
Ecuadorian
 
Posts: 1213
Joined: Thu Jan 15, 2009 10:20 pm
Location: Guayaquil, Ecuador
Name: Miguel Lescano
Operating system: Windows 7 Pro 64-bit
SketchUp version: 7.1

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby thomthom on Wed Oct 21, 2009 7:42 pm

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:

Code: Select all
   # Not coplanar
   # 0.999999999898786
   # 0.999999999901467
   # 0.99999999992968
   # 0.99999999995352
   # 0.999999999959393
   # 0.999999999974808
   #
   # Coplanar
   # 0.999999999917881
   # 0.999999999918562
   # 0.999999999984962
   # 0.999999999999148
   # 0.999999999999408
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby thomthom on Wed Oct 21, 2009 7:42 pm

Ecuadorian wrote:Thanks! I think I now remember what the problem might be, also. The model is scaled a lot. :?

I did notice that - but I exploded it and it still occurs...
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby Chris Fullmer on Wed Oct 21, 2009 8:46 pm

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
Your intelligence will never fully compensate for my stupidity.
Cal Poly Pomona - BS Landscape Architecture
UC Berkeley - Masters of Landscape Architecture
All my Plugins I've written
chrisfullmer.com - Art Blog
User avatar
Chris Fullmer
Global Moderator
 
Posts: 4760
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows Vista
SketchUp version: 7.1x

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby thomthom on Wed Oct 21, 2009 8:48 pm

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...
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

Re: [Plugin] Cleanup (1.0.0) — 21 October 2009

Postby thomthom on Wed Oct 21, 2009 8:49 pm

I think I might have misunderstood this whole DOT product from vectors... will have to look deeper into it.
Thomas Thomassen — SketchUp Monkey
My Plugins
User avatar
thomthom
Global Moderator
 
Posts: 8353
Joined: Tue Nov 13, 2007 12:47 pm
Location: Trondheim, Norway
Name: Thomas Thomassen
Operating system: Windows7/Vista/XP/OSX10.4/10.5
SketchUp version: 6.4&7.1&8 Pro

SketchUcation One-Liner Adverts

by Ad Machine on 5 minutes ago

Get 15% off Lounge-Book using promo Code - SCFLoungeBook
Ad Machine
Robot
 
Posts: 2010

Next

 

Advertise Here

Who is online

Users browsing this forum: Google Adsense Bot, MSN Bot and 1 guest