Class Face
A face is a finite piece of a surface. It is bounded by a SimpleShape in the 2-dimensional u/v space
of the surface. A face is also a IGeoObject. The bounding curves of a face are implemented as Edges.
If a face is contained in a Model it doesnt share its edges with other faces. If a face is part of a Shell
(which maybe a part of a Solid) it shares some or all of its edges with other faces.
Inheritance
System.Object
Face
Implements
System.IComparable
System.ICloneable
System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: CADability.dll
Syntax
[Serializable]
public class Face : IGeoObjectImpl, IGeoObject, ILayer, IStyle, IOctTreeInsertable, IComparable, IFeedBack, ICloneable, ISerializable, IColorDef, IGetSubShapes, IDeserializationCallback, IJsonSerialize, IJsonSerializeDone, IExportStep
Constructors
|
Improve this Doc
View Source
Face()
Declaration
|
Improve this Doc
View Source
Face(SerializationInfo, StreamingContext)
Constructor required by deserialization
Declaration
protected Face(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
SerializationInfo
|
| System.Runtime.Serialization.StreamingContext |
context |
StreamingContext
|
Fields
|
Improve this Doc
View Source
Constructed
Declaration
public static Face.ConstructedDelegate Constructed
Field Value
|
Improve this Doc
View Source
Constructor
Declaration
public static Face.ConstructionDelegate Constructor
Field Value
|
Improve this Doc
View Source
OnPaintTo3D
Declaration
public static Face.PaintTo3DDelegate OnPaintTo3D
Field Value
Properties
|
Improve this Doc
View Source
AllEdges
Returns all edges that surround this face (also the holes in this face)
Declaration
public Edge[] AllEdges { get; }
Property Value
|
Improve this Doc
View Source
AllEdgesSet
Declaration
public Set<Edge> AllEdgesSet { get; }
Property Value
|
Improve this Doc
View Source
Area
Returns the two dimensional shape of the outline of this face in the parametric (u/v) space of the surface.
Declaration
public SimpleShape Area { get; }
Property Value
|
Improve this Doc
View Source
ColorDef
Declaration
public ColorDef ColorDef { get; set; }
Property Value
|
Improve this Doc
View Source
Description
Declaration
public override string Description { get; }
Property Value
| Type |
Description |
| System.String |
|
Overrides
|
Improve this Doc
View Source
Domain
A bounding rectangle which restricts the parametric space of the Surface.
Declaration
public BoundingRect Domain { get; }
Property Value
|
Improve this Doc
View Source
HoleCount
Gets the number of holes in this face.
Declaration
public int HoleCount { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
Name
Declaration
public string Name { get; set; }
Property Value
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
NameOrEmpty
Declaration
public string NameOrEmpty { get; }
Property Value
| Type |
Description |
| System.String |
|
|
Improve this Doc
View Source
OrientedOutward
Returns the orientation of this face. this is only meaningful if this face is part of a closed shell
which defines a solid. If true, the normal vector of the surface of this face points outward of the solid,
if false it points into the inside.
Declaration
public bool OrientedOutward { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
OutlineEdges
Gets all edges that represent the outline of this face (not the holes).
The order of the edges is counterclockwise when you look at the face from the outside.
Declaration
public Edge[] OutlineEdges { get; }
Property Value
|
Improve this Doc
View Source
OwnedItems
Declaration
public override IGeoObject[] OwnedItems { get; }
Property Value
Overrides
|
Improve this Doc
View Source
PreferredStyle
Declaration
public override Style.EDefaultFor PreferredStyle { get; }
Property Value
Overrides
|
Improve this Doc
View Source
Surface
Returns the geometrical surface on which this face resides.
Declaration
public ISurface Surface { get; }
Property Value
|
Improve this Doc
View Source
Vertices
Declaration
public Vertex[] Vertices { get; }
Property Value
Methods
|
Improve this Doc
View Source
Clone()
Declaration
public override IGeoObject Clone()
Returns
Overrides
|
Improve this Doc
View Source
Clone(Dictionary<Edge, Edge>, Dictionary<Vertex, Vertex>)
Declaration
public Face Clone(Dictionary<Edge, Edge> clonedEdges, Dictionary<Vertex, Vertex> clonedVertices)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.Dictionary<Edge, Edge> |
clonedEdges |
|
| System.Collections.Generic.Dictionary<Vertex, Vertex> |
clonedVertices |
|
Returns
|
Improve this Doc
View Source
ConnectTwoFaces(Face, Face, Double)
Connect two faces by geometrically identical edges. Return true if at least one pair of edges has been combined (to a single edge).
Doesn't combine singular edges.
Declaration
public static bool ConnectTwoFaces(Face face1, Face face2, double precision)
Parameters
| Type |
Name |
Description |
| Face |
face1 |
|
| Face |
face2 |
|
| System.Double |
precision |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Construct()
Declaration
public static Face Construct()
Returns
|
Improve this Doc
View Source
Contains(ref GeoPoint2D, Boolean)
Checks whether the provided 2d point in the parameter space of the surface is inside the bounds of this face.
If the surface is periodic then it will also be checked whether the point with its periodic offset
is contained in the face. In this case, the 2d coordinates of the point are updated to reflect the correct
period in which it is inside the face
Declaration
public bool Contains(ref GeoPoint2D p, bool acceptOnCurve)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
p |
The point to check
|
| System.Boolean |
acceptOnCurve |
Also accept points on the outline
|
Returns
| Type |
Description |
| System.Boolean |
true if the point is inside the face
|
|
Improve this Doc
View Source
CopyGeometry(IGeoObject)
Declaration
public override void CopyGeometry(IGeoObject ToCopyFrom)
Parameters
Overrides
|
Improve this Doc
View Source
Distance(GeoPoint)
Returns the smallest distance from the provided point to the face. It will be the distance to
a perpendicular footpoint on the face. If there is no such perpendicular footpoint
double.MaxValue will be returned. This method does not compute the distance to edges or vertices.
If you need those distances use PositionOf(GeoPoint) and PointAt(Double).
Declaration
public double Distance(GeoPoint fromHere)
Parameters
| Type |
Name |
Description |
| GeoPoint |
fromHere |
Point from which the distance is calculated
|
Returns
| Type |
Description |
| System.Double |
The signed distance, positive is to the outside, negative to the inside
|
|
Improve this Doc
View Source
FindSnapPoint(SnapPointFinder)
Declaration
public override void FindSnapPoint(SnapPointFinder spf)
Parameters
Overrides
|
Improve this Doc
View Source
FreeCachedMemory()
Declaration
public void FreeCachedMemory()
|
Improve this Doc
View Source
GetBoundingCube()
Declaration
public override BoundingCube GetBoundingCube()
Returns
Overrides
|
Improve this Doc
View Source
GetCylindricalConnected()
Returns all other directly connected faces which have a common ISurfaceOfArcExtrusion surface
Declaration
public HashSet<Face> GetCylindricalConnected()
Returns
| Type |
Description |
| System.Collections.Generic.HashSet<Face> |
|
|
Improve this Doc
View Source
GetExtent(Projection, ExtentPrecision)
Declaration
public override BoundingRect GetExtent(Projection projection, ExtentPrecision extentPrecision)
Parameters
Returns
Overrides
|
Improve this Doc
View Source
GetExtent(Double)
Declaration
public override BoundingCube GetExtent(double precision)
Parameters
| Type |
Name |
Description |
| System.Double |
precision |
|
Returns
Overrides
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
GetInnerIntersection(Face)
Find inner intersection curves of two faces. This is only used to find intersection curves, which do not cross the edges of the faces. (but might also find and return such curves)
Declaration
public ICurve[] GetInnerIntersection(Face other)
Parameters
| Type |
Name |
Description |
| Face |
other |
the other face
|
Returns
| Type |
Description |
| ICurve[] |
Array of inner intersection curves
|
|
Improve this Doc
View Source
GetObjectData(SerializationInfo, StreamingContext)
Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
Declaration
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
The System.Runtime.Serialization.SerializationInfo to populate with data.
|
| System.Runtime.Serialization.StreamingContext |
context |
The destination (System.Runtime.Serialization.StreamingContext) for this serialization.
|
Overrides
|
Improve this Doc
View Source
GetOffset(Double, Dictionary<Vertex, Vertex>)
Declaration
public Face GetOffset(double dist, Dictionary<Vertex, Vertex> vertices)
Parameters
| Type |
Name |
Description |
| System.Double |
dist |
|
| System.Collections.Generic.Dictionary<Vertex, Vertex> |
vertices |
|
Returns
|
Improve this Doc
View Source
GetPlaneIntersection(PlaneSurface)
Returns the curves that result from a planar intersection of this face with the provided plane.
The curves are clipped to the outline (and holes) of the face.
Declaration
public ICurve[] GetPlaneIntersection(PlaneSurface pl)
Parameters
| Type |
Name |
Description |
| PlaneSurface |
pl |
The plane to intersect with
|
Returns
| Type |
Description |
| ICurve[] |
Array of intersection curves
|
|
Improve this Doc
View Source
GetQuadTreeItem(Projection, ExtentPrecision)
Declaration
public override IQuadTreeInsertableZ GetQuadTreeItem(Projection projection, ExtentPrecision extentPrecision)
Parameters
Returns
Overrides
|
Improve this Doc
View Source
GetShadow(Plane)
Declaration
public SimpleShape GetShadow(Plane onThisPlane)
Parameters
| Type |
Name |
Description |
| Plane |
onThisPlane |
|
Returns
|
Improve this Doc
View Source
GetShowProperties(IFrame)
Declaration
public override IShowProperty GetShowProperties(IFrame Frame)
Parameters
| Type |
Name |
Description |
| IFrame |
Frame |
|
Returns
Overrides
|
Improve this Doc
View Source
GetSimpleTriangulation(Double, Boolean, out GeoPoint[], out GeoPoint2D[], out Int32[], out Int32[])
Declaration
public void GetSimpleTriangulation(double precision, bool noInnerPoints, out GeoPoint[] trianglePoint, out GeoPoint2D[] triangleUVPoint, out int[] triangleIndex, out int[] edgeIndizes)
Parameters
| Type |
Name |
Description |
| System.Double |
precision |
|
| System.Boolean |
noInnerPoints |
|
| GeoPoint[] |
trianglePoint |
|
| GeoPoint2D[] |
triangleUVPoint |
|
| System.Int32[] |
triangleIndex |
|
| System.Int32[] |
edgeIndizes |
|
|
Improve this Doc
View Source
GetTriangulation(Double, out GeoPoint[], out GeoPoint2D[], out Int32[], out BoundingCube)
Returns the triangulation of this face to the provided precision.
trianglePoint and triangleUVPoint are two arrays of the same length specifying the
vertices of the triangle in 3d or 2d surface coordinates. triangleIndex is a list of indizes to
trianglePoint and triangleUVPoint where each triple of indices describes one triangle. The length of triangleIndex is a multiple of 3.
Declaration
public void GetTriangulation(double precision, out GeoPoint[] trianglePoint, out GeoPoint2D[] triangleUVPoint, out int[] triangleIndex, out BoundingCube triangleExtent)
Parameters
| Type |
Name |
Description |
| System.Double |
precision |
Required precision
|
| GeoPoint[] |
trianglePoint |
Resulting 3d points
|
| GeoPoint2D[] |
triangleUVPoint |
Resulting 2d points
|
| System.Int32[] |
triangleIndex |
Triangle indizes
|
| BoundingCube |
triangleExtent |
Extent of the triangles
|
|
Improve this Doc
View Source
GetUVBounds()
Returnes the minimum and maximum values of coordinates in the parametric space used by this face.
Declaration
public BoundingRect GetUVBounds()
Returns
| Type |
Description |
| BoundingRect |
Extent in parametric space (u/v)
|
|
Improve this Doc
View Source
GetUVBounds(out Double, out Double, out Double, out Double)
Returnes the minimum and maximum values of coordinates in the parametric space used by this face.
Declaration
public void GetUVBounds(out double umin, out double umax, out double vmin, out double vmax)
Parameters
| Type |
Name |
Description |
| System.Double |
umin |
Minimum in u direction
|
| System.Double |
umax |
Maximum in u direction
|
| System.Double |
vmin |
Minimum in v direction
|
| System.Double |
vmax |
Maximum in v direction
|
|
Improve this Doc
View Source
GetUVOutline(Double)
Declaration
public GeoPoint2D[][] GetUVOutline(double precision)
Parameters
| Type |
Name |
Description |
| System.Double |
precision |
|
Returns
|
Improve this Doc
View Source
HitBoundingCube(BoundingCube)
Declaration
public bool HitBoundingCube(BoundingCube bc)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
HitBoundingCube(BoundingCube, BoundingCube)
Declaration
public bool HitBoundingCube(BoundingCube bc, BoundingCube fbc)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
HitTest(ref BoundingCube, Double)
Declaration
public override bool HitTest(ref BoundingCube cube, double precision)
Parameters
| Type |
Name |
Description |
| BoundingCube |
cube |
|
| System.Double |
precision |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
HitTest(Projection, BoundingRect, Boolean)
Declaration
public override bool HitTest(Projection projection, BoundingRect rect, bool onlyInside)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
HitTest(Projection.PickArea, Boolean)
Declaration
public override bool HitTest(Projection.PickArea area, bool onlyInside)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
HoleEdges(Int32)
Returns all edges that belong to the hole with the provided index.
The order of the edges is counterclockwise when you look at the face from the outside.
Declaration
public Edge[] HoleEdges(int index)
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
Index of the hole to get
|
Returns
| Type |
Description |
| Edge[] |
The requested hole
|
|
Improve this Doc
View Source
Intersect(Face)
Declaration
[Obsolete("Has been renamed to \"GetInnerIntersection\"")]
public ICurve[] Intersect(Face other)
Parameters
| Type |
Name |
Description |
| Face |
other |
|
Returns
|
Improve this Doc
View Source
IsClosedSurface()
Declaration
public bool IsClosedSurface()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IsConnectedWith(Face)
Declaration
public bool IsConnectedWith(Face fc1)
Parameters
| Type |
Name |
Description |
| Face |
fc1 |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IsFillet()
Returns true, if this face can be considered as a fillet between two other faces
Declaration
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MakeFace(ISurface, BoundingRect)
Declaration
public static Face MakeFace(ISurface surface, BoundingRect br)
Parameters
Returns
|
Improve this Doc
View Source
MakeFace(ISurface, SimpleShape)
Creates a face by specification of the geometrical surface and the outline in the parametric space
on that surface.
Declaration
public static Face MakeFace(ISurface surface, SimpleShape outline)
Parameters
Returns
| Type |
Description |
| Face |
The created face
|
|
Improve this Doc
View Source
MakeFace(ISurface, List<List<ICurve2D>>)
Declaration
public static Face MakeFace(ISurface surface, List<List<ICurve2D>> outlineAndHoles)
Parameters
| Type |
Name |
Description |
| ISurface |
surface |
|
| System.Collections.Generic.List<System.Collections.Generic.List<ICurve2D>> |
outlineAndHoles |
|
Returns
|
Improve this Doc
View Source
MakeFace(GeoPoint, GeoPoint, GeoPoint)
Creates a new face representing a tringle in space
Declaration
public static Face MakeFace(GeoPoint p1, GeoPoint p2, GeoPoint p3)
Parameters
Returns
|
Improve this Doc
View Source
MakePlanarFace(IGeoObject[])
Creates a face by connecting curves. The objects in bounds must describe a closed border
which may contain some holes.
Declaration
public static Face MakePlanarFace(IGeoObject[] bounds)
Parameters
Returns
|
Improve this Doc
View Source
MakeRegularSurface(Double)
PRELIMINARY!
Tries to use a more simple surface for this face. E.g. a NurbsSurface will be reduced to a torodial surface
if the data allows it. The followind replacements are currently performed
Declaration
public bool MakeRegularSurface(double maxError)
Parameters
| Type |
Name |
Description |
| System.Double |
maxError |
The maximum aberration of the surfaces
|
Returns
| Type |
Description |
| System.Boolean |
true if surface could be simplyfied
|
|
Improve this Doc
View Source
Modify(ModOp)
Declaration
public override void Modify(ModOp m)
Parameters
| Type |
Name |
Description |
| ModOp |
m |
|
Overrides
|
Improve this Doc
View Source
ModifySurface(ModOp)
Declaration
public void ModifySurface(ModOp m)
Parameters
| Type |
Name |
Description |
| ModOp |
m |
|
|
Improve this Doc
View Source
PaintTo3D(IPaintTo3D)
Declaration
public override void PaintTo3D(IPaintTo3D paintTo3D)
Parameters
Overrides
|
Improve this Doc
View Source
PaintTo3DList(IPaintTo3D, ICategorizedDislayLists)
Declaration
public override void PaintTo3DList(IPaintTo3D paintTo3D, ICategorizedDislayLists lists)
Parameters
Overrides
|
Improve this Doc
View Source
Position(GeoPoint, GeoVector, Double)
Declaration
public override double Position(GeoPoint fromHere, GeoVector direction, double precision)
Parameters
Returns
| Type |
Description |
| System.Double |
|
Overrides
|
Improve this Doc
View Source
PositionOf(GeoPoint)
Gets the Surface.PositionOf(p) in the correct periodic domain
Declaration
public GeoPoint2D PositionOf(GeoPoint p)
Parameters
Returns
|
Improve this Doc
View Source
PrepareDisplayList(Double)
Declaration
public override void PrepareDisplayList(double precision)
Parameters
| Type |
Name |
Description |
| System.Double |
precision |
|
Overrides
|
Improve this Doc
View Source
RecalcVertices()
Declaration
public void RecalcVertices()
|
Improve this Doc
View Source
ReverseOrientation()
Reverses the orientation of this Face. the normal vector on any point of the surface will point to
the opposite direction
Declaration
public void ReverseOrientation()
|
Improve this Doc
View Source
Declaration
public static bool SameForm(Face[] faces1, Face[] faces2, double precision, out ModOp translation)
Parameters
| Type |
Name |
Description |
| Face[] |
faces1 |
|
| Face[] |
faces2 |
|
| System.Double |
precision |
|
| ModOp |
translation |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
SameSurface(Face)
Returns true, when the otherFace has a geometrically equal surface
Declaration
public bool SameSurface(Face otherFace)
Parameters
| Type |
Name |
Description |
| Face |
otherFace |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Set(ISurface, Edge[][], Boolean)
Declaration
public void Set(ISurface surface, Edge[][] edges, bool checkOutline = false)
Parameters
| Type |
Name |
Description |
| ISurface |
surface |
|
| Edge[][] |
edges |
|
| System.Boolean |
checkOutline |
|
|
Improve this Doc
View Source
SetArea(SimpleShape)
Declaration
protected virtual void SetArea(SimpleShape outline)
Parameters
|
Improve this Doc
View Source
SetSurface(ISurface)
Declaration
protected virtual void SetSurface(ISurface surface)
Parameters
|
Improve this Doc
View Source
SplitPeriodicFace()
Declaration
public List<Face> SplitPeriodicFace()
Returns
| Type |
Description |
| System.Collections.Generic.List<Face> |
|
|
Improve this Doc
View Source
SplitSingularFace()
Declaration
public List<Face> SplitSingularFace()
Returns
| Type |
Description |
| System.Collections.Generic.List<Face> |
|
Explicit Interface Implementations
|
Improve this Doc
View Source
IColorDef.SetTopLevel(ColorDef)
Declaration
void IColorDef.SetTopLevel(ColorDef newValue)
Parameters
|
Improve this Doc
View Source
IColorDef.SetTopLevel(ColorDef, Boolean)
Declaration
void IColorDef.SetTopLevel(ColorDef newValue, bool overwriteChildNullColor)
Parameters
| Type |
Name |
Description |
| ColorDef |
newValue |
|
| System.Boolean |
overwriteChildNullColor |
|
|
Improve this Doc
View Source
IExportStep.Export(ExportStep, Boolean)
Declaration
int IExportStep.Export(ExportStep export, bool topLevel)
Parameters
| Type |
Name |
Description |
| ExportStep |
export |
|
| System.Boolean |
topLevel |
|
Returns
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
IJsonSerialize.GetObjectData(IJsonWriteData)
Declaration
void IJsonSerialize.GetObjectData(IJsonWriteData data)
Parameters
|
Improve this Doc
View Source
IJsonSerialize.SetObjectData(IJsonReadData)
Declaration
void IJsonSerialize.SetObjectData(IJsonReadData data)
Parameters
|
Improve this Doc
View Source
IJsonSerializeDone.SerializationDone()
Declaration
void IJsonSerializeDone.SerializationDone()
|
Improve this Doc
View Source
IDeserializationCallback.OnDeserialization(Object)
Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
| Type |
Name |
Description |
| System.Object |
sender |
|
Implements
System.IComparable
System.ICloneable
System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback