Hi,
is there any way (sure it is, but I don’t know it :D) to determine the model’s geometry type (I mean if it’s a cube, a cone etc.) by its vertices?
Thanks
Hi,
is there any way (sure it is, but I don’t know it :D) to determine the model’s geometry type (I mean if it’s a cube, a cone etc.) by its vertices?
Thanks
Hi
Just the idea not maya way…
not exactly by vetices but by the number of corners it have:
1 corner : cone
8 corner with equal dist btwn them : cube or lse cuboid
no corner : sphere
Are you asking for a geometric, analytic solution (analyse geometry and figure out the best fitting primitive), or are you asking if, given a point selection in Maya on an object you know comes from a primitive, you can find the originator?
If the latter, yes, from the point you can get the shape, and from the shape you can inspect the connections and find the generator node, the type of that will tell you what primitive/node it is.
If you are asking for an analytical method to look at a point cloud and find out what primitive it’s closest to, that’s a rather involved exercise and can vary in complexity depending on how many anomalies you expect to tolerate (e.g. sphere could be a sphere with one point caved in) and how many shapes you want to support.
There are techniques, but you basically have to perform many fitting checks and find the one with the least variance.
E.G. for a sphere with no anomalies you could check if all points lie at a similar distance from the centre. For a cube you would realize the minimal aligned bounding box and check that all points sit reasonably close to its side planes. For a cylinder you would take the minimal aligned bounding box and check that all its points are similarly distant from the centerline. And so on. Then you pick the test that returned the best (least) difference from its rules.