Quantcast
Channel: Grasshopper - McNeel Forum
Viewing all articles
Browse latest Browse all 39513

Selection Filter

$
0
0

@clay.budin wrote:

Hi,

Cross-posting from a thread originally in Rhino for Windows:

Could someone show me how I would write a script to select the “densest” meshes:

  1. Start with nothing selected
  2. Loop over all visible meshes in the scene
  3. For each mesh, compute its bounding-box volume (or perhaps some other parameter like surface area), and the number of triangles/faces/vertices it contains
  4. For the current mesh compute the “density” as the ratio of the number of tris/faces/verts to the volume/surface are.
  5. If that density ratio is above a certain given parameter, select the mesh, otherwise don’t select it.
  6. At the end, report the number of selected meshes.

So, this would operate a lot like the Select->Select Small Objects tool (which is great, by the way). It would be an extension/generalization of that sort of functionality that I could customize to my needs. Generally speaking, the meshes that benefit most from ReduceMesh tend to be the smallest and/or have the most tris/faces/verts to begin with.

I don’t know exactly how scripting works in Rhino, but I would prefer if this ran without the need for any add-on plugins (like grasshopper), which would have to be purchased separately. Python would be perfect.

Edit: I now know that Grasshopper comes with Rhino, so that would be fine too.

Thanks,
Clay Budin
NYC

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 39513

Trending Articles