parameters: (solid)
return_statement: return None
docstring: Return a Part shape (Face) from a DXF solid.
  
      It takes three or four points from a `solid`, if possible.
      It adds the first point again to the end of the points list, and creates
      a polygon, which is then used to create a face.
  
      Parameters
      ----------
      solid : drawing.entities
          The DXF object of type `'solid'`.
  
      Returns
      -------
      Part::TopoShape ('Face')
          The returned object is a `Part.Face`.
          It returns `None` if it fails producing a shape.
  
      See also
      --------
      drawBlock
docstring_summary: Return a Part shape (Face) from a DXF solid.
docstring_tokens: Return a Part shape ( Face ) from a DXF solid .
function: def drawSolid(solid):
      """Return a Part shape (Face) from a DXF solid.
  
      It takes three or four points from a `solid`, if possible.
      It adds the first point again to the end of the points list, and creates
      a polygon, which is then used to create a face.
  
      Parameters
      ----------
      solid : drawing.entities
          The DXF object of type `'solid'`.
  
      Returns
      -------
      Part::TopoShape ('Face')
          The returned object is a `Part.Face`.
          It returns `None` if it fails producing a shape.
  
      See also
      --------
      drawBlock
      """
      p4 = None
      p1x = rawValue(solid, 10)
      p1y = rawValue(solid, 20)
      p1z = rawValue(solid, 30) or 0
      p2x = rawValue(solid, 11)
      p2y = rawValue(solid, 21)
      p2z = rawValue(solid, 31) or p1z
      p3x = rawValue(solid, 12)
      p3y = rawValue(solid, 22)
      p3z = rawValue(solid, 32) or p1z
      p4x = rawValue(solid, 13)
      p4y = rawValue(solid, 23)
      p4z = rawValue(solid, 33) or p1z
      p1 = Vector(p1x, p1y, p1z)
      p2 = Vector(p2x, p2y, p2z)
      p3 = Vector(p3x, p3y, p3z)
      if p4x is not None:
          p4 = Vector(p4x, p4y, p4z)
      if p4 and (p4 != p3) and (p4 != p2) and (p4 != p1):
          try:
              return Part.Face(Part.makePolygon([p1, p2, p4, p3, p1]))
          except Part.OCCError:
              warn(solid)
      else:
          try:
              return Part.Face(Part.makePolygon([p1, p2, p3, p1]))
          except Part.OCCError:
              warn(solid)
      return None
function_tokens: def drawSolid ( solid ) : p4 = None p1x = rawValue ( solid , 10 ) p1y = rawValue ( solid , 20 ) p1z = rawValue ( solid , 30 ) or 0 p2x = rawValue ( solid , 11 ) p2y = rawValue ( solid , 21 ) p2z = rawValue ( solid , 31 ) or p1z p3x = rawValue ( solid , 12 ) p3y = rawValue ( solid , 22 ) p3z = rawValue ( solid , 32 ) or p1z p4x = rawValue ( solid , 13 ) p4y = rawValue ( solid , 23 ) p4z = rawValue ( solid , 33 ) or p1z p1 = Vector ( p1x , p1y , p1z ) p2 = Vector ( p2x , p2y , p2z ) p3 = Vector ( p3x , p3y , p3z ) if p4x is not None : p4 = Vector ( p4x , p4y , p4z ) if p4 and ( p4 != p3 ) and ( p4 != p2 ) and ( p4 != p1 ) : try : return Part . Face ( Part . makePolygon ( [ p1 , p2 , p4 , p3 , p1 ] ) ) except Part . OCCError : warn ( solid ) else : try : return Part . Face ( Part . makePolygon ( [ p1 , p2 , p3 , p1 ] ) ) except Part . OCCError : warn ( solid ) return None