[Plugin] fixSolid v1.7 - updated 20/10/2012
-
This Plugin try to fix problems with groups that suppose to be solids but don't show up like a solid in SU.
fixSolid fix the following problems:
* heal missing faces
* remove single edges
* remove separate faces
* remove edges between coplanar faces
* remove innerfaces
* remove all edges with only 1 face connected (RISKY FIX)Usage:
- Select solid
- Right-Click Context-Menu. If the solid is broken the option 'FIX SOLID' is present. If the option isn't present there are no problems with he solid.
- Select 'FIX SOLID'
- You can set two options:
- Risky fix: if you choose a risky fix it's possible that a part of the solid wil be deleted. This action can be undone with the normal SU undo function. The risky fix try to fix all problems, the normal fix only fixes problems with no risk.
- Fix coplanar faces: If you choose no, the edges between coplanar will not be removed.
[mod=:3vz6630k]%(#FF0040)[**NOTE:
A newer version [posted under the OP's new login] is available here...**]
http://sketchucation.com/forums/viewtopic.php?p=436001#p436001
TIG[/mod:3vz6630k]
-
No feedback?
-
Nice plugin.
Got a couple of notes:
-
It's advisable to wrap your plugin into a module and use module variables instead of global variables - this ensures there will be no conflict with other plugins.
-
Detecting edges between co-planar faces: You are using this:
if faces[0].normal == faces[1].normal then
I used that for CleanUp, but I ran into issues where it's either erase edges between non-coplanar faces or leave some edges that should have been erased in some cases. As it turns out, the correct way - according to the Googler I spoke to - is to take all the vertices of the two faces you compare and check if they all lie on the same plane. -
e.typename == "Edge"
-.typename
is very slow because you do string comparisons. Instead, compare it's class:e.is_a?( SketchUp::Edge )
-
-
hi Guy,
I'll give it a try...
it's good to see another solid/manifold ruby
over the next week I should get some time to give you feedback, I'm on a mac so sometimes I have varying results to pc's
john
-
Looks like a good plugin. Will give it a try as it progresses with TT's suggestions.
-
thanks Guy, for the plugin, but is it only for SU 8?? can not see it in the plugin menu? im using SU 7.1
regards,
-
That's because solids had not been included in SU 7 and are only available since SU 8.
-
@pherim said:
That's because solids had not been included in SU 7 and are only available since SU 8.
Should be able to work anyway. There is not difference in the geometry, it's just that SU8 knows how to recognize solids.
-
@thomthom said:
@pherim said:
That's because solids had not been included in SU 7 and are only available since SU 8.
Should be able to work anyway. There is not difference in the geometry, it's just that SU8 knows how to recognize solids.
The plugin works only on SU 8, because the function i use the check if it's a solid is a new function in v8.
-
@thomthom said:
Nice plugin.
Got a couple of notes:
-
It's advisable to wrap your plugin into a module and use module variables instead of global variables - this ensures there will be no conflict with other plugins.
-
Detecting edges between co-planar faces: You are using this:
if faces[0].normal == faces[1].normal then
I used that for CleanUp, but I ran into issues where it's either erase edges between non-coplanar faces or leave some edges that should have been erased in some cases. As it turns out, the correct way - according to the Googler I spoke to - is to take all the vertices of the two faces you compare and check if they all lie on the same plane. -
e.typename == "Edge"
-.typename
is very slow because you do string comparisons. Instead, compare it's class:e.is_a?( SketchUp::Edge )
ThomThom,
- How can i wrap my plugin in a module?
- OK -> v1.4
- I tried to switch .typename == "Edge" but then I get errors, i also can't find info about the .is_a? function?
regards,
Guy
-
-
@unknownuser said:
3.can't find info about the .is_a? function?
http://ruby-doc.org/core/classes/Object.html#M000373 -first result after search on google
-
@unknownuser said:
e.typename == "Edge"
-.typename
is very slow because you do string comparisons. Instead, compare it's class:e.is_a?( SketchUp::Edge )
[/quote]
What kind of error and what did you switch to?As for modules:
http://ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html
http://forums.sketchucation.com/viewtopic.php?f=180&t=12423#p89313Many other useful links in this sticky at the Developers section:
http://forums.sketchucation.com/viewtopic.php?f=180&t=10142 -
@thomthom said:
e.typename == "Edge"
-.typename
is very slow because you do string comparisons. Instead, compare it's class:e.is_a?( SketchUp::Edge )
What kind of error and what did you switch to?
As for modules:
http://ruby-doc.org/docs/ProgrammingRuby/html/tut_modules.html
http://forums.sketchucation.com/viewtopic.php?f=180&t=12423#p89313Many other useful links in this sticky at the Developers section:
http://forums.sketchucation.com/viewtopic.php?f=180&t=10142ThomThom,
The module works, but when I recplace the .typename with the .is_a? I get the following error:
Error: #<NameError: uninitialized constant FixSolids::SketchUp>
(eval):373
(eval):318:in `call'
(eval):318regards,
Guy
[mod=:2660fdfj]%(#FF0040)[**NOTE:
A newer version [posted under the OP's new login] is available here...**]
http://sketchucation.com/forums/viewtopic.php?p=436001#p436001
TIG[/mod:2660fdfj]
-
Sorry - I made a typo. It's
Sketchup
- notSketchUp
- the thing is case sensitive. -
Btw, here's some stats to how slow
.typename
is compared to.is_a?
http://forums.sketchucation.com/viewtopic.php?f=180&t=19576&view=unread#p162235
In case you where curious. -
@thomthom said:
Sorry - I made a typo. It's
Sketchup
- notSketchUp
- the thing is case sensitive.Thanks!
-
@unknownuser said:
The plugin works only on SU 8, because the function i use the check if it's a solid is a new function in v8.
thanks for your confirmation
-
respect ! where thomthoms inspector was heading I presume.
-
@unknownuser said:
@thomthom said:
@pherim said:
That's because solids had not been included in SU 7 and are only available since SU 8.
Should be able to work anyway. There is not difference in the geometry, it's just that SU8 knows how to recognize solids.
The plugin works only on SU 8, because the function i use the check if it's a solid is a new function in v8.
You could use the method I use with Solid Inspector - check that all edges have two faces connected. Then it'd work on older versions. Of course for SU8 and newer you want to use the built in version that's very quick.
-
Nice plugin. It could be very useful. I tried it on a model that someone sent to me the other day. It fixed a few things in one component but still left errors. There were a lot of errors in that component to begin with and it certainly would reduce the time required to manually fix it. Unfortunately the plugin doesn't always seem to recognize that a component is not solid. At least it doesn't recognize that the component in the attached SKP is not solid although you can easily see several problems that keep it from being considered solid.
Advertisement