How to determine a tangent edge?

How to determine whether an edge of a Brep is tangent edge or not? The simpler the better.

Tangent in relation to what?

1 Like

In the program, I have a BREP object. How can I determine that one of its edges is a tangent edge?

Ah, I donโ€™t know how to do that, sorry. Maybe @dale can help here?

there is BrepEdge.ConcavityAt
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_BrepEdge_ConcavityAt.htm

it will allow to query a certain edge - parameter / point for Concavity

Not sure if there is a way to query an entire edge.

maybe that helps - kind regards. -tom

Hi @chen_manhong,

The display pipeline determines tangent edges in this manner:

public static bool IsTangentEdge(Brep brep, int edgeIndex)
{
  var rc = false;
  if (
        null != brep 
    && edgeIndex >= 0 
    && edgeIndex < brep.Edges.Count
    )
  {
    var edge = brep.Edges[edgeIndex];
    if (edge.IsSmoothManifoldEdge())
    {
      var trimIndices = edge.TrimIndices();
      var trim0 = brep.Trims[trimIndices[0]];
      var trim1 = brep.Trims[trimIndices[1]];
      rc = trim0.Face.FaceIndex != trim1.Face.FaceIndex;
    }
  }
  return rc;
}

Hope this helps.

โ€“ Dale

1 Like