BoundsCalculator - WW.Cad.NetStandard vs CadLib 4.0

1
rainier934
7/15/2021 6:32 PM

Has the behavior for BoundsCalculator changed significantly in NetStandard? I have noticed with the same dwg that CadLib 4.0 calculates bounds differently than the NetStandard version. What can I do to get the calculator to work like it did in CadLib 4.0? I have tried multiple drawings and observed the same behavior. See details below. The numbers are rounded to the nearest whole number. You will notice the greatest deviation occurs on Corner 1 X and Corner 2 Y values. I can't figure out why it would do this.

In CadLib 4.0 it would calculate bounds as
Corner 1: 65, 4775, -8 E-12
Corner 2: 18215, 11174, 45

Same dwg in NetStandard calculates as
Corner 1: -1845, 4268, -8 E-12
Corner 2: 18214, 23434, 45

rainier934
7/15/2021 6:54 PM

Code reads like this. Let me know if you need a drawing file. I can email it to you.

BoundsCalculator boundsCalculator = new BoundsCalculator();
boundsCalculator.GetBounds(DwgReader.Read(autoCadStream));
Bounds3D bounds = boundsCalculator.Bounds;

Wout
7/15/2021 11:37 PM

Is this the trial version? Since it puts extra text in, that will affect the bounds.

- Wout

rainier934
7/16/2021 11:42 AM

It is the trial version yes. So are the watermarks being added in the dwg read output? I thought it was just in the svg export. It almost seems like the watermarks are forcing the bounding box to be a square.

Wout
7/16/2021 11:53 AM

Yes, because the trial texts are added in a square.

- Wout

rainier934
7/16/2021 12:11 PM

Okay that makes sense. Thanks Wout!

1