Class DEdge (version 0.18)Description: An edge class An edge is a connection between points, usually participating in a larger context such as a polygon. An edge has a defined direction (from p1 to p2).
Method Overview
[const] bool !=( DEdge e )Description: Inequality test
[const] bool <( DEdge e )Description: Less operator
[const] bool ==( DEdge e )Description: Equality test
assign( DEdge other )Description: Assign the contents of another object to self This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.
[const] DBox bboxDescription: Return the bounding box of the edge.
[const] bool coincident?( DEdge e )Description: Coincidence check. Checks whether a edge is coincident with another edge. Coincidence is defined by being parallel and that at least one point of one edge is on the other edge.
[const] bool contains?( DPoint p )Description: Test whether a point is on an edge. A point is on a edge if it is on (or at least closer than a grid point to) the edge.
[const] bool contains_excl?( DPoint p )Description: Test whether a point is on an edge excluding the endpoints. A point is on a edge if it is on (or at least closer than a grid point to) the edge.
[const] bool crossed_by?( DEdge e )Description: Check, if an edge is cut by a line (given by an edge) This method returns true if p1 is in one semispace while p2 is in the other or one of them is on the line through the edge "e"
destroyDescription: Explicitly destroy the object Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.
[const] bool destroyedDescription: Tell, if the object was destroyed This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.
[const] double distance( DPoint p )Description: Distance between the edge and a point. Returns the distance between the edge and the point. The distance is signed which is negative if the point is to the "left" of the edge and positive if the point is to the "right". The distance is measured by projecting the point onto the line through the edge. If the edge is degenerated, the distance is not defined.
[const] double distance_abs( DPoint p )Description: Absolute distance between the edge and a point. Returns the distance between the edge and the point.
[const] DEdge dupDescription: Creates a copy of self.
[const] double dxDescription: The horizontal extend of the edge.
[const] double dx_absDescription: The absolute value of the horizontal extend of the edge.
[const] double dyDescription: The vertical extend of the edge.
[const] double dy_absDescription: The vertical extend of the edge.
ref DEdge enlarge( DPoint p )Description: Enlarges the edge. Enlarges the edge by the given distance and returns the enlarged edge. The edge is overwritten.
[const] DEdge enlarged( DPoint p )Description: Returns the enlarged edge Enlarges the edge by the given offset and returns the moved edge. The edge is not modified. Enlargement means that the first point is shifted by -p, the second by p.
[static] DEdge from_iedge( Edge int_edge )Description: Construct a floating-point coordinate edge from an integer coordinate edge Create a floating-point coordinate edge from an integer edge
[const] bool intersect?( DEdge e )Description: Intersection test. Returns true if the edges intersect. If the edges coincide, they also intersect. For degenerated edges, the intersection is mapped to point containment tests.
[const] bool is_degenerate?Description: Test for degenerated edge An edge is degenerate, if both end and start point are identical.
[const] bool is_parallel?( DEdge e )Description: Test for being parallel
[const] double lengthDescription: The length of the edge
ref DEdge move( DPoint p )Description: Moves the edge. Moves the edge by the given offset and returns the moved edge. The edge is overwritten.
[const] DEdge moved( DPoint p )Description: Returns the moved edge Moves the edge by the given offset and returns the moved edge. The edge is not modified.
[static] DEdge newDescription: Default constructor: creates a degenerated edge 0,0 to 0,0
[static] DEdge new( DPoint p1, DPoint p2 )
|
returns: | The orthogonal length (abs(dx)+abs(dy)) |
Description: The first point.
Description: The second point.
Description: Side of the pointdistanc
Returns -1 if the point is "left" of the edge, 0 if on and 1 if the point is "right" of the edge.
p: | The point to test. |
returns: | The side value |
Description: The square of the length of the edge
Description: Swap the points of the edge
Description: Convert to a string
Description: Transform the edge.
Transforms the edge with the given transformation. Does not modify the edge but returns the transformed edge.
t: | The transformation to apply. |
returns: | The transformed edge. |
Description: Transform the edge.
Transforms the edge with the given complex transformation. Does not modify the edge but returns the transformed edge.
t: | The transformation to apply. |
returns: | The transformed edge. |
Description: Shortcut for p1.x
Description: Shortcut for p2.x
Description: Shortcut for p1.y
Description: Shortcut for p2.y