parameters: (obj)
return_statement: return None
docstring: isVertical(obj) ... answer True if obj points into Z
docstring_summary: isVertical(obj) ... answer True if obj points into Z
docstring_tokens: isVertical ( obj ) ... answer True if obj points into Z
function: def isVertical(obj):
      """isVertical(obj) ... answer True if obj points into Z"""
      if type(obj) == FreeCAD.Vector:
          return isRoughly(obj.x, 0) and isRoughly(obj.y, 0)
  
      if obj.ShapeType == "Face":
          if type(obj.Surface) == Part.Plane:
              return isHorizontal(obj.Surface.Axis)
          if type(obj.Surface) == Part.Cylinder or type(obj.Surface) == Part.Cone:
              return isVertical(obj.Surface.Axis)
          if type(obj.Surface) == Part.Sphere:
              return True
          if type(obj.Surface) == Part.SurfaceOfExtrusion:
              return isVertical(obj.Surface.Direction)
          if type(obj.Surface) == Part.SurfaceOfRevolution:
              return isHorizontal(obj.Surface.Direction)
          if type(obj.Surface) != Part.BSplineSurface:
              PathLog.info(
                  translate("PathGeom", "face %s not handled, assuming not vertical")
                  % type(obj.Surface)
              )
          return None
  
      if obj.ShapeType == "Edge":
          if type(obj.Curve) == Part.Line or type(obj.Curve) == Part.LineSegment:
              return isVertical(obj.Vertexes[1].Point - obj.Vertexes[0].Point)
          if (
              type(obj.Curve) == Part.Circle or type(obj.Curve) == Part.Ellipse
          ):  # or type(obj.Curve) == Part.BSplineCurve:
              return isHorizontal(obj.Curve.Axis)
          if type(obj.Curve) == Part.BezierCurve:
              # the current assumption is that a bezier curve is vertical if its end points are vertical
              return isVertical(obj.Curve.EndPoint - obj.Curve.StartPoint)
          if type(obj.Curve) != Part.BSplineCurve:
              PathLog.info(
                  translate("PathGeom", "edge %s not handled, assuming not vertical")
                  % type(obj.Curve)
              )
          return None
  
      PathLog.error(translate("PathGeom", "isVertical(%s) not supported") % obj)
      return None
function_tokens: def isVertical ( obj ) : if type ( obj ) == FreeCAD . Vector : return isRoughly ( obj . x , 0 ) and isRoughly ( obj . y , 0 ) if obj . ShapeType == "Face" : if type ( obj . Surface ) == Part . Plane : return isHorizontal ( obj . Surface . Axis ) if type ( obj . Surface ) == Part . Cylinder or type ( obj . Surface ) == Part . Cone : return isVertical ( obj . Surface . Axis ) if type ( obj . Surface ) == Part . Sphere : return True if type ( obj . Surface ) == Part . SurfaceOfExtrusion : return isVertical ( obj . Surface . Direction ) if type ( obj . Surface ) == Part . SurfaceOfRevolution : return isHorizontal ( obj . Surface . Direction ) if type ( obj . Surface ) != Part . BSplineSurface : PathLog . info ( translate ( "PathGeom" , "face %s not handled, assuming not vertical" ) % type ( obj . Surface ) ) return None if obj . ShapeType == "Edge" : if type ( obj . Curve ) == Part . Line or type ( obj . Curve ) == Part . LineSegment : return isVertical ( obj . Vertexes [ 1 ] . Point - obj . Vertexes [ 0 ] . Point ) if ( type ( obj . Curve ) == Part . Circle or type ( obj . Curve ) == Part . Ellipse ) : # or type(obj.Curve) == Part.BSplineCurve: return isHorizontal ( obj . Curve . Axis ) if type ( obj . Curve ) == Part . BezierCurve : # the current assumption is that a bezier curve is vertical if its end points are vertical return isVertical ( obj . Curve . EndPoint - obj . Curve . StartPoint ) if type ( obj . Curve ) != Part . BSplineCurve : PathLog . info ( translate ( "PathGeom" , "edge %s not handled, assuming not vertical" ) % type ( obj . Curve ) ) return None PathLog . error ( translate ( "PathGeom" , "isVertical(%s) not supported" ) % obj ) return None