Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conda: test errors #6902

Closed
2 tasks done
looooo opened this issue May 18, 2022 · 14 comments
Closed
2 tasks done

Conda: test errors #6902

looooo opened this issue May 18, 2022 · 14 comments
Labels
Packaging/building Related to building, compiling or packaging FreeCAD Packaging: Conda Conda packaging related

Comments

@looooo
Copy link
Contributor

looooo commented May 18, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Forums discussion

no forum discussion

Version

0.20 (Development)

Full version info

OS: Ubuntu 18.04.6 LTS (ubuntu:GNOME/ubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.28904 (Git)
Build type: Release
Branch: (HEAD detached at 8ad30d0)
Hash: 8ad30d03146fef0f39b90073fdf3e6072ed7f66d
Python 3.10.4, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: German/Germany (de_DE)
Installed mods: 
  * Manipulator
  * CurvedShapes
  * Beltrami
  * Curves 0.3.0
  * Assembly4

Subproject(s) affected?

No response

Issue description

testing the gui-tests I run into this error

Traceback (most recent call last):
  File "/home/lo/miniconda3/envs/freecad_py310/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/home/lo/miniconda3/envs/freecad_py310/lib/python3.10/unittest/case.py", line 591, in run
    self._callTestMethod(testMethod)
  File "/home/lo/miniconda3/envs/freecad_py310/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
    method()
  File "/home/lo/miniconda3/envs/freecad_py310/Mod/Mesh/MeshTestsApp.py", line 447, in testRayPick
    det=coin.cast(det,str(det.getTypeId().getName()))
SystemError: <built-in function cast> returned NULL without setting an exception

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@wwmayer
Copy link
Contributor

wwmayer commented May 19, 2022

This is the code of the unit test:

import Mesh
from pivy import coin

planarMesh = []
planarMesh.append( [-16.097176,-29.891157,15.987688] )
planarMesh.append( [-16.176304,-29.859991,15.947966] )
planarMesh.append( [-16.071451,-29.900553,15.912505] )
planarMesh.append( [-16.092241,-29.893408,16.020439] )
planarMesh.append( [-16.007210,-29.926180,15.967641] )
planarMesh.append( [-16.064457,-29.904951,16.090832] )

planarMeshObject = Mesh.Mesh(planarMesh)

Mesh.show(planarMeshObject)
view=FreeCADGui.ActiveDocument.ActiveView.getViewer()
rp=coin.SoRayPickAction(view.getSoRenderManager().getViewportRegion())
rp.setRay(coin.SbVec3f(-16.05,16.0,16.0),coin.SbVec3f(0,-1,0))
rp.apply(view.getSoRenderManager().getSceneGraph())
pp=rp.getPickedPoint()

det=pp.getDetail()
print (det)
print(det.getTypeId().getName())
det=coin.cast(det,str(det.getTypeId().getName()))

det.getFaceIndex() == 1

According to the error message it fails inside det=coin.cast(det,str(det.getTypeId().getName())) but I have no idea why. Could it be that your pivy is somehow broken? What's the output when you execute the Python code?

@looooo
Copy link
Contributor Author

looooo commented May 19, 2022

If I run the code in the python console, I get the same issue:

>>> det=coin.cast(det,str(det.getTypeId().getName()))
Traceback (most recent call last):
  File "<input>", line 1, in <module>
SystemError: <built-in function cast> returned NULL without setting an error

@wwmayer
Copy link
Contributor

wwmayer commented May 19, 2022

But what's the output of

print (det)
print(det.getTypeId().getName())

?

@luzpaz luzpaz added Packaging/building Related to building, compiling or packaging FreeCAD Packaging: Conda Conda packaging related labels May 25, 2022
@luzpaz
Copy link
Contributor

luzpaz commented May 25, 2022

@looooo ping

@looooo
Copy link
Contributor Author

looooo commented May 27, 2022

just tried again with python 3.9 and there i see this:

>>> det=coin.cast(det,str(det.getTypeId().getName()))Gui.runCommand('Std_OrthographicCamera',1)
>>> det.getFaceIndex() == 1
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: 'SoDetail' object has no attribute 'getFaceIndex'
>>> type(det)
<class 'pivy.coin.SoDetail'>

If i run all of the code at once FreeCAD crashes. strange.

@luzpaz
Copy link
Contributor

luzpaz commented May 31, 2022

@wwmayer ☝️

@wwmayer
Copy link
Contributor

wwmayer commented May 31, 2022

In C++ when you have picked a triangle then the pointer of SoDetail actually is an SoFaceDetail and one can do a type check and a static_cast or dynamic_cast.

With pivy the returned object always is an SoDetail and in order to get a SoFaceDetail the helper function coin.cast can be used. Therefore I still would like to know the result of print(det.getTypeId().getName()) to be sure that the object is an SoFaceDetail. If yes, then there must be a problem with coin.cast.

@luzpaz
Copy link
Contributor

luzpaz commented Jun 5, 2022

@looooo ☝️

@luzpaz luzpaz changed the title conda: test errors Conda: test errors Jun 5, 2022
@looooo
Copy link
Contributor Author

looooo commented Jun 6, 2022

sorry for my late answer @wwmayer

print (det)
<pivy.coin.SoDetail; proxy of <Swig Object of type 'SoDetail *' at 0x116148090> >
print(det.getTypeId().getName())
SoFaceDetail

@wwmayer
Copy link
Contributor

wwmayer commented Jun 10, 2022

Ok, then it looks like the function coin.cast has stopped working.

@luzpaz
Copy link
Contributor

luzpaz commented Jun 10, 2022

@wwmayer shall we open a ticket in upstream coin3d repo ?

@wwmayer
Copy link
Contributor

wwmayer commented Jun 10, 2022

Which pivy version does Conda use?

@looooo
Copy link
Contributor Author

looooo commented Jun 10, 2022

I am using now 0.6.7 but I don't think there were any differences for coin.cast added to the pivy repo.

@wwmayer
Copy link
Contributor

wwmayer commented Jun 14, 2022

It works with:

from pivy import coin
det = coin.SoFaceDetail()
coin.cast(det, det.getTypeId().getName().getString())

With my locally build version from master where I reverted the latest changes of coin3d/pivy@4b919a3 I can confirm the error with:

from pivy import coin
det = coin.SoFaceDetail()
coin.cast(det, str(det.getTypeId().getName()))

See https://forum.freecadweb.org/viewtopic.php?p=602100#p602100

donovaly pushed a commit that referenced this issue Jun 19, 2022
coreyoconnor pushed a commit to coreyoconnor/FreeCAD that referenced this issue Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packaging/building Related to building, compiling or packaging FreeCAD Packaging: Conda Conda packaging related
Projects
None yet
Development

No branches or pull requests

3 participants