Empty Geom::BoundingBox instance methods return strange point objects
SketchUp Ruby API Issue
1. SketchUp/LayOut Version:
SketchUp
2. OS Platform:
Both
3. Describe briefly what you are doing and what is happening.
Empty Geom::BoundingBox instance methods return strange point objects with crazy large coordinates.
This might contribute to geometry FAR from the origin, if these coordinates are used to create geometry (in error.)
4. Describe what the expected result is.
I was expecting either an exception raised, or query methods to return nil until the bounding box becomes valid.
Perhaps Geom module could benefit from a new Geom::GeometryError exception subclass ?
bb.corner(3)
#=> Error: #<Geom::GeometryError: invalid Geom::BoundingBox instance for method :corner.>
It also brings up the idea that perhaps Geom::Point3d class needs #valid? checking method.
5. Reproducible code snippet:
b1 = Geom::BoundingBox.new
#<Geom::BoundingBox:0x0000000c5e85b0>
b1.corner(0)
#=> (1000000000000000000000000000000",
#=> 1000000000000000000000000000000",
#=> 1000000000000000000000000000000" )
p8 = b1.corner(7)
#=> (-1000000000000000000000000000000",
#=> -1000000000000000000000000000000",
#=> -1000000000000000000000000000000" )
I've never seen Point3d coordinates this large before !
That many inches is like: 15782828282828282828282828 miles.
These numbers are on the order of 1668246265.8206708 lightyears !
That's the distance light travels in 1.67 BILLION earth years.
Hm... What version of SketchUp is this observed in?
@thomthom Hm... What version of SketchUp is this observed in?
I'm seeing it in 2016 64-bit Ruby 2.0.0.
I see it as far back as SU2014 (didn't try any further). Wonder if it could be uninitialized variables...
Logged as SU-38425
Yea, happens on SU2013 as well.
And the numbers are not even as Point3d coords show ...
b1.corner(0)[0].to_i
#=> 1000000000000000019884624838656