Class Border
A simple border composed of one ore more ICurve2D objects.
A Border is always invariant, i.e. you annot change it (like System.String).
If a border is closed, then it is oriented counterclockwise. A border may be
produced by the BorderBuilder object (or by its constructors).
Inheritance
System.Object
Border
Implements
System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: CADability.dll
Syntax
[Serializable]
public class Border : ISerializable, IDeserializationCallback
Constructors
|
Improve this Doc
View Source
Border(ICurve2D)
Declaration
public Border(ICurve2D onlySegment)
Parameters
| Type |
Name |
Description |
| ICurve2D |
onlySegment |
|
|
Improve this Doc
View Source
Border(ICurve2D[])
Constructs a Border from a list of ICurve2D objects. The objects must be in the
correct order and must be continous, i.e. EndPoint of ICurve2D[i] must be
equal to Startpoint of ICurve2D[i+1]. Equality refers to Precision.IsEqual().
It will be checked automatically, whether the border is closed and if so,
it will be oriented counterclockwise.
Declaration
public Border(ICurve2D[] segments)
Parameters
| Type |
Name |
Description |
| ICurve2D[] |
segments |
list of curves to make the border
|
|
Improve this Doc
View Source
Border(ICurve2D[], Boolean, Boolean)
Create a border with the provided segments assumed to be in correct order and orientation. If forceConnected
is true, the border will be closed.
Declaration
public Border(ICurve2D[] segments, bool forceConnected, bool flatten = true)
Parameters
| Type |
Name |
Description |
| ICurve2D[] |
segments |
The oriented and ordered segments
|
| System.Boolean |
forceConnected |
True: border will be closed even if segments aren't connected at the end
|
| System.Boolean |
flatten |
|
|
Improve this Doc
View Source
Border(GeoPoint2D[])
Declaration
public Border(GeoPoint2D[] polyline)
Parameters
|
Improve this Doc
View Source
Border(out Boolean, ICurve2D[])
Declaration
public Border(out bool reversed, ICurve2D[] segments)
Parameters
| Type |
Name |
Description |
| System.Boolean |
reversed |
|
| ICurve2D[] |
segments |
|
|
Improve this Doc
View Source
Border(SerializationInfo, StreamingContext)
Constructor required by deserialization
Declaration
protected Border(SerializationInfo info, StreamingContext context)
Parameters
| Type |
Name |
Description |
| System.Runtime.Serialization.SerializationInfo |
info |
SerializationInfo
|
| System.Runtime.Serialization.StreamingContext |
context |
StreamingContext
|
Properties
|
Improve this Doc
View Source
Area
Declaration
public double Area { get; }
Property Value
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
Count
Declaration
public int Count { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
EndPoint
Declaration
public GeoPoint2D EndPoint { get; }
Property Value
|
Improve this Doc
View Source
Extent
Declaration
public BoundingRect Extent { get; }
Property Value
|
Improve this Doc
View Source
IsClosed
Declaration
public bool IsClosed { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IsEmpty
Declaration
public bool IsEmpty { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Item[Int32]
Declaration
public ICurve2D this[int index] { get; }
Parameters
| Type |
Name |
Description |
| System.Int32 |
index |
|
Property Value
|
Improve this Doc
View Source
Length
Declaration
public double Length { get; }
Property Value
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
SomeInnerPoint
Declaration
public GeoPoint2D SomeInnerPoint { get; }
Property Value
|
Improve this Doc
View Source
StartPoint
Declaration
public GeoPoint2D StartPoint { get; }
Property Value
Methods
|
Improve this Doc
View Source
AddToGraphicsPath(GraphicsPath, Boolean)
Declaration
public void AddToGraphicsPath(GraphicsPath path, bool counterClockWise)
Parameters
| Type |
Name |
Description |
| System.Drawing.Drawing2D.GraphicsPath |
path |
|
| System.Boolean |
counterClockWise |
|
|
Improve this Doc
View Source
AsPath()
Returns this Border as a Path2D object.
Declaration
Returns
|
Improve this Doc
View Source
ChangeCyclicalStart(Int32)
Declaration
public void ChangeCyclicalStart(int newStartIndex)
Parameters
| Type |
Name |
Description |
| System.Int32 |
newStartIndex |
|
|
Improve this Doc
View Source
Clip(ICurve2D, Boolean)
Declaration
public double[] Clip(ICurve2D toClip, bool returnInsideParts)
Parameters
| Type |
Name |
Description |
| ICurve2D |
toClip |
|
| System.Boolean |
returnInsideParts |
|
Returns
| Type |
Description |
| System.Double[] |
|
|
Improve this Doc
View Source
Clone()
Declaration
Returns
|
Improve this Doc
View Source
CounterClockwise(ICurve2D[])
Declaration
public static bool CounterClockwise(ICurve2D[] curves)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
CounterClockwise(List<ICurve2D>)
Declaration
public static bool CounterClockwise(List<ICurve2D> curves)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<ICurve2D> |
curves |
|
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
DirectionAt(Double)
Declaration
public GeoVector2D DirectionAt(double par)
Parameters
| Type |
Name |
Description |
| System.Double |
par |
|
Returns
|
Improve this Doc
View Source
DistanceAtDirection(Border, GeoVector2D)
Calculates the distance between this Border and the other Border respecting the given direction dir.
Or in other words: how far can you move this Border in the direction dir until it touches the other border.
The result may be double.MaxValue, which means they will never touch each other or negative, if you would have to move this
border in the opposite direction of dir.
Declaration
public double DistanceAtDirection(Border other, GeoVector2D dir)
Parameters
| Type |
Name |
Description |
| Border |
other |
The border to meassure the distance to
|
| GeoVector2D |
dir |
Direction for the distance
|
Returns
| Type |
Description |
| System.Double |
Distance
|
|
Improve this Doc
View Source
FromUnorientedList(ICurve2D[], Boolean)
segments enthält die Kurven zwar in richtiger Reohenfolge doch u.U. in falscher Richtung.
Hier wird also vor dem Erzeugen der Border ggf. umorientiert
Declaration
public static Border FromUnorientedList(ICurve2D[] segments, bool forceClosed)
Parameters
| Type |
Name |
Description |
| ICurve2D[] |
segments |
|
| System.Boolean |
forceClosed |
|
Returns
|
Improve this Doc
View Source
GetClonedSegments()
Declaration
public ICurve2D[] GetClonedSegments()
Returns
|
Improve this Doc
View Source
GetIntersectionPoints(ICurve2D)
Returns a list of all intersectionpoints of this border with the given curve.
Some intersectionpoints may be found twice, if the Curve passes through a vertex
of this border. The par1 member of the intersectionpoint is the parameter
of this border (0.0<=par1<=this.Count) the par2 member is the parameter
of the curve (0.0<=par1<=1.0).
Declaration
public GeoPoint2DWithParameter[] GetIntersectionPoints(ICurve2D IntersectWith)
Parameters
| Type |
Name |
Description |
| ICurve2D |
IntersectWith |
curve to intersect this border with
|
Returns
|
Improve this Doc
View Source
GetIntersectionPoints(ICurve2D, Double)
Declaration
public GeoPoint2DWithParameter[] GetIntersectionPoints(ICurve2D IntersectWith, double precision)
Parameters
| Type |
Name |
Description |
| ICurve2D |
IntersectWith |
|
| System.Double |
precision |
|
Returns
|
Improve this Doc
View Source
GetIntersectionPoints(Border)
Declaration
public GeoPoint2DWithParameter[] GetIntersectionPoints(Border IntersectWith)
Parameters
| Type |
Name |
Description |
| Border |
IntersectWith |
|
Returns
|
Improve this Doc
View Source
GetIntersectionPoints(Border, Double)
Declaration
public GeoPoint2DWithParameter[] GetIntersectionPoints(Border IntersectWith, double precision)
Parameters
| Type |
Name |
Description |
| Border |
IntersectWith |
|
| System.Double |
precision |
|
Returns
|
Improve this Doc
View Source
GetMinDistance(Border)
Declaration
public double GetMinDistance(Border Other)
Parameters
| Type |
Name |
Description |
| Border |
Other |
|
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
GetModified(ModOp2D)
Declaration
public Border GetModified(ModOp2D m)
Parameters
Returns
|
Improve this Doc
View Source
GetObjectData(SerializationInfo, StreamingContext)
Implements System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
Declaration
public 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.
|
|
Improve this Doc
View Source
GetParallel(Double, Boolean, Double, Double)
Yields a set of borders that are parallel to this border with a given distance. Positive
distance yields a border to the right side (or outside if closed) of this border, negative
to the left side or inside. In some cases there is no soltuion (e.g. an inside parallel
border of a closed border must have a distance less than half of the diameter of the border)
In other cases there may be a set of solutions, e.g. if the border is not convex.
Declaration
public Border[] GetParallel(double dist, bool approxSpline, double precision, double roundAngle)
Parameters
| Type |
Name |
Description |
| System.Double |
dist |
the distance of the desired parallel border
|
| System.Boolean |
approxSpline |
|
| System.Double |
precision |
|
| System.Double |
roundAngle |
|
Returns
| Type |
Description |
| Border[] |
array of parallel borders (maybe empty)
|
|
Improve this Doc
View Source
GetParameter(GeoPoint2D)
Liefert den Parameter des Punktes p auf den Bahnkurven des Borders. Für jede
Kurve durchläuft der Parameter Werte von 0.0 (Startpunkt) bis 1.0 (Endpunkt)
Das Ergebnis dieser Methode ist dieser Parameter + Index der betreffenden Kurve.
Declaration
public double GetParameter(GeoPoint2D p)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
p |
Punkt, zu dem der Parameter gesucht ist, muss auf dem Rand liegen
|
Returns
| Type |
Description |
| System.Double |
der Parameter
|
|
Improve this Doc
View Source
GetPart(Double, Double, Boolean)
Declaration
public ICurve2D[] GetPart(double startParam, double endParam, bool forward)
Parameters
| Type |
Name |
Description |
| System.Double |
startParam |
|
| System.Double |
endParam |
|
| System.Boolean |
forward |
|
Returns
|
Improve this Doc
View Source
GetPosition(BoundingRect)
Returns the Border.Position of the given Point relative to this Border.
If the outline of the border interferes with a square around p (width and height
is 2*precision), the result will be OnCurve.
Declaration
public Border.Position GetPosition(BoundingRect rect)
Parameters
Returns
| Type |
Description |
| Border.Position |
Inside, Outside or OnCurve (on the outline of this border)
|
|
Improve this Doc
View Source
GetPosition(GeoPoint2D)
Declaration
public Border.Position GetPosition(GeoPoint2D p)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
p |
The Point to test
|
Returns
| Type |
Description |
| Border.Position |
Inside, Outside or OnCurve (on the outline of this border)
|
|
Improve this Doc
View Source
getRoughArea()
Declaration
protected double getRoughArea()
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
GetSelfIntersection(Double)
Declaration
public double[] GetSelfIntersection(double precision)
Parameters
| Type |
Name |
Description |
| System.Double |
precision |
|
Returns
| Type |
Description |
| System.Double[] |
|
|
Improve this Doc
View Source
IsInside(ICurve2D[], GeoPoint2D)
Returnes true, when the provided point is inside the loop of curves.
When the curves are oriented clockwise, true means outside (the hole)
Declaration
public static bool IsInside(ICurve2D[] curves, GeoPoint2D toTest)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
IsPointOnOutline(ICurve2D[], GeoPoint2D, Double)
Declaration
public static bool IsPointOnOutline(ICurve2D[] curves, GeoPoint2D toTest, double precision)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MakeCircle(GeoPoint2D, Double)
Declaration
public static Border MakeCircle(GeoPoint2D center, double radius)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
center |
|
| System.Double |
radius |
|
Returns
|
Improve this Doc
View Source
MakeLongHole(ICurve2D, Double)
Declaration
public static Border MakeLongHole(ICurve2D centerCurve, double radius)
Parameters
| Type |
Name |
Description |
| ICurve2D |
centerCurve |
|
| System.Double |
radius |
|
Returns
|
Improve this Doc
View Source
MakeLongHole(GeoPoint2D, GeoPoint2D, Double, Double)
Declaration
public static Border MakeLongHole(GeoPoint2D startPoint, GeoPoint2D endPoint, double startRadius, double endRadius)
Parameters
| Type |
Name |
Description |
| GeoPoint2D |
startPoint |
|
| GeoPoint2D |
endPoint |
|
| System.Double |
startRadius |
|
| System.Double |
endRadius |
|
Returns
|
Improve this Doc
View Source
MakeRectangle(Double, Double, Double, Double)
Declaration
public static Border MakeRectangle(double left, double right, double bottom, double top)
Parameters
| Type |
Name |
Description |
| System.Double |
left |
|
| System.Double |
right |
|
| System.Double |
bottom |
|
| System.Double |
top |
|
Returns
|
Improve this Doc
View Source
PointAt(Double)
Declaration
public GeoPoint2D PointAt(double par)
Parameters
| Type |
Name |
Description |
| System.Double |
par |
|
Returns
|
Improve this Doc
View Source
Project(Plane, Plane)
Declaration
public Border Project(Plane fromPlane, Plane toPlane)
Parameters
| Type |
Name |
Description |
| Plane |
fromPlane |
|
| Plane |
toPlane |
|
Returns
|
Improve this Doc
View Source
Recalc(out Boolean)
Declaration
protected void Recalc(out bool reversed)
Parameters
| Type |
Name |
Description |
| System.Boolean |
reversed |
|
|
Improve this Doc
View Source
RecalcArea()
Declaration
protected double RecalcArea()
Returns
| Type |
Description |
| System.Double |
|
|
Improve this Doc
View Source
RemoveSmallSegments(Double)
Removes small segments which are smaller than minLength and connects the remaining segments.
Declaration
public void RemoveSmallSegments(double minLength)
Parameters
| Type |
Name |
Description |
| System.Double |
minLength |
Segments smaller than this value are beeing removed
|
|
Improve this Doc
View Source
Split(Double[])
Returns an array of Border objects by breaking this border at the given positions.
Parameter must be an ordered list of double values. Each value must be greater 0.0
and less the number of iCurve2D objects in this Border.
Declaration
public Border[] Split(double[] Parameter)
Parameters
| Type |
Name |
Description |
| System.Double[] |
Parameter |
|
Returns
Operators
|
Improve this Doc
View Source
Addition(Border, Border)
Concatenates two border objects. Both borders must be open (not closed) and
the endpoint of the first border must be equal to the startpoint of the second
border (as defined by Precision.IsEqual).
Declaration
public static Border operator +(Border first, Border second)
Parameters
Returns
Explicit Interface Implementations
|
Improve this Doc
View Source
IDeserializationCallback.OnDeserialization(Object)
Declaration
void IDeserializationCallback.OnDeserialization(object sender)
Parameters
| Type |
Name |
Description |
| System.Object |
sender |
|
Implements
System.Runtime.Serialization.ISerializable
System.Runtime.Serialization.IDeserializationCallback