def get_geom_with_class(geom, class_):
    """
    I don't know why. The debug of Pycharm cannot work for this func due to some cpp wrapping.
    But it works quite good.
    """
    # original property
    o_vdata = geom.modifyVertexData()
    o_numrow = o_vdata.getNumRows()
    o_format = o_vdata.getFormat()

    if "cls" not in get_names(o_vdata):
        new_format = copy(o_format)
        class_array = GeomVertexArrayFormat()
        class_array.addColumn("cls", 1, Geom.NTInt8, Geom.CIndex)
        new_format.addArray(class_array)
        class_format = GeomVertexFormat.registerFormat(new_format)
        o_vdata.setFormat(class_format)

        class_writer = GeomVertexWriter(o_vdata, "cls")

        while not class_writer.isAtEnd():
            class_writer.setData1i(class_)
    return o_vdata

    I don't know why. The debug of Pycharm cannot work for this func due to some cpp wrapping.
    But it works quite good.
    
metadrive/utils/vertex.py