parameters: (shape, direction, tess=None)
docstring: Project shape in a given direction.
  
      It uses `Drawing.projectEx(shape, direction)`
      to return a list with all the parts of the projection.
      The first five elements are added to a list of edges,
      which are then put in a `Part.Compound`.
  
      Parameters
      ----------
      shape : Part.Shape
          Any shape previously created from a DXF file.
  
      direction : Base::Vector3
          The direction of the projection.
  
      tess : list, optional
          It defaults to `None`. If it is available, it is a list with
          two elements, `[True, segment_length]` which are used by
          `DraftGeomUtils.cleanProjection(compound, tess[0], tess[1])`
          to create a valid compound of edges.
  
          Otherwise, a simple `Part.Compound` is produced.
  
      Returns
      -------
      Part::TopoShape ('Compound')
          A `Part.Compound` of edges.
  
          It returns the original `shape` if it fails producing the projection
          in the given `direction`.
  
      See also
      --------
      Drawing.projectEx, DraftGeomUtils.cleanProjection
docstring_summary: Project shape in a given direction.
docstring_tokens: Project shape in a given direction .
function: def projectShape(shape, direction, tess=None):
      """Project shape in a given direction.
  
      It uses `Drawing.projectEx(shape, direction)`
      to return a list with all the parts of the projection.
      The first five elements are added to a list of edges,
      which are then put in a `Part.Compound`.
  
      Parameters
      ----------
      shape : Part.Shape
          Any shape previously created from a DXF file.
  
      direction : Base::Vector3
          The direction of the projection.
  
      tess : list, optional
          It defaults to `None`. If it is available, it is a list with
          two elements, `[True, segment_length]` which are used by
          `DraftGeomUtils.cleanProjection(compound, tess[0], tess[1])`
          to create a valid compound of edges.
  
          Otherwise, a simple `Part.Compound` is produced.
  
      Returns
      -------
      Part::TopoShape ('Compound')
          A `Part.Compound` of edges.
  
          It returns the original `shape` if it fails producing the projection
          in the given `direction`.
  
      See also
      --------
      Drawing.projectEx, DraftGeomUtils.cleanProjection
      """
      import Drawing
      edges = []
      try:
          groups = Drawing.projectEx(shape, direction)
      except Part.OCCError:
          print("unable to project shape on direction ", direction)
          return shape
      else:
          for g in groups[0:5]:
              if g:
                  edges.append(g)
          # return DraftGeomUtils.cleanProjection(Part.makeCompound(edges))
          if tess:
              return DraftGeomUtils.cleanProjection(Part.makeCompound(edges),
                                                    tess[0], tess[1])
          else:
              return Part.makeCompound(edges)
function_tokens: def projectShape ( shape , direction , tess = None ) : import Drawing edges = [ ] try : groups = Drawing . projectEx ( shape , direction ) except Part . OCCError : print ( "unable to project shape on direction " , direction ) return shape else : for g in groups [ 0 : 5 ] : if g : edges . append ( g ) # return DraftGeomUtils.cleanProjection(Part.makeCompound(edges)) if tess : return DraftGeomUtils . cleanProjection ( Part . makeCompound ( edges ) , tess [ 0 ] , tess [ 1 ] ) else : return Part . makeCompound ( edges )