Identification method
-
Hi,
I'm looking for some help. I Would like to code a little ruby script to identify all closed space in my model (like solid group).
I don't see any way to do that without test all faces and group them each other and test if group is solid.I have done 3 pictures my problem, hope u can give me some advice.
Thank you in advance.
-
@oasix said:
I don't see any way to do that without test all faces and group them each other and test if group is solid.
This sounds like a good answer to your own question.
In other words, entities must be grouped, (by the user or your plugin,) in order to become a manifold solid.
So anything that is not a group can be ignored, speeding up the process.
solids = Sketchup.active_model.entities.grep(Sketchup::Group){|g| g.manifold? ? g : nil}.compact!
Also a
ComponentInstance
can be a manifold solid. -
Ok, thanks.
But don't you think that this method would be too long/loud for user ? -
It shouldn't be too slow. Try it out, if it is too slow, then post back with the problem. But from what you've shown, processing won't even be noticeable.
-
I think he means that he wants a user command to select manifold solids.
Perhaps thomthom's SelectionToys plugin can be modified to add a "manifold" filter ?
-
it will be great but i'm trying to do it on my own.
I have problem to find an order to group faces. If the order is wrong it can't become an manifold solid.
Any suggestion ? -
(1) Please go to the User Control Panel and fill in the statistics so we can better know about your level and use of SketchUp.
(2) Follow the Guide to learn standard Ruby basics, then simple SketchUp Ruby projects, before attempting advanced projects.
If you are attempting to program manifold solid features with or for the SketchUp Free edition, then you will need to be a very advanced programmer.
Look at the code that others have done in this area first. (It can save you a lot of time.)
Advertisement