Im creating a rhino command in C# that operates on brep edges. The command works fine until I select a singular edge aka micro edge. Attempting to select these degenerate edges causes the selection to be canceled. The CLI output becomes “Cannot use these objects. Removing them from selection.” I don’t care if degenerate edges cannot be selected, but Its quite annoying that my entire selection is unselected if I accidentally select a degenerate edge. Does anyone know any work arounds?
My edge selection Code:
// Select edges
var edgeGetter = new GetObject();
edgeGetter.SetCommandPrompt(“Select Brep Edges”);
edgeGetter.GeometryFilter = ObjectType.EdgeFilter;
edgeGetter.GroupSelect = true;
edgeGetter.SubObjectSelect = true;
edgeGetter.GetMultiple(1, 1000);
if (edgeGetter.Result() == GetResult.Cancel) return Result.Cancel;
ObjRef edgeObjects = edgeGetter.Objects();
if (edgeObjects.Length == 0) return Result.Cancel;
I’m not sure where the problematic edges are because I only encounter this issue when dragging to select many edges at once. When selecting the brep and running the “what” command, you’ll notice that it has 3 singular edges. I’m assuming these are the problematic edges. I cant find any rhino commands for tracking down or removing singular edges.
Also, the code that you provided has the same issue. The issue is happening during the .GetMultiple() call, thus any code after that point is not able to help.
Lots of Breps has singular edges. Create a sphere, using the Sphere command, and run What on the results.
The What command counts singular edges by iterating the Brep’s trim curves looking and counting trims with no edges. These trim will also be a TrimType.Singular type.