Cone with negative radius

Hi,

ON_Cone::IsValid() in opennurbs_cone.cpp, line 59:

return (plane.IsValid() && height != 0.0 && radius != 0.0);

Should radius be tested on radius > 0.0 ? If negative radius is accepted (as a cone with inward directed normal - ON_Cone::NormalAt), than it is not clear why ON_Cone::CircleAt assumes that the radius is positive creating/manipulating a circle (which will be invalid in case of negative radius) without any checks. And why ON_Cone::Transform is always invalid for an “inverted” cone with negative radius…

Best regards,

Leo

Hi @lroytman,

I’ve logged an issue so we can review this.

https://mcneel.myjetbrains.com/youtrack/issue/RH-65062

– Dale

Hi Dale,

Thank you for your reply.
I am just going through OpenNurbs files familiarizing myself with Rhino internal data structures and algorithms. When some code seems to be bizarre, I post here. Not sure if it is useful or if there is a better communication channel for that.

Best regards,

Leo

No, this is the place report bizarre things.

– Dale

Good to know. Thank you!

Leo