View Issue Details

IDProjectCategoryView StatusLast Update
0002382FreeCADBugpublic2015-12-30 08:56
Reporterhuskier Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionwon't fix 
PlatformWindowsOSWindows XPOS VersionSP3
Product Version0.15 
Fixed in Version0.16 
Summary0002382: BoundBox error with complex shape (different from APP(incorrect) and from GUI(correct))
DescriptionWhen the attached script file is executed in the FreeCAD's Python console, we obtained the incorrect BoundBox:
BoundBox (-0.123577, -0.123577, 0, 28, 15.1236, 100)

However, when we show the part in the GUI window with Part.show(myPart), and then use the GUI to get the BoundBox, and it is correct.
XLength = 28
YLength = 15
ZLength = 100

Steps To ReproduceRUN the attached script in the Python console window, then the incorrect BoundBox appears.
TagsNo tags attached.
FreeCAD Information

Activities

huskier

2015-12-29 14:14

reporter  

BoundBox_test.py (Attachment missing)

wmayer

2015-12-29 17:39

administrator   ~0006653

No, this is not a bug.

When a shape is not yet displayed it doesn't have a triangulation and then the cad kernel has to guess the bounding box. Therefore it always creates a bigger bounding box than needed. Usually this way a box is 10% bigger but it also happened that it's almost 100% bigger.

Once a shape is displayed it stores the triangulation information and the algorithm uses the mesh to compute a more precise box.

In your script
myPart.BoundBox => BoundBox (-0.123577, -0.123577, 0, 28, 15.1236, 100)
Part.show(myPart)
myPart.BoundBox => BoundBox (-1.11022e-016, -1.11022e-016, 0, 28, 15, 100)

In case it's relevant to have a precise box but don't want to show it you can call
myPart.tessellate(0.01) # accuracy

For further information have a look at http://opencascade.blogspot.de/2009/04/all-inclusive-bounding-box.html

huskier

2015-12-30 01:10

reporter   ~0006654

Thanks wmayer. one more question:
Which module is the tessellate interface belonging to?

Actually, I want to integrate the interface to the CADQuery library.

huskier

2015-12-30 05:11

reporter   ~0006655

I've got the answer on myself about the function tessellate.

Thanks wmayer for your help.

Issue History

Date Modified Username Field Change
2015-12-29 14:14 huskier New Issue
2015-12-29 14:14 huskier File Added: BoundBox_test.py
2015-12-29 17:39 wmayer Note Added: 0006653
2015-12-29 17:39 wmayer Status new => feedback
2015-12-30 01:10 huskier Note Added: 0006654
2015-12-30 01:10 huskier Status feedback => new
2015-12-30 05:11 huskier Note Added: 0006655
2015-12-30 08:56 wmayer Status new => closed
2015-12-30 08:56 wmayer Resolution open => won't fix
2015-12-30 08:56 wmayer Fixed in Version => 0.16