## DGKC Control Documentation

 Home Page > Models > Entities > Geometry > BRep > Edges Go to ActiveX docs Search Documentation

# BRep Edges

BRep Edges are part of the BRep structure, which represent the curved sides of Faces. Edges are added to a shape as part of wires. Edges are shared by wires of adjacent faces.

Edges always have finite length. Its ends are represented as BRep vertices (IBRepVertex_DG). Edge can be closed, in which case its ends is the same vertex.

Edges are accessed via IBRepEdge_DG obtained with IBRepWire_DG.GetEdge(), IBRepShape_DG.GetSubShapes() and other ways.

The actual geometry of an edge is defined by its 3D curve, accessed via IBRepEdge_DG.GetCurve(). The first vertex (vertex 0) geometrically coincides with the first end of the curve (and the second vertex coincides with the second end of the curve). When a curve is attached to an edge, its natural (standalone/unattached) parameter range is reduced to comply with this restriction.

An edge has internal direction from the first vertex to the second along the curve as defined by the 3D curve parameter. ICurve_DG.GetTangent() returns the direction at any point.

An edge in a valid surface has references to attached faces. These are returned by IBRepEdge_DG.GetFace(int side). The side parameter 0 specifies the face on the felft hand side looking from positive side of the face (from end of a normal). An external edge of an open surface (like a rectangle) references a single face.

An initialised edge in a BRep shape also has zero or more 2D curves, one per each adjacent face, in u,v plane of parameters of surface of the face. They are called P-curves. Normally P-curves are created automatically as result of initialisation. So, it is often enough to define only the 3D curve. All curves (3D, and P-curves) have the same range and parametrisation: For a parameter u, points returned by all curves either coincide or map to the same 3D point on the surface.

An edge is positively (forward) oriented in a wire (and hence in a face) if its internal direction (see above) is counter-clock-wise while looking from the positive side of the face. Otherwise the edge is called reversed or negative.

As vertices of a wire are always indexed in CCW direction, an edge is positively (forward) oriented in a wire if its second vertex, as returned by IBRepEdge_DG.GetEndVertex(), is next after the first in the wire. More precisely, i-th positively oriented edge in a wire has ends, which are i-th and i+1-th (modulo count) vertices of the wire. Negative (reversed) i-th edge has ends in the opposite order: (i+1)%count is the first end and i-th is the second.

If an edge is positively oriented in one wire, its orientation is negative is the adjacent wire, which shares the edge. And vice versa. Orientation can be queried via IBRepWire_DG.IsEdgeReversed().

A box, for an example, is a solid with a single shell, six faces, six wires, twelve edges, and eight vertices