class Edge |
Parent: Drawingelement |
|
Methods:all_connected, common_face, curve, end, faces, find_faces, length, line, other_vertex, reversed_in?, smooth=, smooth?, soft=, soft?, split, start, used_by?, verticies |
|
Sample Code: edgetests.rb |
|
Instance Methods |
all_connected |
The all_connected method retrieves all of the entities connected to an edge. |
Syntax: |
entities = edge.all_connected |
Arguments: |
|
Return Value: |
entities - the entities connected to the edge |
Comments: |
|
Example: |
depth = 100 |
common_face |
The common_face method is used to identify a face that is common to two edges. |
Syntax: |
face = edge1.common_face edge2 |
Arguments: |
edge2 - the face whose edge you are checking for commonality |
Return Value: |
face - the Face object that is common to the two edges if successful |
Comments: |
|
Example: |
depth = 100 |
curve |
The curve method is used to determine if an edge to see if it is a ArcCurve object. |
Syntax: |
arccurve = edge.curve |
Arguments: |
|
Return Value: |
arccurve - returns an ArcCurve object if it is a curve, false if it is not a curve |
Comments: |
|
Example: |
curve = edge.curve |
end |
The end method is used to retrieve the Vertex object at the end of the edge. |
Syntax: |
vertex = edge.end |
Arguments: |
|
Return Value: |
vertex - a Vertex object if successful |
Comments: |
|
Example: |
vertex = edge.end end |
faces |
The faces method is used to retrieve all of the faces common to the edge. |
Syntax: |
faces edge.faces |
Arguments: |
|
Return Value: |
faces - an array of Face objects if successful, false if unsuccessful |
Comments: |
|
Example: |
faces = edge.faces |
find_faces |
The find_faces method is used to find all Face objects that were created with this edge |
Syntax: |
number = edge.find_faces |
Arguments: |
|
Return Value: |
number - the number of faces found |
Comments: |
|
Example: |
depth = 100 |
length |
The length method is used to retrieve the length of an edge in current units. |
Syntax: |
length = edge.length |
Arguments: |
|
Return Value: |
length - the length of the edge in current units |
Comments: |
|
Example: |
length = edge.length |
line |
The line method is used to retrieve the line defined by the edge. |
Syntax: |
line = edge.line |
Arguments: |
|
Return Value: |
line - an array with a Point3d object and a Vector3d object. |
Comments: |
|
Example: |
depth = 100 |
other_vertex |
The other_vertex method is used to find the opposite vertex given one vertex of the edge. |
Syntax: |
vertex2 = edge.other_vertex vertex1 |
Arguments: |
vertex1 - one of the Vertex objects associated with the edge |
Return Value: |
vertex2 - the other Vertex object associated with the edge |
Comments: |
|
Example: |
# Get the end vertex of an edge end |
reversed_in? |
The reversed_in? method is used to determine if the EdgeUse object is traversed in the corresponding direction as its corresponding edge. |
Syntax: |
status = edge.reversed_in? face |
Arguments: |
face - the Face object that is bounded by the edge. |
Return Value: |
status - true if the edge is reversed, nil if it is not reversed. |
Comments: |
|
Example: |
begin end |
smooth= |
The smooth= method is used to set the edge to be smooth. |
Syntax: |
status = entity.smooth= value |
Arguments: |
value - true if you want the edge to be smooth, false if you do not want the edge to be smooth |
Return Value: |
status - true if successful, false if unsuccessful |
Comments: |
|
Example: |
#
Examine the current smooth setting on an edge |
smooth? |
The smooth? method is used to retrieve the current smooth setting for an edge. |
Syntax: |
status = edge.smooth? |
Arguments: |
|
Return Value: |
status - true if smooth, false if not smooth |
Comments: |
|
Example: |
# Examine the current smooth setting
on an edge |
soft= |
The smooth= method is used to set the edge to be soft. |
Syntax: |
status = entity.soft = value |
Arguments: |
value - true if you want the edge to be soft, false if you do not want the edge to be soft |
Return Value: |
status - true if successful, false if unsuccessful |
Comments: |
|
Example: |
# Examine the current soft setting on
an edge |
soft? |
The soft? method is used to retrieve the current smooth setting for an edge. |
Syntax: |
status = edge.soft? |
Arguments: |
|
Return Value: |
status - true if soft, false if not soft |
Comments: |
|
Example: |
# Examine the current soft setting on
an edge |
split |
The split method is used to to split an edge into to or more distinct edges. |
Syntax: |
edge = edge.split position |
Arguments: |
position - a Point3d object whose location is along the edge |
Return Value: |
edge - an Edge object if successful |
Comments: |
|
Example: |
depth = 100 # Get a Point3d for the end vertex # Returing 8' 4" or 100" # Put the new y position in the Point3d
object # Split the edge with the new Point3d
object (should get 2 edges on |
start |
The end method is used to retrieve the Vertex object at the start of the edge. |
Syntax: |
vertex = edge.start |
Arguments: |
|
Return Value: |
vertex - a Vertex object if successful |
Comments: |
|
Example: |
vertex
= edge.start end |
used_by? |
The used_by? method is used to see if a vertex is used by an edge. |
Syntax: |
status = edge.usedby? vertex |
Arguments: |
vertex - a Vertex object |
Return Value: |
status - true if the vertex belongs to the edge, false if the vertex does not belong to the edge |
Comments: |
|
Example: |
# Returns a vertex # Check to see if the vertex is used
by the edge |
vertices |
The vertices method is used to retrieve an Array object consisting of the two vertices for an edge. |
Syntax: |
vertices = edge.vertices |
Arguments: |
|
Return Value: |
vertices - an Array object of two Vertex objects |
Comments: |
|
Example: |
vertices = entity1.vertices |