Selection part of a model instead of the whole model

I am trying to use panda3d to create an application which needs a 3D environment. In this application, the user can load a model and select surfaces on the model. If the user loads a cube and selects a point on one side then the whole face should be selected.

I am beginner in computer graphics and panda3D. I followed the online manual of selecting 3D objects using CollisionRay. But following the manual gives me the Nodepath of the model. What might help me is getting the GeomPrimitive which has the contact point and then also find other GeoPrimitives which are tangent to the original GeomPrimitive.

If anyone have better way to selecting surfaces, I am welcome to the idea.

This is hard to do with the collision system. Either you need to separate out the parts of the model, or you need to use a different approach.

A different approach might be to give each face a different color, and then render the object to a texture while having these colors applied, so that you can then sample the color of the pixel under the mouse cursor.