GetObject() where GeometryFilter = EdgeFilter returns duplicate edges

If you do a mouse drag selection (rectangular selection) over BrepEdges, edges will be selected once for every face that they touch. This is not an intuitive result. Maybe there is a good reason for this to happen, but for me it just caused bugs.

Maybe Rhino devs would appreciate this feedback.

Best,
Nick

Hi @Nick_Drian, can you post some example code ? Which language do you use ?

_
c.

C#:

            m_Getter = new GetObject();
            m_Getter.GeometryFilter = ObjectType.EdgeFilter;
            m_Getter.SubObjectSelect = true;
            m_Getter.DisablePreSelect();
            m_Getter.SetCommandPrompt("Select " + edgeType.ToString() + " Edges");
            m_Getter.GetMultiple(0, 0);

Here is the code. To replicate the behavior I described, try selecting internal edges using a rectangular selection. If you then print the number of selected objects, or print the (Guid, ComponentIndex) pairs, you will see the duplicates.

Hi @Nick_Drian, you might try this python script: GetBrepEdges.py (1.4 KB)

_
c.

1 Like

Thanks!

I did end up using a HashSet to filter out duplicates. I just thought it might be good to give some feedback on what I thought was a strange API so that perhaps others don’t have to trouble shoot this in the future.

Best,
Nick

1 Like