Class Edge
An Edge is bounded by one or more vertices, referring to one Vertex at each end. Edges are
closely related to Coedges, which allows the Edge to occur in more than one
Face, thus makes it possible to create solids.
Implements
Inherited Members
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public sealed class Edge : ProjectObject, IGeometryObject, IHasGeometry
Remarks
The Edge object is generated on demand and is not stored in the station file; therefore Attributes cannot be used to persist attributes.
Properties
Body
Gets the Body the edge is part of.
Declaration
public Body Body { get; }
Property Value
Type | Description |
---|---|
Body |
Examples
Get Body
Project.UndoContext.BeginUndoStep("EdgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
// Get the edge associated with the coedge.
Edge myEdge = myCoedge.Edge;
// Output som info of the edge.
Logger.AddMessage(new LogMessage("The body of the edge is: " + myEdge.Body.Name));
Logger.AddMessage(new LogMessage("The length of edge is: " + myEdge.Length));
Logger.AddMessage(new LogMessage("The start vertex of the edge is : ("
+ myEdge.StartVertex.Position.x.ToString() + ", "
+ myEdge.StartVertex.Position.y.ToString() + ", "
+ myEdge.StartVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The end vertex of the edge is : ("
+ myEdge.EndVertex.Position.x.ToString() + ", "
+ myEdge.EndVertex.Position.y.ToString() + ", "
+ myEdge.EndVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The mid point of the edge is : ("
+ myEdge.MidPoint.x.ToString() + ", " + myEdge.MidPoint.y.ToString()
+ ", " + myEdge.MidPoint.z.ToString() + ")"));
// Try to get the centerpoint. It is only defined for eliptic edges
// and will throw an exception otherwise.
try
{
Logger.AddMessage(new LogMessage("The center point of the edge is : ("
+ myEdge.CenterPoint.x.ToString() + ", "
+ myEdge.CenterPoint.y.ToString() + ", "
+ myEdge.CenterPoint.z.ToString() + ")"));
}
catch
{
Logger.AddMessage(
new LogMessage("The center point is only defined for eliptic edges"));
}
// Get the tangent to the edge at the midpoint.
Vector3 tanget = myEdge.GetTangent(myEdge.MidPoint);
// Output the tangent.
Logger.AddMessage(new LogMessage("The tangent of the edge at the midpoint is : ("
+ tanget.x.ToString() + ", " + tanget.y.ToString() + ", "
+ tanget.z.ToString() + ")"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
CenterPoint
Gets the center point of the edge.
Declaration
public Vector3 CenterPoint { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Remarks
Center point is only defined for eliptic edges, this property will throw an exception if used on non eliptic edges.
Examples
Get Center Point
Project.UndoContext.BeginUndoStep("EdgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
// Get the edge associated with the coedge.
Edge myEdge = myCoedge.Edge;
// Output som info of the edge.
Logger.AddMessage(new LogMessage("The body of the edge is: " + myEdge.Body.Name));
Logger.AddMessage(new LogMessage("The length of edge is: " + myEdge.Length));
Logger.AddMessage(new LogMessage("The start vertex of the edge is : ("
+ myEdge.StartVertex.Position.x.ToString() + ", "
+ myEdge.StartVertex.Position.y.ToString() + ", "
+ myEdge.StartVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The end vertex of the edge is : ("
+ myEdge.EndVertex.Position.x.ToString() + ", "
+ myEdge.EndVertex.Position.y.ToString() + ", "
+ myEdge.EndVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The mid point of the edge is : ("
+ myEdge.MidPoint.x.ToString() + ", " + myEdge.MidPoint.y.ToString()
+ ", " + myEdge.MidPoint.z.ToString() + ")"));
// Try to get the centerpoint. It is only defined for eliptic edges
// and will throw an exception otherwise.
try
{
Logger.AddMessage(new LogMessage("The center point of the edge is : ("
+ myEdge.CenterPoint.x.ToString() + ", "
+ myEdge.CenterPoint.y.ToString() + ", "
+ myEdge.CenterPoint.z.ToString() + ")"));
}
catch
{
Logger.AddMessage(
new LogMessage("The center point is only defined for eliptic edges"));
}
// Get the tangent to the edge at the midpoint.
Vector3 tanget = myEdge.GetTangent(myEdge.MidPoint);
// Output the tangent.
Logger.AddMessage(new LogMessage("The tangent of the edge at the midpoint is : ("
+ tanget.x.ToString() + ", " + tanget.y.ToString() + ", "
+ tanget.z.ToString() + ")"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
EdgeType
Returns the type of the edge.
Declaration
public EdgeType EdgeType { get; }
Property Value
Type | Description |
---|---|
EdgeType |
EndVertex
Gets the end vertex of the edge.
Declaration
public Vertex EndVertex { get; }
Property Value
Type | Description |
---|---|
Vertex |
Examples
Get End Vertex
Project.UndoContext.BeginUndoStep("EdgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
// Get the edge associated with the coedge.
Edge myEdge = myCoedge.Edge;
// Output som info of the edge.
Logger.AddMessage(new LogMessage("The body of the edge is: " + myEdge.Body.Name));
Logger.AddMessage(new LogMessage("The length of edge is: " + myEdge.Length));
Logger.AddMessage(new LogMessage("The start vertex of the edge is : ("
+ myEdge.StartVertex.Position.x.ToString() + ", "
+ myEdge.StartVertex.Position.y.ToString() + ", "
+ myEdge.StartVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The end vertex of the edge is : ("
+ myEdge.EndVertex.Position.x.ToString() + ", "
+ myEdge.EndVertex.Position.y.ToString() + ", "
+ myEdge.EndVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The mid point of the edge is : ("
+ myEdge.MidPoint.x.ToString() + ", " + myEdge.MidPoint.y.ToString()
+ ", " + myEdge.MidPoint.z.ToString() + ")"));
// Try to get the centerpoint. It is only defined for eliptic edges
// and will throw an exception otherwise.
try
{
Logger.AddMessage(new LogMessage("The center point of the edge is : ("
+ myEdge.CenterPoint.x.ToString() + ", "
+ myEdge.CenterPoint.y.ToString() + ", "
+ myEdge.CenterPoint.z.ToString() + ")"));
}
catch
{
Logger.AddMessage(
new LogMessage("The center point is only defined for eliptic edges"));
}
// Get the tangent to the edge at the midpoint.
Vector3 tanget = myEdge.GetTangent(myEdge.MidPoint);
// Output the tangent.
Logger.AddMessage(new LogMessage("The tangent of the edge at the midpoint is : ("
+ tanget.x.ToString() + ", " + tanget.y.ToString() + ", "
+ tanget.z.ToString() + ")"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Length
Gets the length of the edge.
Declaration
public double Length { get; }
Property Value
Type | Description |
---|---|
Double |
Examples
Get Length
Project.UndoContext.BeginUndoStep("EdgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
// Get the edge associated with the coedge.
Edge myEdge = myCoedge.Edge;
// Output som info of the edge.
Logger.AddMessage(new LogMessage("The body of the edge is: " + myEdge.Body.Name));
Logger.AddMessage(new LogMessage("The length of edge is: " + myEdge.Length));
Logger.AddMessage(new LogMessage("The start vertex of the edge is : ("
+ myEdge.StartVertex.Position.x.ToString() + ", "
+ myEdge.StartVertex.Position.y.ToString() + ", "
+ myEdge.StartVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The end vertex of the edge is : ("
+ myEdge.EndVertex.Position.x.ToString() + ", "
+ myEdge.EndVertex.Position.y.ToString() + ", "
+ myEdge.EndVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The mid point of the edge is : ("
+ myEdge.MidPoint.x.ToString() + ", " + myEdge.MidPoint.y.ToString()
+ ", " + myEdge.MidPoint.z.ToString() + ")"));
// Try to get the centerpoint. It is only defined for eliptic edges
// and will throw an exception otherwise.
try
{
Logger.AddMessage(new LogMessage("The center point of the edge is : ("
+ myEdge.CenterPoint.x.ToString() + ", "
+ myEdge.CenterPoint.y.ToString() + ", "
+ myEdge.CenterPoint.z.ToString() + ")"));
}
catch
{
Logger.AddMessage(
new LogMessage("The center point is only defined for eliptic edges"));
}
// Get the tangent to the edge at the midpoint.
Vector3 tanget = myEdge.GetTangent(myEdge.MidPoint);
// Output the tangent.
Logger.AddMessage(new LogMessage("The tangent of the edge at the midpoint is : ("
+ tanget.x.ToString() + ", " + tanget.y.ToString() + ", "
+ tanget.z.ToString() + ")"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
MidPoint
Gets the mid point of the edge.
Declaration
public Vector3 MidPoint { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Examples
Get Mid Point
Project.UndoContext.BeginUndoStep("EdgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
// Get the edge associated with the coedge.
Edge myEdge = myCoedge.Edge;
// Output som info of the edge.
Logger.AddMessage(new LogMessage("The body of the edge is: " + myEdge.Body.Name));
Logger.AddMessage(new LogMessage("The length of edge is: " + myEdge.Length));
Logger.AddMessage(new LogMessage("The start vertex of the edge is : ("
+ myEdge.StartVertex.Position.x.ToString() + ", "
+ myEdge.StartVertex.Position.y.ToString() + ", "
+ myEdge.StartVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The end vertex of the edge is : ("
+ myEdge.EndVertex.Position.x.ToString() + ", "
+ myEdge.EndVertex.Position.y.ToString() + ", "
+ myEdge.EndVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The mid point of the edge is : ("
+ myEdge.MidPoint.x.ToString() + ", " + myEdge.MidPoint.y.ToString()
+ ", " + myEdge.MidPoint.z.ToString() + ")"));
// Try to get the centerpoint. It is only defined for eliptic edges
// and will throw an exception otherwise.
try
{
Logger.AddMessage(new LogMessage("The center point of the edge is : ("
+ myEdge.CenterPoint.x.ToString() + ", "
+ myEdge.CenterPoint.y.ToString() + ", "
+ myEdge.CenterPoint.z.ToString() + ")"));
}
catch
{
Logger.AddMessage(
new LogMessage("The center point is only defined for eliptic edges"));
}
// Get the tangent to the edge at the midpoint.
Vector3 tanget = myEdge.GetTangent(myEdge.MidPoint);
// Output the tangent.
Logger.AddMessage(new LogMessage("The tangent of the edge at the midpoint is : ("
+ tanget.x.ToString() + ", " + tanget.y.ToString() + ", "
+ tanget.z.ToString() + ")"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
StartVertex
Gets the start vertex of the edge.
Declaration
public Vertex StartVertex { get; }
Property Value
Type | Description |
---|---|
Vertex |
Examples
Get Start Vertex
Project.UndoContext.BeginUndoStep("EdgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
// Get the edge associated with the coedge.
Edge myEdge = myCoedge.Edge;
// Output som info of the edge.
Logger.AddMessage(new LogMessage("The body of the edge is: " + myEdge.Body.Name));
Logger.AddMessage(new LogMessage("The length of edge is: " + myEdge.Length));
Logger.AddMessage(new LogMessage("The start vertex of the edge is : ("
+ myEdge.StartVertex.Position.x.ToString() + ", "
+ myEdge.StartVertex.Position.y.ToString() + ", "
+ myEdge.StartVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The end vertex of the edge is : ("
+ myEdge.EndVertex.Position.x.ToString() + ", "
+ myEdge.EndVertex.Position.y.ToString() + ", "
+ myEdge.EndVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The mid point of the edge is : ("
+ myEdge.MidPoint.x.ToString() + ", " + myEdge.MidPoint.y.ToString()
+ ", " + myEdge.MidPoint.z.ToString() + ")"));
// Try to get the centerpoint. It is only defined for eliptic edges
// and will throw an exception otherwise.
try
{
Logger.AddMessage(new LogMessage("The center point of the edge is : ("
+ myEdge.CenterPoint.x.ToString() + ", "
+ myEdge.CenterPoint.y.ToString() + ", "
+ myEdge.CenterPoint.z.ToString() + ")"));
}
catch
{
Logger.AddMessage(
new LogMessage("The center point is only defined for eliptic edges"));
}
// Get the tangent to the edge at the midpoint.
Vector3 tanget = myEdge.GetTangent(myEdge.MidPoint);
// Output the tangent.
Logger.AddMessage(new LogMessage("The tangent of the edge at the midpoint is : ("
+ tanget.x.ToString() + ", " + tanget.y.ToString() + ", "
+ tanget.z.ToString() + ")"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Methods
Facet(Double, Double, Double, Double, Double, out Vector3[], out Double[])
Returns facets that approximate the edge.
Declaration
public bool Facet(double start, double end, double maxTolerance, double maxLength, double maxAngle, out Vector3[] points, out double[] parameters)
Parameters
Type | Name | Description |
---|---|---|
Double | start | Starting parameter. |
Double | end | Ending parameter. If less than start, the two are reversed. |
Double | maxTolerance | The desired maximum distance between the approximating facets and the real curve. Ignored if zero. |
Double | maxLength | The desired maximum length of each facet. Ignored if zero. |
Double | maxAngle | The desired maximum angle between the tangets of the two endpoints of any facet. Ignored if zero. |
Vector3[] | points | Returns the facet points on the curve. |
Double[] | parameters | Returns the parameters (t-values) of the facet points on the curve. |
Returns
Type | Description |
---|---|
Boolean | True if success. |
Remarks
At least one of the "max" arguments must be non-zero.
FindClosestVertex(Vector3)
Declaration
public Vertex FindClosestVertex(Vector3 testPoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | testPoint | The point which to find the closest vertex to. |
Returns
Type | Description |
---|---|
Vertex | The closest Vertex. |
Examples
Find Closest Vertex
Project.UndoContext.BeginUndoStep("EdgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
// Get the edge associated with the coedge.
Edge myEdge = myCoedge.Edge;
// Output som info of the edge.
Logger.AddMessage(new LogMessage("The body of the edge is: " + myEdge.Body.Name));
Logger.AddMessage(new LogMessage("The length of edge is: " + myEdge.Length));
Logger.AddMessage(new LogMessage("The start vertex of the edge is : ("
+ myEdge.StartVertex.Position.x.ToString() + ", "
+ myEdge.StartVertex.Position.y.ToString() + ", "
+ myEdge.StartVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The end vertex of the edge is : ("
+ myEdge.EndVertex.Position.x.ToString() + ", "
+ myEdge.EndVertex.Position.y.ToString() + ", "
+ myEdge.EndVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The mid point of the edge is : ("
+ myEdge.MidPoint.x.ToString() + ", " + myEdge.MidPoint.y.ToString()
+ ", " + myEdge.MidPoint.z.ToString() + ")"));
// Try to get the centerpoint. It is only defined for eliptic edges
// and will throw an exception otherwise.
try
{
Logger.AddMessage(new LogMessage("The center point of the edge is : ("
+ myEdge.CenterPoint.x.ToString() + ", "
+ myEdge.CenterPoint.y.ToString() + ", "
+ myEdge.CenterPoint.z.ToString() + ")"));
}
catch
{
Logger.AddMessage(
new LogMessage("The center point is only defined for eliptic edges"));
}
// Get the tangent to the edge at the midpoint.
Vector3 tanget = myEdge.GetTangent(myEdge.MidPoint);
// Output the tangent.
Logger.AddMessage(new LogMessage("The tangent of the edge at the midpoint is : ("
+ tanget.x.ToString() + ", " + tanget.y.ToString() + ", "
+ tanget.z.ToString() + ")"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
GetCoedges()
Declaration
public Coedge[] GetCoedges()
Returns
Type | Description |
---|---|
Coedge[] |
GetCurvature(Double)
Returns the curvature of a point on the edge that corresponds to the given parameter value.
Declaration
public Vector3 GetCurvature(double parameter)
Parameters
Type | Name | Description |
---|---|---|
Double | parameter | Parameter value. |
Returns
Type | Description |
---|---|
Vector3 | Curvature. |
GetFaces()
Declaration
public Face[] GetFaces()
Returns
Type | Description |
---|---|
Face[] |
GetLengthAtParameter(Double)
Returns the distance along this edge from the start.
Declaration
public double GetLengthAtParameter(double parameter)
Parameters
Type | Name | Description |
---|---|---|
Double | parameter | Parameter value. |
Returns
Type | Description |
---|---|
Double | Distance. |
GetParameterAtLength(Double)
Returns the parameter value at the given distance from the start.
Declaration
public double GetParameterAtLength(double length)
Parameters
Type | Name | Description |
---|---|---|
Double | length | Distance from start. |
Returns
Type | Description |
---|---|
Double | Parameter value. |
GetParameterAtPoint(Vector3)
Returns the parameter on the edge that corresponds to the given point value.
Declaration
public double GetParameterAtPoint(Vector3 point)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | Point value. |
Returns
Type | Description |
---|---|
Double | Parameter on the edge. |
GetParameterRange(out ParameterRange)
Gets the parameter (t-value) range of the edge.
Declaration
public bool GetParameterRange(out ParameterRange range)
Parameters
Type | Name | Description |
---|---|---|
ParameterRange | range | Returns the range. |
Returns
Type | Description |
---|---|
Boolean | False if the range is unbounded. |
GetPointAtParameter(Double)
Returns the point on the edge that corresponds to the given parameter value.
Declaration
public Vector3 GetPointAtParameter(double parameter)
Parameters
Type | Name | Description |
---|---|---|
Double | parameter | Parameter value. |
Returns
Type | Description |
---|---|
Vector3 | Point on the edge. |
GetTangent(Vector3)
Gets the tangent of the edge at the supplied point.
Declaration
public Vector3 GetTangent(Vector3 pointOnCurve)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | pointOnCurve | The point at which to get the tangent. |
Returns
Type | Description |
---|---|
Vector3 | The tangent to the edge at the supplied point |
Examples
Get tangent.
Project.UndoContext.BeginUndoStep("EdgeProperties");
try
{
Station station = Station.ActiveStation;
// Create a box.
Part myPart = new Part();
myPart.Name = "MyPart";
station.GraphicComponents.Add(myPart);
Body box = Body.CreateSolidBox(
new Matrix4(Vector3.XVector, 0.0), new Vector3(0.1, 0.1, 0.1));
box.Name = "MyBox";
myPart.Bodies.Add(box);
// Get a coedge from the box.
Coedge myCoedge = box.Shells[0].Faces[0].Loops[0].Coedges[0];
// Get the edge associated with the coedge.
Edge myEdge = myCoedge.Edge;
// Output som info of the edge.
Logger.AddMessage(new LogMessage("The body of the edge is: " + myEdge.Body.Name));
Logger.AddMessage(new LogMessage("The length of edge is: " + myEdge.Length));
Logger.AddMessage(new LogMessage("The start vertex of the edge is : ("
+ myEdge.StartVertex.Position.x.ToString() + ", "
+ myEdge.StartVertex.Position.y.ToString() + ", "
+ myEdge.StartVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The end vertex of the edge is : ("
+ myEdge.EndVertex.Position.x.ToString() + ", "
+ myEdge.EndVertex.Position.y.ToString() + ", "
+ myEdge.EndVertex.Position.z.ToString() + ")"));
Logger.AddMessage(new LogMessage("The mid point of the edge is : ("
+ myEdge.MidPoint.x.ToString() + ", " + myEdge.MidPoint.y.ToString()
+ ", " + myEdge.MidPoint.z.ToString() + ")"));
// Try to get the centerpoint. It is only defined for eliptic edges
// and will throw an exception otherwise.
try
{
Logger.AddMessage(new LogMessage("The center point of the edge is : ("
+ myEdge.CenterPoint.x.ToString() + ", "
+ myEdge.CenterPoint.y.ToString() + ", "
+ myEdge.CenterPoint.z.ToString() + ")"));
}
catch
{
Logger.AddMessage(
new LogMessage("The center point is only defined for eliptic edges"));
}
// Get the tangent to the edge at the midpoint.
Vector3 tanget = myEdge.GetTangent(myEdge.MidPoint);
// Output the tangent.
Logger.AddMessage(new LogMessage("The tangent of the edge at the midpoint is : ("
+ tanget.x.ToString() + ", " + tanget.y.ToString() + ", "
+ tanget.z.ToString() + ")"));
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
GetTangent(Double)
Returns the tangent of the edge at the given parameter value.
Declaration
public Vector3 GetTangent(double parameter)
Parameters
Type | Name | Description |
---|---|---|
Double | parameter | Parameter value. |
Returns
Type | Description |
---|---|
Vector3 | Tangent direction. |
IsParameterValid(Double)
Returns true if the given parameter is valid for this Edge, i.e. within its parameter range.
Declaration
public bool IsParameterValid(double parameter)
Parameters
Type | Name | Description |
---|---|---|
Double | parameter | The parameter value to test |
Returns
Type | Description |
---|---|
Boolean |