View Issue Details

IDProjectCategoryView StatusLast Update
0004622FreeCADBugpublic2021-08-17 16:46
Reportergreyltc Assigned Tochennes  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSArch LinuxOS Version5.11.11
Product Version0.19 
Fixed in Version0.20 
Summary0004622: OpenSCAD/OpenSCADTest/app/test_importCSG.py assertion failure
DescriptionI have an OpenSCAD test failing on recent builds from git

======================================================================
FAIL: test_import_resize (OpenSCADTest.app.test_importCSG.TestImportCSG)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Mod/OpenSCAD/OpenSCADTest/app/test_importCSG.py", line 352, in test_import_resize
    self.assertAlmostEqual (object.Shape.BoundBox.XLength, 2*8.5, 1)
AssertionError: 25.499999999999996 != 17.0 within 1 places (8.499999999999996 difference)
Steps To Reproduce- have a recent stable release of occt installed (tested here with 7.5.0)
- build the latest commit from the master git branch ( a855033f215014d993fc067ea6d6ba89f0a369d5 as of this writing)
- run the built in tests with `FreeCADCmd --console --run-test 0`
TagsNo tags attached.
FreeCAD Informationwith commit a855033 from the master branch
==============
Summary report
==============

-- Build type: None
-- Compiler: /usr/lib/ccache/bin/c++ (10.2.0)
-- Flags: -Wall -Wextra -Wno-write-strings -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fPIC -w
-- Standard: Requires C++14
-- Python: 3.9.2 [/usr/bin/python] [.cpython-39-x86_64-linux-gnu]
-- PCL: not enabled
-- pybind11: not enabled
-- Boost: 1.75.0 (1.75.0)
-- XercesC: 3.2.3 [/usr/lib/libxerces-c.so] [/usr/include]
-- ZLIB: 1.2.11
-- PyCXX: 6.2.8 [/home/grey/git/freecad-git/src/FreeCAD/src]
-- OCC: 7.5.0 [TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBool;TKBO;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEPBase;TKSTEPAttr;TKSTEP209;TKSTEP;TKHLR;TKFeat] [/usr/lib] [/usr/include/opencascade]
-- SMESH: build internal
-- MEDFile: 4.1.0 [/usr/lib/libmedC.so;/usr/lib/libmed.so] [/usr/include]
-- HDF5: 1.12.0
-- VTK: 8.2.0
-- NETGEN: not enabled
-- SWIG: 4.0.2
-- Eigen3 3.3.9
-- Qt5Core: 5.15.2
-- Qt5Network: 5.15.2
-- Qt5Xml: 5.15.2
-- Qt5XmlPatterns: 5.15.2
-- Qt5Widgets: 5.15.2
-- Qt5PrintSupport: 5.15.2
-- Qt5OpenGL: 5.15.2
-- Qt5Svg: 5.15.2
-- Qt5UiTools: 5.15.2
-- Qt5Concurrent: 5.15.2
-- Qt5WebKitWidgets: 5.212.0
-- Shiboken2: 5.15.2 [/usr/lib64/cmake/Shiboken2-5.15.2] [/usr/include/shiboken2;/usr/include/python3.9]
-- PySide2: 5.15.2 [/usr/include/PySide2]
-- PySide2Tools: [/usr/bin/uic-qt5] [/usr/bin/rcc-qt5]
-- Freetype: 2.10.4
-- OpenGL: /usr/lib/libGL.so
-- OpenGLU: [/usr/lib/libGLU.so][/usr/include]
-- Coin3D: 4.0.1 [Coin] []
-- Pivy: 0.6.5
-- SPNAV: [/usr/lib/libspnav.so] [/usr/include]
-- Matplotlib: 3.4.1
-- Rift: not enabled (BUILD_VR)
-- Doxygen: 1.9.1
-- Language: English
-- Coin3D_DOC: not found

Activities

chennes

2021-04-12 18:19

administrator   ~0015611

@greyltc I am having a hard time reproducing this -- when you have a minute, could you use the OpenSCAD workbench to insert the following object and then save and attach the resulting FCStd file?

resize(newsize = [0,0,10], auto = [0,0,0]) {
    sphere($fn = 96, $fa = 12, $fs = 2, r = 8.5);
}

floesche

2021-04-18 00:58

reporter   ~0015614

I see the same error, built from commit 33cca2e6c6a6ace4b1203a9ad0f9002a6c841e99.

Attached the requested FCStd file.
Issue-4622.FCStd (5,069 bytes)

chennes

2021-04-18 22:10

administrator   ~0015615

Thanks, @floesche -- the object in your FCStd file has the correct bounding box, so probably the test just needs a recompute() before the check. What kind of system are you on?

floesche

2021-04-18 22:20

reporter   ~0015616

Last edited: 2021-04-18 22:30

Very similar to @greyltc, just python is at 3.9.3 by now and the kernel at 5.11.15. Do you need any other information?


==============                                                                                                                                                                                               [33/583]
Summary report
==============

-- Build type:          None
-- Compiler:            /usr/bin/c++ (10.2.0)
-- Flags:               -Wall -Wextra -Wno-write-strings  -fPIC -w
-- Standard:            Requires C++14
-- Python:              3.9.3 [/usr/bin/python] [.cpython-39-x86_64-linux-gnu]
-- PCL:                 not enabled
-- pybind11:            not enabled
-- Boost:               1.75.0 (1.75.0)
-- XercesC:             3.2.3 [/usr/lib/libxerces-c.so] [/usr/include]
-- ZLIB:                1.2.11
-- PyCXX:               6.2.8 [./src]
-- OCC:                 7.5.0 [TKFillet;TKMesh;TKernel;TKG2d;TKG3d;TKMath;TKIGES;TKSTL;TKShHealing;TKXSBase;TKBool;TKBO;TKBRep;TKTopAlgo;TKGeomAlgo;TKGeomBase;TKOffset;TKPrim;TKSTEPBase;TKSTEPAttr;TKSTEP209;TKSTEP
;TKHLR;TKFeat] [/usr/lib] [/usr/include/opencascade]
-- SMESH:               build internal
--  MEDFile:            4.1.0 [/usr/lib/libmedC.so;/usr/lib/libmed.so] [/usr/include]
--  HDF5:               1.12.0
--  VTK:                8.2.0
-- NETGEN:              not enabled
-- SWIG:                4.0.2
-- Eigen3               3.3.9
-- Qt5Core:             5.15.2
-- Qt5Network:          5.15.2
-- Qt5Xml:              5.15.2
-- Qt5XmlPatterns:      5.15.2
-- Qt5Widgets:          5.15.2
-- Qt5PrintSupport:     5.15.2
-- Qt5OpenGL:           5.15.2
-- Qt5Svg:              5.15.2
-- Qt5UiTools:          5.15.2
-- Qt5Concurrent:       5.15.2
-- Qt5WebKitWidgets:    5.212.0
-- Shiboken2:           5.15.2 [/usr/lib64/cmake/Shiboken2-5.15.2] [/usr/include/shiboken2;/usr/include/python3.9]
-- PySide2:             5.15.2 [/usr/include/PySide2]
-- PySide2Tools:        [/usr/bin/uic-qt5] [/usr/bin/rcc-qt5]
-- Freetype:            2.10.4
-- OpenGL:              /usr/lib/libGL.so
-- OpenGLU:             [/usr/lib/libGLU.so][/usr/include]
-- Coin3D:              4.0.1 [Coin] []
-- Pivy:                0.6.5
-- SPNAV:               [/usr/lib/libspnav.so] [/usr/include]
-- Matplotlib:          3.4.1
-- Rift:                not enabled (BUILD_VR)
-- Doxygen:             1.9.1
--  Language:           English
--  Coin3D_DOC:         not found
=================================================

floesche

2021-04-19 14:50

reporter   ~0015617

Last edited: 2021-04-19 14:50

Not sure if this is helpful, but if I step through the test, I see the following:


(Pdb) object.Shape
<Solid object at 0x55e974e42440>
(Pdb) object.Shape.BoundBox
BoundBox (-17, -14.7224, -5, 8.5, 14.7224, 5)
(Pdb) object.Shape.BoundBox.XLength
25.499999999999996
(Pdb) object.Shape.BoundBox.YLength
29.444863728670914
(Pdb) object.Shape.BoundBox.ZLength
10.0

I tried to do a recompute on the doc.ActiveObject, with no result:


(Pdb) doc.ActiveObject.recompute()
True
(Pdb) object2 = doc.ActiveObject
(Pdb) object2.Shape
<Solid object at 0x55e973efa380>
(Pdb) object2.Shape.BoundBox
BoundBox (-17, -14.7224, -5, 8.5, 14.7224, 5)
(Pdb) object2.Shape.BoundBox.XLength
25.499999999999996
(Pdb) object2.Shape.BoundBox.YLength
29.444863728670914
(Pdb) object2.Shape.BoundBox.ZLength
10.0

Let me know if I can test something else.

chennes

2021-04-19 16:07

administrator   ~0015618

In that FCStd file, when you view it from the top, are you seeing a circle, or an oval?

floesche

2021-04-19 18:41

reporter   ~0015619

It's a circle from the top, an oval from front.

In the "Report view" window I am also seeing the following when creating the OpenSCAD element:


14:38:42  {'newsize': ['0', '0', '10'], 'auto': ['0', '0', '0'], 'convexity': '0'}
14:38:42  ['0', '0', '10']
14:38:42  ['0', '0', '0']
14:38:42  Old bounding box: BoundBox (-8.5, -8.5, -8.5, 8.5, 8.5, 8.5)
14:38:42  ['17.0', '17.0', '10']
14:38:42  End processing CSG file

floesche

2021-04-19 18:58

reporter   ~0015620

…and the attached file is generated directly from the test_import.CSG.py file: I set a breakpoint at line 350 (after doc=self.utility_create_scad…) and the ran
doc.saveAs("/tmp/test_import_resize_l350.FCStd")
. Just in case this is different from what the GUI does.

chennes

2021-04-19 19:22

administrator   ~0015621

I wonder if the active object isn't what the test expects it to be. If you are seeing a circle from the top, then the bounding box being reported can't correspond to that object, since the reported box has different X and Y components. Can you verify that doc.ActiveObject is in fact giving you that spheroid, and not some other object?

floesche

2021-04-19 19:37

reporter   ~0015622

Sorry, how could I do that?

doc.ActiveObject.Label
gives me 'Matrix_Deformation'.

chennes

2021-04-19 19:42

administrator   ~0015623

That's what I expect to see. Can you recompute the entire document and see if the bounds changes?

floesche

2021-04-19 19:54

reporter   ~0015624

Is that how I can recompute a document?


doc.recompute()
0
(Pdb) doc.ActiveObject.Shape.BoundBox.XLength
25.499999999999996

In any case, the XLength doesn't seem to be correct.

chennes

2021-04-19 21:45

administrator   ~0015626

Are you also on Arch, or are using using a different distro? It looks like I'm going to have to find a way of reproducing it locally, there's a disconnect between what you are seeing onscreen (and posting here in your FCStd files) and the reported bounding box, and I can't figure out what that could be.

floesche

2021-04-19 21:49

reporter   ~0015627

Yes, I am also on Arch.

I don't know much about the data structures used in FreeCAD, but I know a bit about coding. So if you have ideas what I can try, I'd be happy to.

chennes

2021-04-19 22:02

administrator   ~0015628

First, thanks for all the help you've provided so far! Second: to be honest I'm at a bit of a loss about what's going on, but my first order of business will be to add some print statements around the matrix deformation to make sure that at least the values going in and out of it are being calculated correctly.

floesche

2021-04-20 04:50

reporter   ~0015629

The bounding box seems to originate from the OpenCASCADE transformation. The test code ultimately calls
BRepBuilderAPI_GTransform mkTrf(this->_Shape, mat);
in TopoShape.cpp L3234. This is where the dimensions of the boundingbox changes from the expected to the unexpected dimensions.

The most fundamental way I could replicate this, was to do the transformation directly in DRAWEXE:


pload ALL
psphere s 8.5
puts [bounding s]
scalexyz t s 1 1 0.5858
puts [bounding t]

This creates the first bounding box:

-8.5000000999999994 -8.5000000999999994 -8.5000000999999994 8.5000000999999994 8.5000000999999994 8.5000000999999994
and the second:
-17.000000099999998 -14.72243196433546 -4.9797931000000002 8.5000000999999994 14.722431964335453 4.9797931000000002

These numbers are basically the same as the test generates.

Possibly all this is related to the (non)issue https://tracker.dev.opencascade.org/view.php?id=27042?

floesche

2021-04-22 15:30

reporter   ~0015642

After playing around with this for a bit, I have a few questions – maybe you can help with the answers?

1) I am guess, that the FreeCAD GUI is doing some additional steps when rendering the OpenSCAD parts. I might be on the wrong track, but is it possible, that OpenSCAD for FreeCAD GUI are converted from Part to Mesh and back to Part via "process3D_ObjectsViaOpenSCADShape" in OpenSCADUtils.py?

2) I am guessing, a similar transformation would defeat the purpose of this test. Alternatively, would a different mapping of "newsize" to another transformation in p_resize_action (importCSG.py L:494) make sense?

3) Is it possible to reproduce the test error or the DRAWEXE script on another system than Arch Linux?

Apologies if these questions have obvious answers. Any hints welcome.

greyltc

2021-05-09 16:11

reporter   ~0015652

I think the ci robot isn't even running this test case (maybe why it's been missed?).

I just looked at a recent ci log: https://api.travis-ci.org/v3/job/770257561/log.txt and I can't see that OpenSCAD is even installed or configured in that environment. Is this test being run successfully somewhere else that I can look at?

greyltc

2021-05-09 16:27

reporter   ~0015653

In case it's helpful, here's some more verbose output during the test failure on my system.
Don't ask me what all the Token warnings or the permissions errors are about.


test_import_projection (OpenSCADTest.app.test_importCSG.TestImportCSG) ... WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
Scale: [0.5, 0.5]
0
BoundBox (-0.613516, -0.613516, -2.5, 0.613516, 0.613516, 2.5)
Scale: [0.5, 0.5]
0
BoundBox (-0.613516, -0.613516, -2.5, 0.613516, 0.613516, 2.5)
ok
test_import_resize (OpenSCADTest.app.test_importCSG.TestImportCSG) ... WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
{'newsize': ['2', '2', '2'], 'auto': ['0', '0', '0'], 'convexity': '0'}
['2', '2', '2']
['0', '0', '0']
Old bounding box: BoundBox (0, 0, 0, 1, 1, 1)
['2', '2', '2']
{'newsize': ['2', '2', '0'], 'auto': ['0', '0', '0'], 'convexity': '0'}
['2', '2', '0']
['0', '0', '0']
Old bounding box: BoundBox (0, 0, 0, 1, 1, 1)
['2', '2', '1.0']
{'newsize': ['2', '0', '0'], 'auto': ['1', '1', '1'], 'convexity': '0'}
['2', '0', '0']
['1', '1', '1']
Old bounding box: BoundBox (0, 0, 0, 1, 1, 1)
['2', '2', '2']
{'newsize': ['2', '2', '2'], 'auto': ['0', '0', '0'], 'convexity': '0'}
['2', '2', '2']
['0', '0', '0']
Old bounding box: BoundBox (0, 0, 0, 2, 2, 2)
['2', '2', '2']
{'newsize': ['2', '2', '2'], 'auto': ['0', '0', '0'], 'convexity': '0'}
['2', '2', '2']
['0', '0', '0']
Old bounding box: BoundBox (0, 0, 0, 4, 8, 12)
['2', '2', '2']
{'newsize': ['0', '0', '10'], 'auto': ['0', '0', '0'], 'convexity': '0'}
['0', '0', '10']
['0', '0', '0']
Old bounding box: BoundBox (-8.5, -8.5, -8.5, 8.5, 8.5, 8.5)
['17.0', '17.0', '10']
FAIL
test_import_rotate_extrude (OpenSCADTest.app.test_importCSG.TestImportCSG) ... WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
Solid volume is 9.0
Solid volume is 9.0
ok
test_import_rotate_extrude_file (OpenSCADTest.app.test_importCSG.TestImportCSG) ... ok
test_import_sphere (OpenSCADTest.app.test_importCSG.TestImportCSG) ... WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
ok

greyltc

2021-05-09 17:28

reporter   ~0015654

Last edited: 2021-05-09 17:36

Here is a screenshot of how it goes when I do this manually in the gui. Looks okay I think.

greyltc

2021-05-09 17:30

reporter   ~0015655

Last edited: 2021-05-09 17:32

attached?

EDIT: I can't seem to upload a picture for direct attachment to the issue here. Maybe this works:

greyltc

2021-05-09 17:44

reporter   ~0015656

In case it wasn't obvious, I've bisected it and this is the commit that creates this issue: https://github.com/FreeCAD/FreeCAD/commit/69f24859b5cc51af788654c86c3438aa6cef11ef

greyltc

2021-05-09 18:09

reporter   ~0015657

But when I do this on the command line via FreeCADCmd, I can see the failure appear clearly

$ cat > /tmp/code << EOF
resize(newsize = [0,0,10], auto = [0,0,0]) {
    sphere(\$fn = 96, \$fa = 12, \$fs = 2, r = 8.5);
}
EOF
$ cat /tmp/code
resize(newsize = [0,0,10], auto = [0,0,0]) {
    sphere($fn = 96, $fa = 12, $fs = 2, r = 8.5);
}
$ FreeCADCmd 
FreeCAD 0.20, Libs: 0.20R24848 (Git)
(c) Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2021
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
  #####                 ####  ###   ####  
  #                    #      # #   #   # 
  #     ##  #### ####  #     #   #  #   # 
  ####  # # #  # #  #  #     #####  #   # 
  #     #   #### ####  #    #     # #   # 
  #     #   #    #     #    #     # #   #  ##  ##  ##
  #     #   #### ####   ### #     # ####   ##  ##  ##

[FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>]
>>> import importCSG
>>> doc = importCSG.open("/tmp/code")
WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
WARNING: Couldn't create 'parsetab'. [Errno 13] Permission denied: '/usr/lib/freecad/Mod/OpenSCAD/parsetab.py'
{'newsize': ['0', '0', '10'], 'auto': ['0', '0', '0']}
['0', '0', '10']
['0', '0', '0']
Old bounding box: BoundBox (-8.5, -8.5, -8.5, 8.5, 8.5, 8.5)
['17.0', '17.0', '10']
End processing CSG file
>>> doc.ActiveObject.Label
'Matrix_Deformation'
>>> doc.ActiveObject.Shape.BoundBox.XLength
25.499999999999996
>>> doc.recompute()
0
>>> doc.ActiveObject.Shape.BoundBox.XLength
25.499999999999996

So yes, it seems broken in the terminal and not broken in the GUI.

chennes

2021-05-10 17:17

administrator   ~0015659

That's very helpful -- I only ever run this test from the GUI (as you noted upthread, Travis doesn't run this test because it doesn't have OpenSCAD installed and currently that is required). I'll try running from the command line later this week and see if I can reproduce locally.

floesche

2021-06-03 06:04

reporter   ~0015691

Just to confirm: I can reproduce the issue with the example @greyltc provided.

chennes

2021-06-27 19:24

administrator   ~0015720

I think I have a fix for this, but would appreciate an additional check on my work. Can you edit line 494 of importCSG.py to read

    new_part.Shape = p[6][0].Shape.copy().transformShape(transform_matrix, False, True)
and see if that resolves the issue for you?

floesche

2021-06-29 02:26

reporter   ~0015721

Thank you for this suggestion. Sadly for me it doesn't solve the problem.

======================================================================
FAIL: test_import_resize (OpenSCADTest.app.test_importCSG.TestImportCSG)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/loeschef/srcs/FreeCAD/build/Mod/OpenSCAD/OpenSCADTest/app/test_importCSG.py", line 352, in test_import_resize
    self.assertAlmostEqual (object.Shape.BoundBox.XLength, 2*8.5, 1)
AssertionError: 25.499999999999996 != 17.0 within 1 places (8.499999999999996 difference)

----------------------------------------------------------------------
Ran 567 tests in 51.964s


Not surprisingly, if I set a breakpoint right after the changed line and then check the size of the bounding box, it is the wrong size:

(Pdb) new_part.Shape.BoundBox.XLength
25.499999999999996

chennes

2021-07-07 14:36

administrator   ~0015730

A suggestion from the forums is to try adding

doc.recompute()

before the transform, so it would then read:

    new_part=doc.addObject("Part::FeaturePython",'Matrix Deformation')
    doc.recompute()
    new_part.Shape = p[6][0].Shape.transformGeometry(transform_matrix)

chennes

2021-08-10 22:42

administrator   ~0015799

Just an update that the recompute suggestion does not work. I continue to try tracking this down...

chennes

2021-08-17 16:41

administrator   ~0015823

Last edited: 2021-08-17 16:42

Finally tracked this one down to as issue with the way OCCT calculates bounding boxes when a tessellation is not available -- added explicit tessellation before any bounding box calculations in the importer in PR 4970: https://github.com/FreeCAD/FreeCAD/pull/4970

chennes

2021-08-17 16:46

administrator   ~0015824

PR merged.

Issue History

Date Modified Username Field Change
2021-04-07 10:03 greyltc New Issue
2021-04-10 02:48 chennes Assigned To => chennes
2021-04-10 02:48 chennes Status new => assigned
2021-04-12 18:19 chennes Status assigned => feedback
2021-04-12 18:19 chennes Note Added: 0015611
2021-04-18 00:58 floesche Note Added: 0015614
2021-04-18 00:58 floesche File Added: Issue-4622.FCStd
2021-04-18 22:10 chennes Note Added: 0015615
2021-04-18 22:20 floesche Note Added: 0015616
2021-04-18 22:21 floesche Note Edited: 0015616
2021-04-18 22:30 floesche Note Edited: 0015616
2021-04-19 14:50 floesche Note Added: 0015617
2021-04-19 14:50 floesche Note Edited: 0015617
2021-04-19 14:50 floesche Note Edited: 0015617
2021-04-19 16:07 chennes Note Added: 0015618
2021-04-19 18:41 floesche Note Added: 0015619
2021-04-19 18:58 floesche Note Added: 0015620
2021-04-19 18:58 floesche File Added: test_import_resize_l350.FCStd
2021-04-19 19:22 chennes Note Added: 0015621
2021-04-19 19:37 floesche Note Added: 0015622
2021-04-19 19:42 chennes Note Added: 0015623
2021-04-19 19:54 floesche Note Added: 0015624
2021-04-19 21:45 chennes Note Added: 0015626
2021-04-19 21:49 floesche Note Added: 0015627
2021-04-19 22:02 chennes Note Added: 0015628
2021-04-20 04:50 floesche Note Added: 0015629
2021-04-22 15:30 floesche Note Added: 0015642
2021-05-09 16:11 greyltc Note Added: 0015652
2021-05-09 16:11 greyltc Status feedback => assigned
2021-05-09 16:27 greyltc Note Added: 0015653
2021-05-09 17:28 greyltc Note Added: 0015654
2021-05-09 17:28 greyltc Note Edited: 0015654
2021-05-09 17:30 greyltc Note Added: 0015655
2021-05-09 17:32 greyltc Note Edited: 0015655
2021-05-09 17:36 greyltc Note Edited: 0015654
2021-05-09 17:44 greyltc Note Added: 0015656
2021-05-09 18:09 greyltc Note Added: 0015657
2021-05-10 17:17 chennes Note Added: 0015659
2021-06-03 06:04 floesche Note Added: 0015691
2021-06-27 19:24 chennes Note Added: 0015720
2021-06-29 02:26 floesche Note Added: 0015721
2021-07-07 14:36 chennes Note Added: 0015730
2021-08-10 22:42 chennes Note Added: 0015799
2021-08-17 16:41 chennes Note Added: 0015823
2021-08-17 16:42 chennes Note Edited: 0015823
2021-08-17 16:46 chennes Status assigned => closed
2021-08-17 16:46 chennes Resolution open => fixed
2021-08-17 16:46 chennes Fixed in Version => 0.20
2021-08-17 16:46 chennes Note Added: 0015824