code: def to_debug_point(self, point: Union[Unit, Point2, Point3]) -> common_pb.Point:
          
          if isinstance(point, Unit):
              point = point.position3d
          return common_pb.Point(x=point.x, y=point.y, z=getattr(point, "z", 0))
docs: Helper function for point conversion