Rhino3dmIO, wrong bounding boxes from annotation objects

Hello,

I need bound boxes from all document objects. When got from curves they are correct, when got from annotations they are wrong, but not too much. Example:

The correct bounding box is: x0,y0= 10.13, 4.96 x1,y1= 17.70, 9
The reported bound box is: x0,y0= 10.13, 0.96 x1,y1= 17.70, 5

If I use as bounding box origin the annotation plane origin and keep the dx and dy above I get a better, but still wrong, result:

x0,y0= 10, 5 x1,y1= 17.57, 9.04

I’m using Rhino3dmIO v 6.27.20176.5001 under Visual Studio 2015. I read them like this: Rhino.Geometry.BoundingBox bb = o.Geometry.GetBoundingBox(true);

Any idea? Thanks. L

@lowell - is this something you can help with?

Please post a simple example 3dm file and script so I can see clearly what’s up.
Thanks

Lowel,

here it is:

using System;
using Rhino.FileIO;
namespace gridExtractor
{
    class Program
    {
        static void Main(string[] args)
        {
            File3dm rhinoFile = File3dm.Read(@"C:\Users\lscandella\data\gucci\Rhinoceros\gridExtractor\gridExtractor\txt.3dm");
            File3dmObjectTable objectTable = rhinoFile.Objects;
            foreach (File3dmObject o in objectTable)
            {
                Rhino.Geometry.BoundingBox bb = o.Geometry.GetBoundingBox(true);
                Console.WriteLine("Bounding box x0,y0,x1,y1: " + bb.Min.X.ToString() + " " + bb.Min.Y.ToString() + " " + bb.Max.X.ToString() + " " + bb.Max.Y.ToString());
            }
            Console.WriteLine("Press any key to stop...");
            Console.ReadKey();
        }
    }
}

Please rename the path to point to the attached filetxt.3dm (21.8 KB)

and forget my ideas about the annotation plane. The problem is text formatting. Apparently the boundingBox method does not care about it. In the example file you find a simple string “Txt” aligned on the left and on the bottom. The method reports it bounding box as if it were aligned on the left and on the top.

Thanks. L

@lscandella - Thanks for the report - There’s a bug in the dotnet interface for annotation bounding box.

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

Lowell,
is the C++ lib OK?
Thanks. L

Yes, the bug had to do with the rhino common wrapper not getting the right dimstyle

RH-59566 is fixed in the latest Service Release Candidate

Brian,

I’m confused. Isn’t the bug in the Rhino3dmIO library? How can a Rhino 6 update fix it?

Thanks. L

Hi @lscandella,

When SR29 is released there will be an SR29 build of Rhino3dmIO available on NuGet.

– Dale