Jump to content

Sign in to follow this  
Michael Goldshteyn

Automated selection of similar edges

Recommended Posts

So, I created a Python script that given a polygonal object with one or more edges already selected, selects other edges that have lengths that are within some tolerance value (e.g., 0.01) of the currently selected edges.


It can also take the edge lengths sought after from an existing edge selection tag (by name) and then select all edges in a polygonal object that are within a tolerance value of the lengths of the edges in the edge selection.


I am wondering if there is already a way to do this using regular C4D selection tools in R21/S22 and/or a plugin that has this functionality as part of some greater whole, before expanding on the functionality of my script any further.


Any tips or pointers would be greatly appreciated. For now, the script only selects based on edge length similarity, but I could see other features like normal direction, type/size of polygons to which the edge belongs, distance from object axis or a null (allowing for spherical selection), etc..., being additional criteria for the expansion of "similar" edge selection functionality.


I've found this functionality useful for selecting disparate edges around an object that are very similar or identical (in length), but may be dispersed all over the object in space, making selection by hand difficult and time consuming having to shift-click each one individually.


Update: I created and attached a contrived example to demonstrate the functionality described and a use case for it. I know the symmetric origins of the editable polygonal object in the demo are quite visible, but I will leave it to your imagination that this would work as well on any polygonal object with far less, if any, symmetry.

So, basically, you start with an edge selection like the six edges selected near the bottom of the image:


Then after running the script, you get edges of almost equal lengths (within the tiny tolerance I specified of 0.000015 to also be selected all around the object, wherever they happen to be:


Like I said, it's pretty simple right now and only takes the template edge lengths and a tolerance deviation value into consideration, but it could going forward, consider other aspects of the edges and/or polygons they are attached to in determining whether edges qualify as similar and should also be selected.






Share this post

Link to post

If you haven't seen it already, you should probably check out selections suppletives by Code Vonc.  What you are doing there is in a similar area to functionality that offers, but don't think it has a select similar command. I know there are plugins for Max that do this, so I would be surprised if that functionality didn't exist somewhere for Cinema, though can confirm not in the current toolset..



Share this post

Link to post
7 minutes ago, Cerbera said:

If you haven't seen it already, you should probably check out selections suppletives by Code Vonc.  What you are doing there is quite similar to functionality that offers.




That one I am aware of and have it installed, but it's for pattern and poly/point/continuous/skip selection stuff (and for selecting ngons/tris/etc... which is now core functionality in the modeling manager's mesh checking feature set built into recent versions of C4D).


When it comes to edges and especially edge lengths, there seems to be a real shortage of capable free plugins from what I've been able to find.


Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...