def getExtendedLineSegment(extensionDistance, lineSegment, loopXIntersections):
 pointBegin = lineSegment[0].point
 pointEnd = lineSegment[1].point
 segment = (pointEnd - pointBegin)
 segmentLength = abs(segment)
 if (segmentLength <= 0.0):
  print 'This should never happen in getExtendedLineSegment in raft, the segment should have a length greater than zero.'
  print lineSegment
  return None
 segmentExtend = ((segment * extensionDistance) / segmentLength)
 lineSegment[0].point -= segmentExtend
 lineSegment[1].point += segmentExtend
 for loopXIntersection in loopXIntersections:
  setExtendedPoint(lineSegment[0], pointBegin, loopXIntersection)
  setExtendedPoint(lineSegment[1], pointEnd, loopXIntersection)
 return lineSegment

def getExtendedLineSegment ( extensionDistance , lineSegment , loopXIntersections ) : pointBegin = lineSegment [ 0 ] . point pointEnd = lineSegment [ 1 ] . point segment = ( pointEnd - pointBegin ) segmentLength = abs ( segment ) if ( segmentLength <= 0.0 ) : print 'This should never happen in getExtendedLineSegment in raft, the segment should have a length greater than zero.' print lineSegment return None segmentExtend = ( ( segment * extensionDistance ) / segmentLength ) lineSegment [ 0 ] . point -= segmentExtend lineSegment [ 1 ] . point += segmentExtend for loopXIntersection in loopXIntersections : setExtendedPoint ( lineSegment [ 0 ] , pointBegin , loopXIntersection ) setExtendedPoint ( lineSegment [ 1 ] , pointEnd , loopXIntersection ) return lineSegment
get extended line segment .