Degenerated objects detection C++

Hi everybody,

I have noticed that some objects may affect the way the conduit are drawn in my code. I have not been able to isolate the problem but, when a nearly degenerated object (a cube with height 10^-10 or a surface compressed to a line) is the first in the database or it is selected, the colors of the conduit seem to be assigned randomly. Of course, if this rings you a bell I would be glad to hear your opinion on that, but at the moment I am just preventing the creation of such objects.
However I was wondering if you know any tool built in Rhino that is capable to detect such badly shaped objects. I have tried the IsValid() method but it seems to make an evaluation on topology rather than geometry of the object…
Thanks in advance,

Gennaro

I don’t know of such a tool in Rhino. How are these objects being created?

– Dale

They can be created in Rhino GUI (e.g. cube with height 10^-10), but generally they are the result of a scale transformation. I was thinking to use a volume/area or short edge check but I would like to avoid that if Rhino already does a similar check internally.

No Rhino does not perform any of those checks. Rhino does, however, endure an object is valid after transformation - ON_Geometry::IsValid().

– Dale

Thanks! I will find a way to deal with it!