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

getGeomExtents creates wrong data

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
ynapeu
331 Views, 4 Replies

getGeomExtents creates wrong data

When I subtract a second cylinder from a cylinder, the GeomExtent increases. Can something like this happen?

The Original Zylinder has (-15,-15,0) (15,15,100) 

the Zylinder with the differenz Solid is 0.00015 greater.

ynapeu_0-1692694415681.png

 

4 REPLIES 4
Message 2 of 5
tbrammer
in reply to: ynapeu

Which AutoCAD version are you using? I tested with AutoCAD 2020 and 2024 like this:

  • _SUBTRACT thin cylinder from tall cylinder
  • _LIST for the resulting cylinder using LUPREC=8. 

The result is shown in screenshot below. It equals the bounding box of the initial cylinder for both versions.

(German version. "Untere/Obere Begrenzung" = "Lower/Upper Boundary", "Begrenzungsrahmen"="Boundary box")

tbrammer_0-1693208143064.png

 

I didn't test getGeomExtents() explicitly. 

Can you please check whether getGeomExtents() yields different results than _LIST shows?

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 3 of 5
ynapeu
in reply to: tbrammer

Hello

The output from the list command is okay.

i use the following Code pEnt is the Solid

in Autocad 2022 the date will be okay, in Autocad 2024 i get some small differences.

AcDbExtents extents;
pEnt->getGeomExtents(extents);
AcGePoint3d amax;
amax = extents.maxPoint();
AcGePoint3d amin;
amin = extents.minPoint();
 
ads_printf(L"\nmax=%g,%g,%g  min=%g,%g,%g", amax.x, amax.y, amax.z, amin.x, amin.y, amin.z);
Message 4 of 5
tbrammer
in reply to: ynapeu

On my system I get on both AutoCAD 2022 and 2024:

 

  Name Value Type
maxpt {x=15.000150220923764 y=15.000000000000000 z=100.00000000000000 } AcGePoint3d

 

AcGeContext::gTol.equalPoint() is 1e-10.

AcGeContext::gTol.equalVector() is 1e-12.

 

0.00015 is several orders of magnitude larger than this. The ARX docs makes no statement about the exactness of getGeomExtents().  It would be interesting how AutoCAD calculates the dimensions that _LIST prints. Obviously the deviation should be visible with LUPREC=8.

 

If you need higher accuracy you could try to use the BREP API to analyze the 3DSOLID.

 

 

 

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 5 of 5
ynapeu
in reply to: tbrammer

You are right, both (Autocad 2022 and Autocad 2024) get the same result.

Thanks for yor help, the BREP creates correct results.

 

AcBrBrep myrep;
myrep.set(*(AcDb3dSolid*)pEnt);
AcGeBoundBlock3d block1;
myrep.getBoundBlock(block1);
block1.getMinMaxPoints(amin, amax);
ads_printf(L"\nbrepmax=%g,%g,%g min=%g,%g,%g", amax.x, amax.y, amax.z, amin.x, amin.y, amin.z);

 

this will print the correct Bounding box.

brepmax=15,65,100 min=-15,35,0

 

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report