DGKC Control Documentation


Skip Navigation Links.
Skip Navigation LinksHome Page > Models > Entities > Geometry > BRep > Faces Go to ActiveX docs Search Documentation


BRep Faces

Faces (patches) are the smooth connected pieces of surface of BRep objects

Properties of a face, including parameter ranges, 3D coordinates of a point, wires, etc. can be obtained via IBRepFace_DG interface obtained IBRepShell_DG.GetFace(), IBRepShape_DG.GetSubShapes(), IBRepShape_DG.GetAncestors() or other methods. Since v7.0 faces can have per face color controlled by IBRepShape_DG.ColorEnabled and IBRepShape_DG.Color. See PerShapeColorForm in the Shape Explorer example.

Geometry of a face is defined by a BRep surface, which can be accessed programmatically via IBRepFace_DG.GetSurface(). The surface is parametrized with two parameters (u and v). The surface defines mapping of a 2D rectangle (possibly infinite in one or both directions) into 3D space (via IUVSurface_DG.GetPoint())

U,V parameters used by IBRepFace_DG and its surface are the same: A (u,v) pair of the face range defines geometrically the same point on both face and the surface. Rectangles of u,v parameters, defined by the ranges returned by IBRepFace_DG.GetRanges() and IUVSurface_DG.GetRanges() can be different, but in a valid face, rectangle of the surface always includes reactangle of the face.

Surface of a face can have either positive or negative (reversed) orientation relative to the face. This can be identified via the IBRepFace_DG.IsSurfaceReversed() method. If the surface is reversed, its normal, as returned by IUVSurface_DG.GetNormal(), is opposite to the external normal of the face returned by IBRepFace_DG.GetNormal(). Negatively oriented surfaces often appear as a result of a Boolean Subtract operation.

A face can be closed in one (cylinder) or both (torus) directions.

A face has zero or more trimming wires (loops) lying on the surface of the face. When a face has no wires, it defines a deformed and stretched rectangle, opposite egdes if which are joined, if it is closed. Sphere and torus are examples of faces with no wires, which are closed in both directions. Wires allow modelling of more complicated faces like triangular or polygonal curved faces or faces with holes.

If a face has wires, the first one (index 0) as returned by IBRepFace_DG.GetWire() is the external wire in Counter Clock Wise direction on positive side of the face. The rest of the wires represent holes and have Clock Wise direction.

A wire defined by limits of the surface parameter ranges is called natural. I rectangle in 3D is an example of a face with a single natural wire.

Faces must be finite to be valid. If underlying surface is infinite in either direction, the face must have a wire.

Sequence of edges for any wire of a face, returned by IBRepWire_DG.GetEdge() is always in Counter Clock Wise direction relative to the positive side of the face (normal is looking into the positive, external for closed surfaces, part of 3D space). The same is true for vertices returned by IBRepWire_DG.GetVertex().

For a wire, sequence of p-curves of its edges defines a closed curved polygon in the 2D rectangle of u,v parmeters. The polygon is mapped to the wire under uv->3D mapping discussed above. The finite rectangle returned by IBRepFace_DG.GetRanges() is the bounding rectangle of this polygon.

 Internal consistency of a face can be checked using IBRepFace_DG > IBRepShape_DG > IBRepShape_DG.IsValid() query. If it fails, the error can be obtained via: IModel_DG > IError_DG > IError_DG.GetError().

See also: Face sample, Wires, Shape Explorer Sample