I’ve noticed that when I have a generic buffer geometry, if I don’t set the type, the shape is indistinguishable. Is there a way to differentiate between triangles, rectangles, polygons, circles and arcs in this situation?
I can distinguish triangles, rectangles, and polygons, but I don’t know how to categorize circles and arcs.
Please share all sorts of mathematical knowledge and three.js tips.
This is a very complex task in the general case. If you know what types of shapes are possible – lines, squares, spheres, mushrooms, mickeymice, and so on – you may find a way to classify the shape. There are some algorithms for most shapes (e.g. Hough transform), but the most promissing results are given by well-trained neural networks. In any case, you might want to (re)search about Computer Vision algorithms for shape recognition.