[Plugin] CleanUp

Re: [Plugin] Cleanup (1.0.1) — 22 October 2009

Postby thomthom » Thu Oct 22, 2009 1:37 pm

Ecuadorian wrote:Sounds nice, Thom!
Perhaps you could give the user two or three threshold options.

As for the model you sent me, you won't have much luck reducing the tolerance because of the threshold where the edges can be removed overlaps. That model is a good example of a troublesome model - I'll try and get some Google heads to comment on what's going on.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Muchas gracias thomthom

Postby ideas_arte » Fri Oct 23, 2009 6:43 am

incredibly helpful, thank you very much :D
0

ideas_arte 
 

Re: [Plugin] Cleanup (1.0.1) — 22 October 2009

Postby notareal » Fri Oct 23, 2009 8:45 am

:thumb:
0
Welcome to try Thea Render, Thea support | kerkythea.net -team member

notareal 
Thea Render Support
Thea Render Support
 

Re: [Plugin] Cleanup (1.1.0) — 23 October 2009

Postby thomthom » Fri Oct 23, 2009 1:10 pm

Updated once again.
Now has a dialog window where you can set various cleanup operation to be run on the entire model. Settings are persistent per session only.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.1) — 23 October 2009

Postby thomthom » Fri Oct 23, 2009 2:08 pm

:oops: minor update to control whether to erase lonely edges or not - and corrected the purge order.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Fri Oct 23, 2009 2:33 pm

:oops: :oops: Yet another bug fix.

Ok! Enough! Weekend! :berserk:
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby plot-paris » Fri Oct 23, 2009 3:50 pm

fantastic plugin, Thom,

I already had my shortcut Ctrl+Shift+D assigned to the first cleanup-script. but the new one seems to be a lot more powerful. already worked well on models that lost lots of faces when cleaned up in the past.

about the threshold: do you think instead (or in addition maybe) to the manual input, would it make sense to have predefined settings, like 'high', 'medium' and 'low'?
cause adding nines to the 0.9999 isn't very intuitive... on the other hand. might be a bit too much... :?

thanks again for the plugin. cleanup is one of the tools that I use most. couldn't live without it! :sketchstatic:
have a nice weekend!
0
User avatar
plot-paris 
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Fletch » Fri Oct 23, 2009 5:43 pm

this looks killer, ThomThom... sure would have helped a lot with that 3ds Classroom model... I just basically re-built it from scratch instead :roll:
0

Fletch 
Twilight Render
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby majid » Fri Oct 23, 2009 7:42 pm

:sketchstatic: :thumb: :thumb:
0
User avatar
majid 
Top SketchUcator
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Fri Oct 23, 2009 9:33 pm

plot-paris wrote:about the threshold: do you think instead (or in addition maybe) to the manual input, would it make sense to have predefined settings, like 'high', 'medium' and 'low'?
cause adding nines to the 0.9999 isn't very intuitive... on the other hand. might be a bit too much... :?


I'm trying to get hold of feedback from Google which can shed some light on how things works under the hood in SU so I can 100% reliably erase all edges that are coplanar. I want to avoid having to set this tolerance completely.

But until then we have this tolerance. But I do plan on eventually implement a webdialog that will provide a better UI this this. More specifically, giving a better description of the various options as I don't feel the current UI is quite clear on what it do. With webdialogs I can add sliders etc. Will have to see though. I want to try to get feedback from Google before I invest time in that.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby rv1974 » Sun Oct 25, 2009 8:30 am

Tom can code! :D
0

rv1974 
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Mon Oct 26, 2009 1:01 pm

I've been testing more models. The tolerance required seem to vary from model to model. At the latest model I tested I had to remove 4 digits from the tolerance to remove all coplanar edges. What's odd is that in other models the same tolerance would cause missing geometry...
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Mon Oct 26, 2009 1:07 pm

The model I tried it on has a Sandbox generated terrain and a Revit -> FBX -> 3DS -> SU imported model. I had to lower the tolerance to clean up the Revit model, but the sandbox tool lost some faces... I can't make sense of there numbers I get...
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby jetlounge » Mon Oct 26, 2009 2:18 pm

You are the man!!
Thanks a lot...
0

jetlounge 
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby kwistenbiebel » Mon Oct 26, 2009 3:12 pm

Thank you Thom.
This will come in handy to clean up imported files from Rhino's sloppy .3ds/SU exports.
Rhino has the tendency to triangulate each and ever surface at least twice and I always had trouble getting rid of those coplanar edges.
Will be trying the plugin tomorrow at work. Thanks :thumb:
0

kwistenbiebel 
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Ecuadorian » Mon Oct 26, 2009 6:34 pm

Kwisten, have you tried
Rhino -> MOI -> SketchUp?
MOI uses the same file format as Rhino, and I've read it exports geometry to SketchUp in a much cleaner way then Rhino.
0

Ecuadorian 
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Panga » Tue Oct 27, 2009 1:17 pm

I discover this script today, damn...it's so helpfull !!! I spent so many hours to clean up my models... Thanks a lot.
0

Panga 
Premium Member
Premium Member
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby remus » Tue Oct 27, 2009 3:11 pm

This scripts also very useful for cleaning up subd smooth models where youve creased edges :thumb:
0

remus 
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Fletch » Wed Oct 28, 2009 2:07 pm

ThomThom,
just ran the "delete coplanar edges" function from SU and got a crazy message in SketchUp with an ACAD file sent to me from the States...

THEN I ran your cleanup on it, and this scrip was :berserk: like :enlight: I mean like so :fro:

you get a :sketchstatic: and a couple :D :D ok, and one more :D
It did in 5 seconds what would have taken half an hour!

Thanks
0

Fletch 
Twilight Render
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Wed Oct 28, 2009 2:38 pm

Ouch! That's a nasty error message! Don't think I've seen that one before. The only ones I've seen have only said "Don't Panic" - this seem to say the opposite!
I'm glad that my plugins didn't cause that.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Jim Smith » Wed Oct 28, 2009 3:22 pm

Thom,

Thank you for this ruby. I have been working on a huge model - 120MB - for a downtown facade restoration program. Lots of geometry and textures. I tried the script on a previously saved model to test it and nothing was missing except the junk lines etc. per your specifications. Tried it on the final model with the same fine results. Didn't dramatically reduce the size - 123MB down to 120MB but every bit helps.

Thanks again.
0
"Out of clutter find simplicity,
from discord find harmony,
In the middle of difficulty lies opportunity"
Albert Einstein
User avatar
Jim Smith 
Premium Member
Premium Member
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Wed Oct 28, 2009 3:47 pm

Jim Smith wrote:I tried the script on a previously saved model to test it and nothing was missing except the junk lines etc. per your specifications.

If you use the latest version you can now make it not erase lonely edges. Untick the Erase Lonely Edges item in the menus. And you also have a option for this for the tool that runs over your entire model

As for file size - what contributes the most is textures and backgrounds. I was thinking the other day that I'd write a little tool that'd list the model's materials along with it's texture sizes so you could quickly find materials with large textures.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby remus » Wed Oct 28, 2009 6:09 pm

AdamB's already written a similar tool caled Goldilocks, although it judges the size of your textures by their relative position to the camera, i.e. large close textures are marked as good, large textures far away are bad etc.
0

remus 
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Fletch » Thu Oct 29, 2009 10:24 pm

I was using your cleanup tool on a CAD model sent to me by a firm I work with... it has a bunch of Groups... they are exact copies of each other in CAD, but in SU, it doesn't 'see' that they are exact copies.

now... I was thinking... I can select all the groups that I know are supposed to be instances of a component... I could manually convert each to a component, then replace them all with the good one...but there's no tool that automates the process in my case with a CAD model import:

I choose 60 similar "group" objects,
Activate "Groups to Component tool" (G2Ctool)
G2Ctool says "I know these each should all be instances of the same component"... and then the tool would ask... "Select the desired object to be the base component" ... then I would click one of the 60 group objects I clicked before
and then the tool would ask... "Enter new component name"
then the tool would turn each one of those groups into some nebulous numbered component, then it would replace all of them with that first component with a new name.

that would, IMHO, be the "missing link" tool in your cleanup tool arsenal. 8-)
0

Fletch 
Twilight Render
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Thu Oct 29, 2009 10:55 pm

Yea, I've been thinking of something like that. Get that kind of stuff importing from revit. But the problem there is that the axis, insertion point, is different. So I can't just go by that. I'd have to compare the geometry...
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Chris Fullmer » Fri Oct 30, 2009 12:24 am

I think about this too from time to time. And one of the problems is that it might be easy enough if all components were inserted with the same rotation, but it gets tricky if all components are rotated differently.

To help compare, you could take all edges from comp1 and compare its length against all edge lengths in comp 2. They should have all the same amount, of the same lengths if they are possibly the same component. That would help determine if you should continue comparing the two components.

Also, you could compensate for components that are the same, with different scale factors by the same idea. Get all edge lengths for each. Then take each comps shorteest edge, and scale it up to be the length of the other comps smallest edge. Get that scale factor, and scale all edges the same. THen compare to see if the newly scaled lengths all equal the target component's edge lengths. And voi-la, theres a way to test for scale differences.

Just some ideas while they were still in my mind.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Fri Oct 30, 2009 12:27 am

I was thinking of taking the source object and start of with an entity, compare it and it's connected faces and edges (length and angle betweens) and then iterate through the target object and look for matches. Once a match is found, iterate to next entity in the source and see if it compares to any of the potential next entities in the target.

...too complicated...?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Chris Fullmer » Fri Oct 30, 2009 12:45 am

I think something like that is what you would end up having to do, but I was imagining you could cut out a lot of groups by first testing them with whay I was suggesting. If for example, you have 100 groups. And you don't know if they are possibly same components or not, you could test them based on their entity number.

All groups with the same amount of entities, then get tested together for the same amount of edges, same amount of faces. Those that still have matching numbers move on to the next round of comparisons. Maybe we are down to 10 that have the same amount of entities, same number of edges and faces.

Then compare those 10 based on all edge lengths. If their edge lengths don't match up, maybe try adjusting the scale using them method I outlined. Then if by chance you end up with any components that match entity.length, and edge amounts, and face amounts, and their edge lengths all match, then maybe you have a good chance of them being the same component.

Then at that point, I was thinking you could look for any edge length that only has 1 identical edge length match in the other group. Then you have a starting point for aligning axes, using the identical edges. Just take one component and transform it to its one edge would be aligned to the other edge. Then you could compare all their point3d positions and see if they all are the same.

Of course, that would all be done with temporary groups or proxy Point3d objects or something.. The original group would need to remain unaffected. But I think you could identify groups that appeared to be identical based on entity counts, edge lengths, etc. Then take those and try to aligned them, you could then just test their points against eachother. And if their points are identical, you've got a match!

That is how I would forsee it happening. What I like about this method is that there is no looping through the model looking for angles. Just compare point positions.

Just a thought,

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby Chris Fullmer » Fri Oct 30, 2009 12:48 am

wanna connect to my notepadd++ and work on it? :) PM me

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: [Plugin] Cleanup (1.1.2) — 23 October 2009

Postby thomthom » Fri Oct 30, 2009 12:51 am

That's be cool - to make some real use of that Np++ feature! But I'm off to bed. Should have been there least an hour ago.

How many hours behind GMT are you?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: Alexa Bot, je3480, leonardovit, nock0227 and 9 guests

Visit our sponsors: