def rebuildGeomNodesToColPolys (incomingNode,relativeTo=None,filter=lambda n:True):
    parent = NodePath('cGeomConversionParent') 
    for c in incomingNode.findAllMatches('**/+GeomNode'): 
        if not filter(c): continue
        if relativeTo:
            xform=c.getMat(relativeTo).xformPoint
        else:
            xform=(c.getMat(incomingNode)*(incomingNode.getMat())).xformPoint
        geomNode = c.node() 
        for g in range(geomNode.getNumGeoms()): 
            geom = geomNode.getGeom(g).decompose() 
            vdata = geom.getVertexData() 
            vreader = GeomVertexReader(vdata, 'vertex') 
            cChild = CollisionNode("") 
            for p in range(geom.getNumPrimitives()): 
                prim = geom.getPrimitive(p) 
                for p2 in range(prim.getNumPrimitives()): 
                    s = prim.getPrimitiveStart(p2) 
                    e = prim.getPrimitiveEnd(p2) 
                    if e-s>2:
                        v = []
                        for vi in range (s, e): 
                            vreader.setRow(prim.getVertex(vi)) 
                            v.append(Point3(xform(vreader.getData3f())) )
                        colPoly = CollisionPolygon(*v) 
                        cChild.addSolid(colPoly) 
            n=parent.attachNewNode(cChild)   
    return parent
Converts GeomNodes into CollisionPolys in a straight 1-to-1 conversion 
dataset/ETHPy150Open Craig-Macomber/Panda3D-Terrain-System/collisionUtil.py/rebuildGeomNodesToColPolys