I wonder how can I detect the flat surfaces of any object added to the scene. I want to draw PlanGeometry on any detected flat surface from a small distance of my object and I know how can I draw it but I have not any idea how to detect a flat surface. Someone can give me any leads or maybe someone knows some library which can help me?
What exactly do you mean by "flat"? I assume you want to find the faces of an object that are part of the same plane? This can be done by computing the plane equation of a face and compare it to other faces. Three.js can be used to achieve this. Here is something to get you started:
normal and method .distanceToPoint(origin) of the face classequals(plane) methodUsing this algorithm, you should be able to group all faces of an object into groups which share a common plane.