OpenCAMlib for Windows

Here's the place for discussion related to CAM/CNC and the development of the Path module.
LMH
Posts: 4
Joined: Sat May 11, 2019 6:17 pm

Re: OpenCAMlib for Windows

Postby LMH » Sat May 11, 2019 6:39 pm

Hello Guys,

I've compiled opencamlib with python 3.6 just as Russel did. It compiled without error but I can't seem to import it in FreeCAD


OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16110 (Git)
Build type: Release
Branch: (HEAD detached at upstream/releases/FreeCAD-0-18)
Hash: f7dccfaa909e5b9da26bf50c4a22ccca9bb10c40
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

Message reads:
>>> import ocl
Traceback (most recent call last):
File "<input>", line 1, in <module>
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
User avatar
Russ4262
Posts: 259
Joined: Sat Jun 30, 2018 3:22 pm

Re: OpenCAMlib for Windows

Postby Russ4262 » Sun May 12, 2019 3:03 am

Evening, LMH.
Congrats on the successful Windows build of OCL.
LMH wrote:
Sat May 11, 2019 6:39 pm
… I can't seem to import it in FreeCAD
To install the library,
  • verify you built the python library version of OCL - I think the default is the c++ library
  • navigate to your your build output folder.
  • copy the the 'ocl.pyd' file from the build folder
  • navigate to your FreeCAD binary folder - You have three options:
    1. enter the 'bin' folder and paste the 'ocl.pyd' file there, as a loose file.
    2. enter the 'lib' folder and paste the 'ocl.pyd' file there, as a loose file. (preferred choice) [You should find 'area.pyd' in this folder also.]
    3. enter the 'Mod' folder, create a new folder titled 'OCL' or similar, enter that new folder, paste the 'ocl.pyd' file there
  • A fourth option:
    (least preferred choice if you plan to use both Python 2 and Python 3 versions of FreeCAD)
    • In Windows File Explorer, enter "%USERPROFILE%\AppData\Roaming\FreeCAD"
    • enter the 'Mod' folder - If it does not exist, create it (case sensitive)
    • create a new folder titled 'OCL' or similar, enter that new folder, paste the ocl.pyd file there
  • Re-start FreeCAD.
Glad to have another Windows user.
Let us know if you are still having issues.

P.S.: I noticed your FreeCAD version is 18.16110. The improved 3D Surface tool was not included in the distros until quite recently. I believe the improved version is backwards compatible with your FC version. If you wish to use the newer, more robust version, you will need to:
  • download the newest script manually from this post: 3D Surface: 4th-axis Integration and more...
  • navigate to your FreeCAD binary folder
  • navigate to 'Mod/Path/PathScripts'
  • rename your current PathSurface.py script - to save should you wish to revert
  • paste the downloaded version into the same folder
  • rename the downloaded version to the same as the original, PathSurface.py
  • Re-start FreeCAD
As @mlampert states, "Have fun!"
Russell
Last edited by Russ4262 on Fri May 31, 2019 9:44 pm, edited 3 times in total.
chrisb
Posts: 20632
Joined: Tue Mar 17, 2015 9:14 am

Re: OpenCAMlib for Windows

Postby chrisb » Sun May 12, 2019 8:45 am

Russ4262 wrote:
Sun May 12, 2019 3:03 am
To install the library,
Would you mind adding this to the wiki Path_Surface?
LMH
Posts: 4
Joined: Sat May 11, 2019 6:17 pm

Re: OpenCAMlib for Windows

Postby LMH » Sun May 12, 2019 8:46 am

Thanks Russel,
I now have access to surfacing jobs.
However, something seems to be off, it looks like it's not working properly.
Image
RatonLaveur
Posts: 391
Joined: Wed Mar 27, 2019 10:45 am

Re: OpenCAMlib for Windows

Postby RatonLaveur » Sun May 12, 2019 9:31 am

Hi LMH, congrats on making OCL for Windows in Py 3. Perhaps coordinate with sgrogan on this, because last i checked his latest work enabled us Windows users to use the Py 2 version only. If a new ocl.py file in Py 3 is available, i'll jump on it like a bee on honey.

As for your path discrepancy, i would first check if it's a meshing issue in your file. Parts generated by the PartDesign seem to have a very low resolution underlying mesh, and it can limit the accuracy of OCL scripts. see https://forum.freecadweb.org/viewtopic. ... 50#p298610

Generally if I see such an issue, I convert my part to .stl and then the .stl back to solid. If this solves your problem do tell us. If not we'll keep looking :)
LMH
Posts: 4
Joined: Sat May 11, 2019 6:17 pm

Re: OpenCAMlib for Windows

Postby LMH » Sun May 12, 2019 10:15 am

Converting to .stl did not do the trick, same result.
As for pushing the development of ocl on windows I don't think that I can be much help, as all I did was randomly throwing the provided files together and watching what VS would put out. My most advanced "programming" experience is writing my own cycle for slot shaping on a HEIDENHAIN TNC 620.
User avatar
sgrogan
Posts: 5535
Joined: Wed Oct 22, 2014 5:02 pm

Re: OpenCAMlib for Windows

Postby sgrogan » Sun May 12, 2019 4:09 pm

RatonLaveur wrote:
Sun May 12, 2019 9:31 am
Hi LMH, congrats on making OCL for Windows in Py 3. Perhaps coordinate with sgrogan on this, because last i checked his latest work enabled us Windows users to use the Py 2 version only. If a new ocl.py file in Py 3 is available, i'll jump on it like a bee on honey.
ocl for PY3 on win is available in the 0.19_pre developer builds already.
I recently tagged the 0.18.2 point release. I will add ocl.pyd for windows for this when I post the binaries.
User avatar
Russ4262
Posts: 259
Joined: Sat Jun 30, 2018 3:22 pm

Re: OpenCAMlib for Windows

Postby Russ4262 » Mon May 13, 2019 2:20 am

Evening ChrisB,
chrisb wrote:
Sun May 12, 2019 8:45 am
Russ4262 wrote:
Sun May 12, 2019 3:03 am
To install the library,
Would you mind adding this to the wiki Path_Surface?
Sir, I will need a few days, probably more. This is the last week of the school year; hence, I am quite busy. Also, I was only recently granted my wiki permissions and have not read up on protocols for editing, nor looked into how to properly edit the information. Summer vacation is a week away for me.

Nonetheless, yes, I will post it there.

Thanks,
Russell
User avatar
Russ4262
Posts: 259
Joined: Sat Jun 30, 2018 3:22 pm

Re: OpenCAMlib for Windows

Postby Russ4262 » Mon May 13, 2019 2:39 am

LMH,
Hello fellow FreeCAD user in Deutchland.
LMH wrote:
Sun May 12, 2019 8:46 am
However, something seems to be off, it looks like it's not working properly.
It is likely that you are using the original 3D Surface op, based upon what I see i the image. The artifacts look familiar. I would suggest upgrading to the latest 3D Surface op version. It is now available with the pre_0.19 nightly builds since about version 0.19.16699. I have quoted the install instructions below, taken from a few posts above in this topic.
Russ4262 wrote:
Sun May 12, 2019 3:03 am
P.S.: I noticed your FreeCAD version is 18.16110. The improved 3D Surface tool was not included in the distros until quite recently. I believe the improved version is backwards compatible with your FC version. If you wish to use the newer, more robust version, you will need to:
  • download the newest script manually from this post: 3D Surface: 4th-axis Integration and more...
  • navigate to your FreeCAD binary folder
  • navigate to 'Mod/Path/PathScripts'
  • rename your current PathSurface.py script - to save should you wish to revert
  • paste the downloaded version into the same folder
  • rename the downloaded version to the same as the original, PathSurface.py
  • Re-start FreeCAD
I believe you will have to upgrade to the latest 3D Surface version to yield better results. The original version included with the version 18 release was quite basic in features - an experimental proof of concept. The newer version is still considered experimental, but has many more features and yields better paths for users.

Additionally,
Please include the FreeCAD file containing the model (if possible) with which you request assistance. Doing so will allow the FC community to better serve your needs.

mfg
Russell
LMH
Posts: 4
Joined: Sat May 11, 2019 6:17 pm

Re: OpenCAMlib for Windows

Postby LMH » Mon May 13, 2019 4:57 pm

Hey Russel, I already followed your instructions on upgrading the script.
I'd suggest using the Surface Test Model Surface_0.fcstd from https://github.com/sliptonic/cnctorture ... /Surface_0
I got the following results:
Image
On another note: Is the philipps postprocessor still usable?