Compatibility measures

Definitions and explanations on the defined compatibility measures can be found in (INSERT REF). Here are the details of the implementation.

Angle compatibility

Visibility compatibility

Further discussion on this can be found in this Issue in python.ForceBundle

<!–(TODO: INSERTAR DIAGRAMA) –>

The intersection between the visibility band of the Edge Q and the straight line given by the edge P is calculated with proyectedEdge. It calculates the direction perpendicular to Q using perpendicular_slope. After that, it calculates the intersection_point between the straight line defined by P and the lines that pass over source(Q) and target(Q) in that perpendicular direction.

ForceBundle.intersection_pointFunction
intersection_point(q0::Point, vecQ::Point, P::Edge)

Return the Point where the rect which pass over q0 with direction vecQ intersects the rect defined by the edge P.

Example

julia> q0 = Point(1.,1.)
julia> vecQ = Point(-1.,-1.)
julia> P = Edge(Point(-1.,2.), Point(1.,2.))
julia> intersection_point(q0,vecQ,P)
2-element Point{Float64} with indices SOneTo(2):
 2.0
 2.0
source
ForceBundle.perpendicular_slopeFunction
perpendicular_slope(P::Edge)

See an Edge as a vector and return a Point after rotating in π/2.

Example

Define P as an Edge

julia> P = Edge(Point(1.,3.), Point(5.,1.));

P as a vector is simple target(P) - source(P), ie Point(4.,-2.). Rotating in π/2 we obtain Point(2.,4.).

julia> perpendicular_slope(P)
2-element Point{Float64} with indices SOneTo(2):
 2.0
 4.0
source
ForceBundle.proyectedEdgeFunction
proyectedEdge(Q::Edge,P::Edge)

Calculate the intersection between the visibility band of Q and the rect defined by P, and return it as an Edge.

The visibility band of an Edge Q is defined as the space between the straight lines perpendicular to Q passing by source(Q) and target(Q).

source