parameters: (arcEdge)
return_statement: return splitlist
docstring: filterArcs(Edge) -used to split an arc that is over 180 degrees. Returns list
docstring_summary: filterArcs(Edge) -used to split an arc that is over 180 degrees. Returns list
docstring_tokens: filterArcs ( Edge ) - used to split an arc that is over 180 degrees . Returns list
function: def filterArcs(arcEdge):
      """filterArcs(Edge) -used to split an arc that is over 180 degrees. Returns list"""
      PathLog.track()
      splitlist = []
      if isinstance(arcEdge.Curve, Part.Circle):
          angle = abs(arcEdge.LastParameter - arcEdge.FirstParameter)  # Angle in radians
          goodarc = angle <= math.pi
  
          if goodarc:
              splitlist.append(arcEdge)
          else:
              arcstpt = arcEdge.valueAt(arcEdge.FirstParameter)
              arcmid = arcEdge.valueAt(
                  (arcEdge.LastParameter - arcEdge.FirstParameter) * 0.5
                  + arcEdge.FirstParameter
              )
              arcquad1 = arcEdge.valueAt(
                  (arcEdge.LastParameter - arcEdge.FirstParameter) * 0.25
                  + arcEdge.FirstParameter
              )  # future midpt for arc1
              arcquad2 = arcEdge.valueAt(
                  (arcEdge.LastParameter - arcEdge.FirstParameter) * 0.75
                  + arcEdge.FirstParameter
              )  # future midpt for arc2
              arcendpt = arcEdge.valueAt(arcEdge.LastParameter)
              # reconstruct with 2 arcs
              arcseg1 = Part.ArcOfCircle(arcstpt, arcquad1, arcmid)
              arcseg2 = Part.ArcOfCircle(arcmid, arcquad2, arcendpt)
  
              eseg1 = arcseg1.toShape()
              eseg2 = arcseg2.toShape()
              splitlist.append(eseg1)
              splitlist.append(eseg2)
  
      elif isinstance(arcEdge.Curve, Part.LineSegment):
          pass
      return splitlist
function_tokens: def filterArcs ( arcEdge ) : PathLog . track ( ) splitlist = [ ] if isinstance ( arcEdge . Curve , Part . Circle ) : angle = abs ( arcEdge . LastParameter - arcEdge . FirstParameter ) # Angle in radians goodarc = angle <= math . pi if goodarc : splitlist . append ( arcEdge ) else : arcstpt = arcEdge . valueAt ( arcEdge . FirstParameter ) arcmid = arcEdge . valueAt ( ( arcEdge . LastParameter - arcEdge . FirstParameter ) * 0.5 + arcEdge . FirstParameter ) arcquad1 = arcEdge . valueAt ( ( arcEdge . LastParameter - arcEdge . FirstParameter ) * 0.25 + arcEdge . FirstParameter ) # future midpt for arc1 arcquad2 = arcEdge . valueAt ( ( arcEdge . LastParameter - arcEdge . FirstParameter ) * 0.75 + arcEdge . FirstParameter ) # future midpt for arc2 arcendpt = arcEdge . valueAt ( arcEdge . LastParameter ) # reconstruct with 2 arcs arcseg1 = Part . ArcOfCircle ( arcstpt , arcquad1 , arcmid ) arcseg2 = Part . ArcOfCircle ( arcmid , arcquad2 , arcendpt ) eseg1 = arcseg1 . toShape ( ) eseg2 = arcseg2 . toShape ( ) splitlist . append ( eseg1 ) splitlist . append ( eseg2 ) elif isinstance ( arcEdge . Curve , Part . LineSegment ) : pass return splitlist