[Req] Random Component/Group
-
Could anyone create a plugin that will make random groups of specified geometry, and possibly groups of only connected faces & lines?
-
Hi Chris, I've already got a similar script and I want to make sure its not what you're asking for.
Imagine you have a 20 circles drawn, each not touching eachother or anything else. 20 separate circles. Run my script and it will find the first entity in the model - an edge or a face, then it selects everything connected to that entity and groups all of that. So it finds the first edge, and then grabs all edges and the face and turns the entire circle into a group. It then moves on to the next ungrouped entity int he model and keeps going until all loose geometry is grouped.
Is that what you are looking for?
Or are you thinking more like this:
Say you have a sphere. You want a script the will take the first entiy, a line or a face, end then select a few connected faces and group those. Then move and do the same again, maybe with more or less faces in the next group. So in the end your sphere, a single object, gets sliced up into a series of groups. (which I'm guessing would be perfect for exploding a sphere into chunks in SP?)
Anyhow, I already have version 1 written and its called loose2groups.rb. #2 could be done in a few minutes if you'd like.
Chris
-
I'm thinking about the 2nd method I listed above. I can think of a few ways to randomize splitting up the geometry into groups. I was hoping for some more info from you about what you are trying to use it for.
One option is that it could look at a faces and then keep adding neighboring faces until the square area of the faces is somewhere in certain range. Helpful so you can sort of guage the size of groups.
Another would be just tell it how many faces to add per group. It could min.max value. So a minimum of 5 faces and maximum of 20.
Both of the above methods ssume that you don't have many loose edges without faces. It would be easiest to write it to sort of ignore loose edges or just group them with thmeselves. So I'll probably do that at least in the first round. If this is even what you had in mind for the script.
Chris
-
#2. If possible, can geometry be placed where the split occurred to fill the gap, and could it possibly be convex?
-
The way I'm seeing it, there is no gap. Maybe could make a picture explaining what you mean with that?
I have a feeling you're looking for something much more complex than merely splitting geometry up into random groups. But i'd like to see a diagram explaining what you're imagining.
I'm thinking maybe booltools or something like that might be along the lines of what you need.
Chris
-
Well, let's say we have an open face, which are not coplanar. i was thinking that the concave side could be made convex by bridging the endpoints with geometry.
Example:
-
Oh yea, that is what I thought you meant. Sorry, that is beyond the scope of what I could write easily.
Chris
-
Well, I don't need that. it would probably slow down the simulation in sketchyphysics.
-
Would it be possible to just write a script that selects only outer edge lines, and then uses .find_faces to cover them?
Advertisement