OpenCAMlib for Windows

Here's the place for discussion related to CAM/CNC and the development of the Path module.
User avatar
roerich_64
Posts: 1258
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: OpenCAMlib for Windows

Postby roerich_64 » Thu Mar 28, 2019 6:37 pm

Hi,

on Windows we can have the builds of @Sgrogan:
sgrogan wrote:
Thu Jun 07, 2018 9:42 pm
An OCL build that works for FreeCAD 0.17 and 0.18 (VS2013) is available here: https://github.com/sgrogan/opencamlib/r ... ag/8612634
OCL module for windows using FreeCAD's Libpack for dependencies.
Download and extract to "C:\Users\USERNAME\AppData\Roaming\FreeCAD\Mod" directory
In the ..../Mod directory you will get a .../Mod/python27_x64-ocl sub-directory. The key file is ocl.pyd. After extraction re-start FreeCAD and in the python console enter

Code: Select all

import ocl
If there are no errors, then the library works and I defer to the Path guru's.
You don't have to compile anything ;)
The build of @Sgrogan is builded for Python 2.7.x.
So you need a FreeCAD with builded for Python 2.7.x for now testing OCL.

BR
Walter

Edit: Version of python from 2.7.4 to 2.7.x
Last edited by roerich_64 on Thu Mar 28, 2019 7:40 pm, edited 2 times in total.
RatonLaveur
Posts: 811
Joined: Wed Mar 27, 2019 10:45 am

Re: OpenCAMlib for Windows

Postby RatonLaveur » Thu Mar 28, 2019 6:59 pm

Hello Walter,

Thank you for the quick reply. Indeed i had followed, plastered on my screen even, the post from user Sgrogan as it seemed he was persistent enough and kind enough to do the work and bundle the work for everyone to benefit.

I was however unsuccessful in "just" copying his package. And therefore kept looking for another solution (the one in my previous post). Such solution took me to town in command prompts and Visual Studio, which really puts me out of my element and obviously i currently lack in basic understanding of python versions...which let's face it puts me at a slight disadvantage towards what I'd like to achieve :)

Thanks to you i now understand it has to do with the Python version FreeCAD uses. My cartouche says FC0.18 is running Py 3.6.6 and Srogan at the time of his post here was running FC0.17 with Py 2.7.8. You suggest I need Py 2.7.4.

Forgive my ignorance, I'd be grateful if you or someone else could elucidate the following questions:

1. Is the version of Python linked to the FC release? (i.e. My cartouche says 3.6.6 with the current 0.18 release, but the python version would revert to the earlier OCL compatible version if I downgrade my FC build)

2. Since Srogan was apparently displaying 2.7.8 at the time of his sharing and you stipulate that i require 2.7.4, am I to understand that there is virtually no difference (pertaining to OCL compatibility) between 2.7.4 and 2.7.8?

3. Is there a way to "run" OCL anyway on FC0.18 by linking to the earlier Python library?

I am very grateful for your input, the inner workings of FC are a beautiful jungle of great complexity, and i only appreciate more the time and dedication each step forward requires of the contributors.
User avatar
sgrogan
Posts: 6166
Joined: Wed Oct 22, 2014 5:02 pm

Re: OpenCAMlib for Windows

Postby sgrogan » Thu Mar 28, 2019 7:20 pm

RatonLaveur wrote:
Thu Mar 28, 2019 6:59 pm
1. Is the version of Python linked to the FC release? (i.e. My cartouche says 3.6.6 with the current 0.18 release, but the python version would revert to the earlier OCL compatible version if I downgrade my FC build)
Yes both FreeCAD and OCL link to Python so they need to share a compatible version. Any Python 2.7.x will be compatible with the OCL package I posted.
RatonLaveur wrote:
Thu Mar 28, 2019 6:59 pm
3. Is there a way to "run" OCL anyway on FC0.18 by linking to the earlier Python library?
You need a FreeCAD that is built with the same Python as OCL. FreeCAD uses a number of other libraries that also link to Python and they all must share a compatible version.
This Version will work https://github.com/FreeCAD/FreeCAD/rele ... dev_win.7z

After I finish all the 0.18 release work, I will try to build a Python 3.6.x package.
"fight the good fight"
RatonLaveur
Posts: 811
Joined: Wed Mar 27, 2019 10:45 am

Re: OpenCAMlib for Windows

Postby RatonLaveur » Thu Mar 28, 2019 7:46 pm

So quick. So impactful.
I was doing my homework and realized the mere act of compiling for us Windows users was embedding the python version. The more you know.

You have no idea how much I appreciate, besides the content, the mere fact that people like you and those who build and maintain this community exist.

I'll try the gitbub version you just suggested.

Just to complete my picture: am i correct to assume that the version you posted, although it's also 0.18 is still on Py 2.7.x because the migration to Py 3.3 was performed during the 0.18 dev cycle?
User avatar
sgrogan
Posts: 6166
Joined: Wed Oct 22, 2014 5:02 pm

Re: OpenCAMlib for Windows

Postby sgrogan » Thu Mar 28, 2019 8:30 pm

RatonLaveur wrote:
Thu Mar 28, 2019 7:46 pm
Just to complete my picture: am i correct to assume that the version you posted, although it's also 0.18 is still on PY 2.7.x because the migration to Py 3.3 was performed during the 0.18 dev cycle?
Yes the 0.18 dev cycle was focused on porting to PY3 and QT5. So over the dev cycle QT5/PY3 and a QT4/PY2 were provided. With QT4/PY2 being the "default". The last version of 0.18_pre = the 0.18 release version, except for the release QT5/PY3 is the "default".

For the 0.19_pre I will continue to provide both builds. Although FreeCAD is fully ported itself (less as yet to be discovered bugs) not all add-on workbenches, macros, and 3rd party libs (like OCL) are. My understanding is that OCL is ported to PY3. CMake support on Win is sketchy for OCL, which is why it's more difficult to build on Win vs. Linux. The PY2 package for OCL that I provide actually used the OCL fork of peterl94 that added better CMake support for win. Unfortunately these improvements never made it into OCL master. My strategy to build PY3 OCL will be to try to apply the CMake stuff from peterl94's fork on top of OCL master. At that point I'm sure I will be reaching out to the community for help ;)
"fight the good fight"
Russ4262
Posts: 532
Joined: Sat Jun 30, 2018 3:22 pm

Re: OpenCAMlib for Windows

Postby Russ4262 » Thu Mar 28, 2019 10:20 pm

I second RatonLaveur's sentiments of appreciation !

Thanks to all the maintainers and compilers and builders of this great software.

Russell
RatonLaveur
Posts: 811
Joined: Wed Mar 27, 2019 10:45 am

Re: OpenCAMlib for Windows

Postby RatonLaveur » Mon Apr 01, 2019 7:28 am

Monday morning, first coffee, applying the teachings of the FreeCAD community...

It's going to be a good week!

FYI: I'm a material scientist (hence, computer illiterate) and I work with very cool, very expensive laser machines, using OCL for me will change the game in that it creates a G-Code toolpath with Z adaptation. I intend to change the Z argument into other variables such as laser attenuation or feedrate so as to generate the surface.

We have some other pieces of software to make 5 axis simultaneous tool-paths, but I'm spearheading our work on laser milling. I spread the word on FreeCAD at the same time :)
Attachments
TestPiece.png
TestPiece.png (103.96 KiB) Viewed 608 times
Successful Import.png
Successful Import.png (14.37 KiB) Viewed 608 times
User avatar
roerich_64
Posts: 1258
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: OpenCAMlib for Windows

Postby roerich_64 » Mon Apr 01, 2019 9:29 am

RatonLaveur wrote:
Mon Apr 01, 2019 7:28 am
Monday morning, first coffee, applying the teachings of the FreeCAD community...

It's going to be a good week!

FYI: I'm a material scientist (hence, computer illiterate) and I work with very cool, very expensive laser machines, using OCL for me will change the game in that it creates a G-Code toolpath with Z adaptation. I intend to change the Z argument into other variables such as laser attenuation or feedrate so as to generate the surface.

We have some other pieces of software to make 5 axis simultaneous tool-paths, but I'm spearheading our work on laser milling. I spread the word on FreeCAD at the same time :)
Hi Raton,

1+ :)

We have done many tests to find the best way for smooth paths out of meshes:
https://forum.freecadweb.org/viewtopic. ... 10#p297828

Can we have your model to test more?
Edit:
It could be, there where a mesh issue:
3D-Surface_XIV.jpg
3D-Surface_XIV.jpg (159.27 KiB) Viewed 582 times

BR
Walter
RatonLaveur
Posts: 811
Joined: Wed Mar 27, 2019 10:45 am

Re: OpenCAMlib for Windows

Postby RatonLaveur » Mon Apr 01, 2019 2:04 pm

Hi Roerich_64,

I think you're reading too much into my screenshot, this was the very first "fire and forget" tool-path I made this morning. No weird transition occurs if I change the tool diameter (0.5-->0.1 mm) or if I change the sampling rate (0.04 mm -->0.01 mm).

Attached the model, which I threw together with 3 primitives, a little bit of FC boolean magic and a chamfer just to have a sandbox.

By the way, the net effect of having a sampling rate embedded in the code is twofold for me:
1. It makes the code extremely heavy :)
2. It makes the code extremely powerful. I can foresee a little bit of "digital" machining with our highspeed laser shutter. Maxels (machining pixels).
Attachments
3D_Surfacing_test.FCStd
(45.68 KiB) Downloaded 28 times
User avatar
roerich_64
Posts: 1258
Joined: Thu May 21, 2015 7:00 pm
Location: Ostfriesland

Re: OpenCAMlib for Windows

Postby roerich_64 » Mon Apr 01, 2019 2:52 pm

RatonLaveur wrote:
Mon Apr 01, 2019 2:04 pm
Hi Roerich_64,

I think you're reading too much into my screenshot
@Raton: What should i say ;) 8-)
3D-Surface_Raton.jpg
3D-Surface_Raton.jpg (793.39 KiB) Viewed 561 times
OCL_Surface_Test_Raton.FCStd
(159.67 KiB) Downloaded 34 times
BR
Walter