Header menu logo issie

SegmentHelpers Module

Helpers to work with visual segments and nets Includes functions to remove overlapping same-net segments We can assume different-net segments never overlap.

Functions and values

Function or value Description

allWireNets model

Full Usage: allWireNets model

Parameters:
Returns: (OutputPortId * Wire list) list

return a list of all the wire Nets in the model Each element has form (source port Id, list of wires driven by port)

model : Model
Returns: (OutputPortId * Wire list) list

distinctVisSegs considerEndSeg visSegs

Full Usage: distinctVisSegs considerEndSeg visSegs

Parameters:
    considerEndSeg : bool
    visSegs : (XYPos * XYPos) list

Returns: (XYPos * XYPos) list

Filter visSegs so that if they overlap with common start only the longest is kept. ASSUMPTION: in a connected Net this will remove all overlaps

considerEndSeg : bool
visSegs : (XYPos * XYPos) list
Returns: (XYPos * XYPos) list

distinctVisSegsPrecision visSegs

Full Usage: distinctVisSegsPrecision visSegs

Parameters:
Returns: (XYPos * XYPos) list

Filter visSegs so that if they overlap with common start only the longest is kept. More accurate version of distinctVisSegs. Use if the accuracy is needed.

visSegs : (XYPos * XYPos) list
Returns: (XYPos * XYPos) list

distinctVisibleSegsInNet

Full Usage: distinctVisibleSegsInNet

Returns: OutputPortId -> Model -> (XYPos * XYPos) list

return a lits of all the distinct visible segments visible segments in a Net are defined as a pair (start,end) of vertices. Filter visible segments so they do not overlap where segments overlap only the longest is taken ASSUMPTION: all overlaps are on segments with same starting point

Returns: OutputPortId -> Model -> (XYPos * XYPos) list

getVisualSegsFromNetWires isDistinct considerEndSeg model netWires

Full Usage: getVisualSegsFromNetWires isDistinct considerEndSeg model netWires

Parameters:
    isDistinct : bool
    considerEndSeg : bool
    model : Model
    netWires : Wire list

Returns: (XYPos * XYPos) list

input is a list of all the wires in a net. output a list of the visual segments. isDistinct = true => remove overlapping shorter segments

isDistinct : bool
considerEndSeg : bool
model : Model
netWires : Wire list
Returns: (XYPos * XYPos) list

isProperCrossing (arg1, arg2) (arg3, arg4)

Full Usage: isProperCrossing (arg1, arg2) (arg3, arg4)

Parameters:
Returns: bool

Returns true if two segments (seg1, seg2) cross in the middle (e.g. not a T junction). Segment crossings very close to being a T junction will be counted. That however should not happen? Seg1, seg2 are represented as pair of start and end vertices

arg0 : XYPos
arg1 : XYPos
arg2 : XYPos
arg3 : XYPos
Returns: bool

pvs (arg1, arg2)

Full Usage: pvs (arg1, arg2)

Parameters:
Returns: string

print a visual segment in an easy-toread form

arg0 : XYPos
arg1 : XYPos
Returns: string

visSegOrientation (arg1, arg2)

Full Usage: visSegOrientation (arg1, arg2)

Parameters:
Returns: Orientation

Input must be a pair of visula segment vertices (start, end). Returns segment orientation

arg0 : XYPos
arg1 : XYPos
Returns: Orientation

visibleSegments wId model

Full Usage: visibleSegments wId model

Parameters:
Returns: XYPos list

The visible segments of a wire, as a list of vectors, from source end to target end. Note that in a wire with n segments a zero length (invisible) segment at any index [1..n-2] is allowed which if present causes the two segments on either side of it to coalesce into a single visible segment. A wire can have any number of visible segments - even 1.

wId : ConnectionId
model : Model
Returns: XYPos list

visibleSegsInNetWithVertices isDistinct source model

Full Usage: visibleSegsInNetWithVertices isDistinct source model

Parameters:
Returns: (XYPos * XYPos) list

visible segments in a Net defined as a pair (start,end) of vertices. source: the source port driving the Net start is the segment end nearest the wire Source. isDistinct = true => filter visible segments so they do not overlap where segments overlap only the longest is taken ASSUMPTION: all overlaps are on segments with same starting point

isDistinct : bool
source : OutputPortId
model : Model
Returns: (XYPos * XYPos) list

visibleSegsWithVertices wire model

Full Usage: visibleSegsWithVertices wire model

Parameters:
Returns: (XYPos * XYPos) list

visible segments in a wire as a pair (start,end) of vertices. start is the segment end nearest the wire Source.

wire : Wire
model : Model
Returns: (XYPos * XYPos) list

Type something to start searching.