Edges of brep


I have a brep ,using the showedges command hint has 15 edges.
I using these 15 edges do filletedges command ,and it success,but I want using C++ sdk function do these,so I need get the 15 edges using c++ code,but when I using on_brep::m_E.Count() funtion just return 11 edges?
what wrong ?
.edges.3dm(752.9 KB) is the test 3dm file

another question:
I need write a general function to get all edges of brep which can filletted.(just like filletedges command can do)
how can I write this function

(Dale Fugier) #2

The Brep you attached does have 15 edge curves. You can tell this by using Rhino’s List command.

Rhino object: polysurface
  Use the Rhino "What" command.
  name: ""
  id: 4B1A8240-5754-488b-9A65-302EDB8660C4
  layer index: 15
  render material index: -1 (from layer)
  surfaces:  7
  3d curve:  15
  2d curves: 30
  vertices:  10
  edges:     15
  trims:     30
  loops:     7
  faces:     7

This block of code, when run against your Brep, also reports 15 edges.

CRhinoGetObject go;
go.SetCommandPrompt( L"Select Brep" );
go.SetGeometryFilter( CRhinoGetObject::surface_object | CRhinoGetObject::polysrf_object );
go.GetObjects( 1, 1 );
if( go.CommandResult() == CRhinoCommand::success )
  const ON_Brep* brep = go.Object(0).Brep();
  if( 0 != brep )
    RhinoApp().Print( L"Edge count = %d\n", brep->m_E.Count() );

To pick only edges that are filletable, you can do something like this:

CRhinoGetObject go;
go.SetCommandPrompt( L"Select edges to fillet" );
go.SetGeometryFilter( CRhinoGetObject::curve_object );
go.SetGeometryAttributeFilter( CRhinoGetObject::mated_edge | CRhinoGetObject::edge_curve );
go.GetObjects( 1, 0 );

Basically you are looking for edges with more than one trim (edge.TrimCount() > 1).