.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GeometricExtents: different results between 2014 and 2015 with same data

2 REPLIES 2
Reply
Message 1 of 3
boberthinton
341 Views, 2 Replies

GeometricExtents: different results between 2014 and 2015 with same data

I can not find and explaination why the GeometricExtents property returns different results. In Autocad 2014 I start with a Solid3d entity, clone it, extract it's GeometricExtents, preform a Rotational Transformby operation extract it's GeometricExtents, but when I do the same thing in Autocad 2015 I get different results after the Rotational Transformby operation. The following are the results from the two different version of Autocad.

 

Autocad 2014
+ Solid.GeometricExtents {((184,1142,72.125),(187,1178,108.125))} Autodesk.AutoCAD.DatabaseServices.Extents3d
Matrix3d mat = {((1,0,0,0),(0,0.54030230586814,-0.841470984807897,611.62112447659),(0,0.841470984807897,0.54030230586814,-935.419650086278),(0,0,0,1))}
Solid.TransformBy(mat);
+ Solid.GeometricExtents {((184,1137.66230754565,83.9604013863321),(187,1187.40614600999,98.6229880718643))} Autodesk.AutoCAD.DatabaseServices.Extents3d

 

Autocad 2015
+ Solid.GeometricExtents {((184,1142,72.125),(187,1178,108.125))} Autodesk.AutoCAD.DatabaseServices.Extents3d
Matrix3d mat = {((1,0,0,0),(0,0.54030230586814,-0.841470984807897,611.62112447659),(0,0.841470984807897,0.54030230586814,-935.419650086278),(0,0,0,1))}
Solid.TransformBy(mat);
+ Solid.GeometricExtents {((184,1137.66230754565,64.509518375079),(187,1187.40614600999,114.253356839416))} Autodesk.AutoCAD.DatabaseServices.Extents3d

 

You can see that the Extents.Z results are quite different. Is these a bug? 

 

2 REPLIES 2
Message 2 of 3

If the values are different in two versions after performing the same operations, then it could well be a bug in one or the other. Which version do you consider to be correct, given the geometry you're using?

 

That said, the C++ function this wraps (getGeomExtents) makes no assertion that the bounding box returned must be a 'minimum' bounding box:

 

>>>

Unimplemented at the AcDbEntity level, this method is intended to be overridden in derived classes. 

Derived classes should calculate and return the corner points (in WCS coordinates) of a box (with edges parallel to the WCS X, Y, and Z axes) that encloses the 3D extents of the entity, and return those points as an instance of class AcDbExtents in the "extents" parameter.

<<<

 

If one of the planes of your bounding box intersects the solid, then that would definitely be a bug.

 

Cheers,

Stephen Preston
Autodesk Developer Network
Message 3 of 3

Stephen,

I believe 2014 returns the correct bounding box extents. I've used this routine with the last 4 releases of AutoCAD without issue.

 

I am aware that GeometricExtents does not return the smallest bounding box. My routine actually rotates the solid in all three axis and compares the volume before and after the rotation until the smallest volume is obtained. This is all in an attempt to get the overall dimension of a solid within a quarter of and inch of the actual dimension. If there is a better method I'd love to hear it.

 

I have done some more experimenting and have discovered that the routine works correctly in 2015 if the solid is created with ucs equal to the wcs. I find errors as described when a solid is created in a ucs other than wcs.

 

BCB

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost