Skip to content
New issue

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

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

Already on GitHub? # to your account

SIP version #6

Closed
erathke opened this issue Jan 8, 2021 · 2 comments
Closed

SIP version #6

erathke opened this issue Jan 8, 2021 · 2 comments
Labels
question Further information is requested

Comments

@erathke
Copy link

erathke commented Jan 8, 2021

Hi folks!
I'm updating my Cura building on OpenBSD 6.8 and with this new dependency (pynest2d) I'm getting compile errors:

[5/10] /usr/ports/pobj/pynest2d-4.8.0-python3/bin/c++ -Dpython_module_pynest2d_EXPORTS -I/usr/ports/pobj/pynest2d-4.8.0-python3/pynest2d-4.8.0/src -I/usr/local/include/python3.8 -I/usr/local/include/polyclipping -I/usr/local/include -O2 -pipe -DLIBNEST2D_GEOMETRIES_clipper -DLIBNEST2D_OPTIMIZERS_nlopt -DLIBNEST2D_THREADING_std -fPIC -DNDEBUG -fPIC -std=gnu++11 -MD -MT CMakeFiles/python_module_pynest2d.dir/src/sippynest2dpart3.cpp.o -MF CMakeFiles/python_module_pynest2d.dir/src/sippynest2dpart3.cpp.o.d -o CMakeFiles/python_module_pynest2d.dir/src/sippynest2dpart3.cpp.o -c src/sippynest2dpart3.cpp
FAILED: CMakeFiles/python_module_pynest2d.dir/src/sippynest2dpart3.cpp.o
/usr/ports/pobj/pynest2d-4.8.0-python3/bin/c++ -Dpython_module_pynest2d_EXPORTS -I/usr/ports/pobj/pynest2d-4.8.0-python3/pynest2d-4.8.0/src -I/usr/local/include/python3.8 -I/usr/local/include/polyclipping -I/usr/local/include -O2 -pipe -DLIBNEST2D_GEOMETRIES_clipper -DLIBNEST2D_OPTIMIZERS_nlopt -DLIBNEST2D_THREADING_std -fPIC -DNDEBUG -fPIC -std=gnu++11 -MD -MT CMakeFiles/python_module_pynest2d.dir/src/sippynest2dpart3.cpp.o -MF CMakeFiles/python_module_pynest2d.dir/src/sippynest2dpart3.cpp.o.d -o CMakeFiles/python_module_pynest2d.dir/src/sippynest2dpart3.cpp.o -c src/sippynest2dpart3.cpp
/usr/ports/pobj/pynest2d-4.8.0-python3/pynest2d-4.8.0/src/ItemGroup.sip:49:25: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
while(list_item = PyIter_Next(iterator))
~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/pobj/pynest2d-4.8.0-python3/pynest2d-4.8.0/src/ItemGroup.sip:49:25: note: place parentheses around the assignment to silence this warning
while(list_item = PyIter_Next(iterator))
^
( )
/usr/ports/pobj/pynest2d-4.8.0-python3/pynest2d-4.8.0/src/ItemGroup.sip:49:25: note: use '==' to turn this assignment into an equality comparison
while(list_item = PyIter_Next(iterator))
^
==
/usr/ports/pobj/pynest2d-4.8.0-python3/build-amd64-python3/src/sippynest2dpart3.cpp:283:30: error: no member named 'isDisallowedArea' in 'libnest2d::_ItemClipperLib::Polygon'
sipRes = sipCpp->isDisallowedArea();
~~~~~~ ^
/usr/ports/pobj/pynest2d-4.8.0-python3/build-amd64-python3/src/sippynest2dpart3.cpp:356:21: error: no member named 'markAsDisallowedAreaInBin' in 'libnest2d::_ItemClipperLib::Polygon'
sipCpp->markAsDisallowedAreaInBin(a0);
~~~~~~ ^
1 warning and 2 errors generated.
ninja: build stopped: subcommand failed.
*** Error 1 in . (/usr/ports/devel/cmake/cmake.port.mk:36 'do-build': @cd /usr/ports/pobj/pynest2d-4.8.0-python3/build-amd64-python3 && exec...)
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2921 '/usr/ports/pobj/pynest2d-4.8.0-python3/build-amd64-python3/.build_done': @c...)
*** Error 2 in /usr/ports/mystuff/cad/ultimaker/pynest2d (/usr/ports/infrastructure/mk/bsd.port.mk:2584 'build': @lock=pynest2d-4.8.0; expo...)

I'm using SIP 4 version.

Do you have some tips to solve it?

Thanks in advance.

Evandro Rathke

@Ghostkeeper
Copy link
Contributor

Ghostkeeper commented Jan 18, 2021

/usr/ports/pobj/pynest2d-4.8.0-python3/build-amd64-python3/src/sippynest2dpart3.cpp:283:30: error: no member named 'isDisallowedArea' in 'libnest2d::_ItemClipperLib::Polygon'
sipRes = sipCpp->isDisallowedArea();
~~~~~~ ^
/usr/ports/pobj/pynest2d-4.8.0-python3/build-amd64-python3/src/sippynest2dpart3.cpp:356:21: error: no member named 'markAsDisallowedAreaInBin' in 'libnest2d::_ItemClipperLib::Polygon'
sipCpp->markAsDisallowedAreaInBin(a0);

These two are the real errors you're encountering and it's not anything to do with the SIP version but rather the libnest2d version.

When we developed those Python bindings for usage in Cura we also added a feature to libnest2d: Disallowed areas. This is something that Cura kind of needs in order to work properly. It has locations on the build plate where models are not allowed to be positioned, but models shouldn't be positioned next to those locations either (they should start aligned in the middle). We made a pull request to add this: tamasmeszaros/libnest2d#18 However this pull request is not merged due to foreseen issues.

The solution, for now, is to use Ultimaker's version of libnest2d with the feature added, rather than the mainline version: https://github.com/Ultimaker/libnest2d/tree/CURA-7754_add_disallowed_areas

@Ghostkeeper Ghostkeeper added the question Further information is requested label Jan 18, 2021
@erathke
Copy link
Author

erathke commented Jan 20, 2021

/usr/ports/pobj/pynest2d-4.8.0-python3/build-amd64-python3/src/sippynest2dpart3.cpp:283:30: error: no member named 'isDisallowedArea' in 'libnest2d::_ItemClipperLib::Polygon'
sipRes = sipCpp->isDisallowedArea();
~~~~~~ ^
/usr/ports/pobj/pynest2d-4.8.0-python3/build-amd64-python3/src/sippynest2dpart3.cpp:356:21: error: no member named 'markAsDisallowedAreaInBin' in 'libnest2d::_ItemClipperLib::Polygon'
sipCpp->markAsDisallowedAreaInBin(a0);

These two are the real errors you're encountering and it's not anything to do with the SIP version but rather the libnest2d version.

When we developed those Python bindings for usage in Cura we also added a feature to libnest2d: Disallowed areas. This is something that Cura kind of needs in order to work properly. It has locations on the build plate where models are not allowed to be positioned, but models shouldn't be positioned next to those locations either (they should start aligned in the middle). We made a pull request to add this: tamasmeszaros/libnest2d#18 However this pull request is not merged due to foreseen issues.

The solution, for now, is to use Ultimaker's version of libnest2d with the feature added, rather than the mainline version: https://github.com/Ultimaker/libnest2d/tree/CURA-7754_add_disallowed_areas

It works! Thanks for your help!
Have a good week!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants