def addSparseEndpointsFromSegment(doubleInfillWidth, endpoints, horizontalSegmentsDictionary, horizontalSegmentsDictionaryKey, infillSolidity, removedEndpoints, segment, solidSurfaceThickness, surroundingXIntersections):
 if (infillSolidity > 0.0):
  if (int(round((round((float(horizontalSegmentsDictionaryKey) * infillSolidity)) / infillSolidity))) == horizontalSegmentsDictionaryKey):
   endpoints += segment
   return
  if (abs((segment[0].point - segment[1].point)) < doubleInfillWidth):
   endpoints += segment
   return
  if (not isSegmentAround(horizontalSegmentsDictionary, (horizontalSegmentsDictionaryKey - 1), segment)):
   endpoints += segment
   return
  if (not isSegmentAround(horizontalSegmentsDictionary, (horizontalSegmentsDictionaryKey + 1), segment)):
   endpoints += segment
   return
 if (solidSurfaceThickness == 0):
  removedEndpoints += segment
  return
 if isSegmentCompletelyInAnIntersection(segment, surroundingXIntersections):
  removedEndpoints += segment
  return
 endpoints += segment

def addSparseEndpointsFromSegment ( doubleInfillWidth , endpoints , horizontalSegmentsDictionary , horizontalSegmentsDictionaryKey , infillSolidity , removedEndpoints , segment , solidSurfaceThickness , surroundingXIntersections ) : if ( infillSolidity > 0.0 ) : if ( int ( round ( ( round ( ( float ( horizontalSegmentsDictionaryKey ) * infillSolidity ) ) / infillSolidity ) ) ) == horizontalSegmentsDictionaryKey ) : endpoints += segment return if ( abs ( ( segment [ 0 ] . point - segment [ 1 ] . point ) ) < doubleInfillWidth ) : endpoints += segment return if ( not isSegmentAround ( horizontalSegmentsDictionary , ( horizontalSegmentsDictionaryKey - 1 ) , segment ) ) : endpoints += segment return if ( not isSegmentAround ( horizontalSegmentsDictionary , ( horizontalSegmentsDictionaryKey + 1 ) , segment ) ) : endpoints += segment return if ( solidSurfaceThickness == 0 ) : removedEndpoints += segment return if isSegmentCompletelyInAnIntersection ( segment , surroundingXIntersections ) : removedEndpoints += segment return endpoints += segment
add sparse endpoints from a segment .