-
Notifications
You must be signed in to change notification settings - Fork 46
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
How much work would require to port Python code to 3.X? #206
Comments
I have created a fork at https://github.com/bullestock/heekscnc/ which, among other fixes, uses Python 3. |
Great!!! Thank you very much for doing it. Will you make a pull request? |
@lpgasparotto I have done so much code cleanup on my own fork that it's quite complicated to create pull requests. |
Keep me in mind if you need help. I't would be a pleasure to help you in whatever you need and I be able to do. |
Hi Torsten,
I'm trying to compile your Heekscad fork. I needed to delete this line from
src/stdafx.h
81 | #include <BRepAlgo_Fuse.hxx>
That's was replaced by #include <BRepAlgoAPI_Fuse.hxx>
But I still can't compile it, I get these errors:
/home/luispa/src/heekscad/src/Edge.cpp: In member function ‘virtual void
CEdge::glCommands(bool, bool, bool)’:
/home/luispa/src/heekscad/src/Edge.cpp:61:84: error: ‘class
Poly_Triangulation’ has no member named ‘Nodes’; did you mean ‘Node’?
61 | const TColgp_Array1OfPnt&
FNodes = facing->Nodes();
|
^~~~~
|
Node
/home/luispa/src/heekscad/src/Edge.cpp: In member function ‘void
CEdge::Blend(double, bool)’:
/home/luispa/src/heekscad/src/Edge.cpp:280:16: warning: catching
polymorphic type ‘class Standard_Failure’ by value [-Wcatch-value=]
280 | catch (Standard_Failure) {
| ^~~~~~~~~~~~~~~~
/home/luispa/src/heekscad/src/Edge.cpp:281:63: error: ‘Caught’ is not a
member of ‘Standard_Failure’
281 | Handle_Standard_Failure e = Standard_Failure::Caught();
| ^~~~~~
/home/luispa/src/heekscad/src/ConversionTools.cpp: In function ‘bool
ConvertSketchToEdges(HeeksObj*, std::__cxx11::list<std::vector<TopoDS_Edge>
&)’:
/home/luispa/src/heekscad/src/ConversionTools.cpp:406:26: warning: catching
polymorphic type ‘const class Standard_Failure’ by value [-Wcatch-value=]
406 | catch (const Standard_Failure)
| ^~~~~~~~~~~~~~~~
/home/luispa/src/heekscad/src/ConversionTools.cpp:409:64: error: ‘Caught’
is not a member of ‘Standard_Failure’
409 | Handle(Standard_Failure) e = Standard_Failure::Caught();
| ^~~~~~
/home/luispa/src/heekscad/src/FaceTools.cpp: In function ‘void
DrawFace(TopoDS_Face, void (*)(const double*, const double*), bool)’:
/home/luispa/src/heekscad/src/FaceTools.cpp:167:59: error: ‘class
Poly_Triangulation’ has no member named ‘Nodes’; did you mean ‘Node’?
167 | const TColgp_Array1OfPnt& Nodes = facing->Nodes();
| ^~~~~
| Node
/home/luispa/src/heekscad/src/FaceTools.cpp:168:75: warning: ‘const
Poly_Array1OfTriangle& Poly_Triangulation::Triangles() const’ is
deprecated: Deprecated method, Triangle() should be used instead [
-Wdeprecated-declarations]
168 | const Poly_Array1OfTriangle& triangles =
facing->Triangles();
|
~~~~~~~~~~~~~~~~~^~
In file included from
/usr/include/opencascade/Poly_ListOfTriangulation.hxx:20,
from /usr/include/opencascade/BRep_Builder.hxx:31,
from /usr/include/opencascade/BRepPrim_Builder.hxx:24,
from /usr/include/opencascade/BRepPrim_GWedge.hxx:24,
from /usr/include/opencascade/BRepPrim_Wedge.hxx:24,
from /usr/include/opencascade/BRepPrimAPI_MakeBox.hxx:24,
from /home/luispa/src/heekscad/src/stdafx.h:104,
from /home/luispa/src/heekscad/src/FaceTools.cpp:5:
/usr/include/opencascade/Poly_Triangulation.hxx:318:32: note: declared here
318 | const Poly_Array1OfTriangle& Triangles() const { return
myTriangles; }
| ^~~~~~~~~
/home/luispa/src/heekscad/src/ConversionTools.cpp: In function ‘bool
ConvertEdgesToFaceOrWire(const std::vector<TopoDS_Edge>&,
std::__cxx11::list<TopoDS_Shape>&, bool)’:
/home/luispa/src/heekscad/src/ConversionTools.cpp:471:64: error: ‘Caught’
is not a member of ‘Standard_Failure’
471 | Handle(Standard_Failure) e = Standard_Failure::Caught();
| ^~~~~~
/home/luispa/src/heekscad/src/Face.cpp: In member function ‘virtual void
RotateToFace::Run()’:
/home/luispa/src/heekscad/src/Face.cpp:275:25: warning: variable ‘inv_matrix’
set but not used [-Wunused-but-set-variable]
275 | gp_Trsf inv_matrix = face_matrix.Inverted();
| ^~~~~~~~~~
/home/luispa/src/heekscad/src/Face.cpp: In member function ‘bool
CFace::IsAPlane(gp_Pln*)’:
/home/luispa/src/heekscad/src/Face.cpp:388:40: warning: variable ‘n00’ set
but not used [-Wunused-but-set-variable]
388 | gp_Dir n00 = GetNormalAtUV(uv_box[0]
+ U * 0.1, uv_box[2] + V * 0.1, &p00);
| ^~~
/home/luispa/src/heekscad/src/Face.cpp:389:40: warning: variable ‘nN0’ set
but not used [-Wunused-but-set-variable]
389 | gp_Dir nN0 = GetNormalAtUV(uv_box[0]
+ U * 0.9, uv_box[2] + V * 0.1, &pN0);
| ^~~
/home/luispa/src/heekscad/src/Face.cpp:390:40: warning: variable ‘nNN’ set
but not used [-Wunused-but-set-variable]
390 | gp_Dir nNN = GetNormalAtUV(uv_box[0]
+ U * 0.9, uv_box[2] + V * 0.9, &pNN);
| ^~~
/home/luispa/src/heekscad/src/Face.cpp:402:48: warning: variable ‘n’ set
but not used [-Wunused-but-set-variable]
402 | gp_Dir n =
GetNormalAtUV(u[i], v[j], &p);
| ^
/home/luispa/src/heekscad/src/Face.cpp:376:32: warning: variable ‘n00’ set
but not used [-Wunused-but-set-variable]
376 | gp_Dir n00 = GetNormalAtUV(u[0], v[0],
&p00);
| ^~~
/home/luispa/src/heekscad/src/Face.cpp:377:32: warning: variable ‘nN0’ set
but not used [-Wunused-but-set-variable]
377 | gp_Dir nN0 = GetNormalAtUV(u[GRID], v[0],
&pN0);
| ^~~
/home/luispa/src/heekscad/src/Face.cpp:378:32: warning: variable ‘nNN’ set
but not used [-Wunused-but-set-variable]
378 | gp_Dir nNN = GetNormalAtUV(u[GRID], v[GRID],
&pNN);
| ^~~
/home/luispa/src/heekscad/src/Face.cpp: In member function ‘bool
CFace::GetNurbSurfaceParams(CNurbSurfaceParams*)’:
/home/luispa/src/heekscad/src/Face.cpp:650:15: warning: catching
polymorphic type ‘class Standard_Failure’ by value [-Wcatch-value=]
650 | catch(Standard_Failure) {
| ^~~~~~~~~~~~~~~~
/home/luispa/src/heekscad/src/Face.cpp:651:64: error: ‘Caught’ is not a
member of ‘Standard_Failure’
651 | Handle(Standard_Failure) e = Standard_Failure::Caught();
| ^~~~~~
make[2]: *** [src/CMakeFiles/heekscad.dir/build.make:328:
src/CMakeFiles/heekscad.dir/FaceTools.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [src/CMakeFiles/heekscad.dir/build.make:272:
src/CMakeFiles/heekscad.dir/Edge.cpp.o] Error 1
make[2]: *** [src/CMakeFiles/heekscad.dir/build.make:314:
src/CMakeFiles/heekscad.dir/Face.cpp.o] Error 1
make[2]: *** [src/CMakeFiles/heekscad.dir/build.make:132:
src/CMakeFiles/heekscad.dir/ConversionTools.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:204: src/CMakeFiles/heekscad.dir/all]
Error 2
make: *** [Makefile:136: all] Error 2
I tried to solve it for giving you a solution proposal but I have no luck,
I don't have too much knowledge to solve it. BTW, I'm using the latest
release of KDE Neon.
Best regards,
Luis Pablo
El dom, 28 ago 2022 a las 16:28, Torsten Martinsen (<
***@***.***>) escribió:
… @lpgasparotto <https://github.com/lpgasparotto> I have done so much code
cleanup on my own fork that it's quite complicated to create pull requests.
—
Reply to this email directly, view it on GitHub
<#206 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFIIC46ATCKXIF5YCX54CFTV3O4VPANCNFSM5UEFSUQQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@lpgasparotto I just tried to compile my fork now, and while I was able to fix some of the errors, there is still a single instance of the deprecated |
Hi Torsten,
Thank you very much for keeping this alive. The "deprecated Nodes()" issue
was discussed and solved on these links:
https://bugs.launchpad.net/ubuntu/+source/netgen/+bug/1983997
NGSolve/netgen@08993ae
I hope it helps, it's not specifically related to Heekscad but it could
help.
Best regards,
Luis Pablo
El mar, 10 ene 2023 a las 15:21, Torsten Martinsen (<
***@***.***>) escribió:
… @lpgasparotto <https://github.com/lpgasparotto> I just tried to compile
my fork now, and while I was able to fix some of the errors, there is still
a single instance of the deprecated Nodes() call that I couldn't quickly
figure out how to convert. Anyway, the fixes are pushed.
—
Reply to this email directly, view it on GitHub
<#206 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFIIC45JLWBQYM2P4W4ZTQLWRWSCHANCNFSM5UEFSUQQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@lpgasparotto I managed to fix the remaining compile errors. |
Awesome, thanks!
El mié, 11 ene 2023 a las 15:25, Torsten Martinsen (<
***@***.***>) escribió:
… @lpgasparotto <https://github.com/lpgasparotto> I managed to fix the
remaining compile errors.
—
Reply to this email directly, view it on GitHub
<#206 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFIIC44XOMTZ2GPOJ2CUW7LWR33IPANCNFSM5UEFSUQQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I couldn't wait a minute and compiled Heekscad and Heekscnc. I was able to
do it but when I try to launch heekscad I get this message:
heekscad: symbol lookup error: /lib/libTKG2d.so.7: undefined symbol:
_ZNK16Standard_Failure14GetStackStringEv
Were you able to launch Heekscad without errors?
Thank you very much in advance.
Best regards,
Luis Pablo
El mié, 11 ene 2023 a las 15:25, Torsten Martinsen (<
***@***.***>) escribió:
… @lpgasparotto <https://github.com/lpgasparotto> I managed to fix the
remaining compile errors.
—
Reply to this email directly, view it on GitHub
<#206 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFIIC44XOMTZ2GPOJ2CUW7LWR33IPANCNFSM5UEFSUQQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Forget it!
Just doing
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib
solves the problem.
Now it works flawlessly.
Again, thank you very much.
Best regards,
Luis Pablo
El mié, 11 ene 2023 a las 16:22, Luis Pablo Gasparotto (<
***@***.***>) escribió:
… I couldn't wait a minute and compiled Heekscad and Heekscnc. I was able to
do it but when I try to launch heekscad I get this message:
heekscad: symbol lookup error: /lib/libTKG2d.so.7: undefined symbol:
_ZNK16Standard_Failure14GetStackStringEv
Were you able to launch Heekscad without errors?
Thank you very much in advance.
Best regards,
Luis Pablo
El mié, 11 ene 2023 a las 15:25, Torsten Martinsen (<
***@***.***>) escribió:
> @lpgasparotto <https://github.com/lpgasparotto> I managed to fix the
> remaining compile errors.
>
> —
> Reply to this email directly, view it on GitHub
> <#206 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AFIIC44XOMTZ2GPOJ2CUW7LWR33IPANCNFSM5UEFSUQQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Hi,
I tried to generate G-Code of a previous work and it seems there's
something wrong with HeeksCNC, it doesn't consider surface and patterns, it
only generates a flat path.
Best regards,
Luis Pablo
El mié, 11 ene 2023 a las 16:32, Luis Pablo Gasparotto (<
***@***.***>) escribió:
… Forget it!
Just doing
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib
solves the problem.
Now it works flawlessly.
Again, thank you very much.
Best regards,
Luis Pablo
El mié, 11 ene 2023 a las 16:22, Luis Pablo Gasparotto (<
***@***.***>) escribió:
> I couldn't wait a minute and compiled Heekscad and Heekscnc. I was able
> to do it but when I try to launch heekscad I get this message:
> heekscad: symbol lookup error: /lib/libTKG2d.so.7: undefined symbol:
> _ZNK16Standard_Failure14GetStackStringEv
> Were you able to launch Heekscad without errors?
> Thank you very much in advance.
> Best regards,
> Luis Pablo
>
> El mié, 11 ene 2023 a las 15:25, Torsten Martinsen (<
> ***@***.***>) escribió:
>
>> @lpgasparotto <https://github.com/lpgasparotto> I managed to fix the
>> remaining compile errors.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#206 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/AFIIC44XOMTZ2GPOJ2CUW7LWR33IPANCNFSM5UEFSUQQ>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
|
It's very possible that my compile fixes have broken something. |
Since most Linux distros provide Boost compiled against Python 3.X HeeksCNC will not compile/work properly unless Boost be recompiled against Python 2.7 and override default version. This workaround could affect other applications which use Boost (i.e. FreeCAD). Also, the Boost manual installation is not that straight forward.
I'm willing to help in whatever I could. There's a kind of migration tool, I gues it's called 2to3, which could automate a considerable part of the process. Main differences are related to the way modules are imported and other minimal syntax differences.
The text was updated successfully, but these errors were encountered: