Screw Maker

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Screw Maker

Post by ulrich1a »

Hi Yan,

I have to thank you for debugging. Please can you make this additional test with face_test2.py. It gives the correct cut-tool on my system. I get the following output from the script called with execfile("Path_to_script") in the console:

Code: Select all

>>> execfile("/home/ulrich/FreeCAD/screw_maker/face_test2.py")
disk-Orientation: Forward
disk-Surface: <Plane object>
disk-axis: Vector (-0.0, 0.0, -1.0)
hex-Orientation: Forward
hex-Surface: <Plane object>
hex-Axis: Vector (0.0, 0.0, -1.0)
I want to see, what is different on your system. So can you post the output of the script and your FreeCAD version. Please call the "about" dialog from FreeCAD and click the button "Copy to clipboard" and paste the copied content in the forum post.
My system:
OS: Debian GNU/Linux 8.4 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7552 (Git)
Build type: Release
Branch: remotes/origin/master
Hash: 8217b8f6d1a6743e31bf998048a3c1691bc1e2e9
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

I can provoke the wrong cut-tool with a hex-wire going the other direction around. But I want to know, what shape is different on your side.

Thanks
Ulrich
Attachments
face_test2.py.zip
(1.37 KiB) Downloaded 88 times
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Screw Maker

Post by cox »

Here is the test done on 0.16 relese and 0.17 dev they both create this

EDIT:Added test with Yorik's Python 3 port. at the end
Screenshot_20160515_223847.png
Screenshot_20160515_223847.png (7 KiB) Viewed 3124 times
OS: "Arch Linux"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Release
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1

Code: Select all

>>> execfile("/home/kjetil/Nedlastinger/FC/face_test2.py/face_test2.py")
disk-Orientation: Forward
disk-Surface: <Plane object>
disk-axis: Vector (0.0, 0.0, 1.0)
hex-Orientation: Forward
hex-Surface: <Plane object>
hex-Axis: Vector (0.0, 0.0, 1.0)
>>> 
OS: "Arch Linux"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7512 (Git)
Build type: Unknown
Branch: master
Hash: ec54c092d5acdf0616c53ba79a293db28e38947f
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1

Code: Select all

>>> execfile("/home/kjetil/Nedlastinger/FC/face_test2.py/face_test2.py")
disk-Orientation: Forward
disk-Surface: <Plane object>
disk-axis: Vector (0.0, 0.0, 1.0)
hex-Orientation: Forward
hex-Surface: <Plane object>
hex-Axis: Vector (0.0, 0.0, 1.0)
>>> 


OS: "Arch Linux"
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.7607 (Git)
Build type: Unknown
Branch: py3-17
Hash: ac41a2aa703e2b29f7739a96103be1e50e111117
Python version: 3.5.1
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1

Code: Select all

Python 3.5.1 (default, Mar  3 2016, 09:29:07) 
[GCC 5.3.0] on linux
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> with open("/home/kjetil/Nedlastinger/FC/face_test2.py/face_test3.py") as f:
...     code = compile(f.read(), "/home/kjetil/Nedlastinger/FC/face_test2.py/face_test3.py", 'exec')
...     exec(code)
... 
disk-Orientation:  Forward
disk-Surface:  <Plane object>
disk-axis:  Vector (0.0, 0.0, 1.0)
hex-Orientation:  Forward
hex-Surface:  <Plane object>
hex-Axis:  Vector (0.0, 0.0, 1.0)
Last edited by cox on Sun May 15, 2016 8:52 pm, edited 1 time in total.
Need help? Feel free to ask, but please read the guidelines first
Yan
Posts: 10
Joined: Sat May 14, 2016 6:43 am

Re: Screw Maker

Post by Yan »

Hi ulrich1a,
pleasure on my side.

incorrect cutting tool as usual :mrgreen:

Looks like both axis vectors are inverted:

Code: Select all

>>> execfile("/home/yan/documents/bench/freecad/modding/face_test2.py")
disk-Orientation: Forward
disk-Surface: <Plane object>
disk-axis: Vector (0.0, 0.0, 1.0)
hex-Orientation: Forward
hex-Surface: <Plane object>
hex-Axis: Vector (0.0, 0.0, 1.0)
>>> 
I'm using Archlinux.

My system:
OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Release
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1
User avatar
shaise
Posts: 491
Joined: Thu Jun 11, 2015 8:11 am

Re: Screw Maker

Post by shaise »

I do not know if it counts for openscad, but for many vector art apps, the inner area of a face is to the left of the direction of the path, such that a face with a hole, the outer path direction is counter-clockwise and the inner path is clockwise.
Yan
Posts: 10
Joined: Sat May 14, 2016 6:43 am

Re: Screw Maker

Post by Yan »

tried to recompile freecad with older version of python.

OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Release
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.9.1

still wrong result, so it's not python, will try to continue search afternoon. Now compiling with coin 4.0.0a

EDIT: compilation of coin 4.0.0a sucesfull, compiling FreeCAD with new coin version also sucesfull but it runs into segfault when I want to start FreeCAD.
Last edited by Yan on Mon May 16, 2016 11:28 am, edited 1 time in total.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Screw Maker

Post by ulrich1a »

Yan wrote:still wrong result, so it's not python, will try to continue search afternoon. Now compiling with coin 4.0.0a
I think it is more or less clear: It is an incompatibility between OCCT 6.9.1 with OCCT 6.8.0. It could also be a bug in the OCE-version of OCCT 6.8.0.

OCCT has a test harness: Drawexe. This is an command-line-interpreter of OCCT-commands which can also visualize the result. It is useful for bug-reports about OCCT. Shoogen has built an exporter in the FreeCAD-Sandbox-Workbench, which can export FreeCAD-objects into Drawexe-commands. The resulting file(s) can be used to make bug-reports at OCCT.
This is one of the next steps to be done.

On the other side, I have to consider using Yans-workaround or make the Screw-maker-script checking the OCCT-version and using different code for each version.

Ulrich
Yan
Posts: 10
Joined: Sat May 14, 2016 6:43 am

Re: Screw Maker

Post by Yan »

Ok,
i will try to recompile with OCC 6.8.0 .

ulrich1a:
Ok, so i should:
1. get FreeCAD-Sandbox-Workbench
2. generate "wrong cutting tool" (and "correct cutting tool" with two aproppiate OCC versions)
3. export those freecad objects into Drawexe-command

Is that correct?

EDIT2: OCC recompiled to 6.8.0, recompiling freecad.
Last edited by Yan on Mon May 16, 2016 1:07 pm, edited 2 times in total.
cox
Posts: 971
Joined: Wed Nov 26, 2014 11:37 pm

Re: Screw Maker

Post by cox »

I wonder if this could be the source of many of the inverted arcs we have seen sporadically over the last year?
Need help? Feel free to ask, but please read the guidelines first
Yan
Posts: 10
Joined: Sat May 14, 2016 6:43 am

Re: Screw Maker

Post by Yan »

working - confirmed that it's OCC issue

OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Release
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0

Code: Select all

>>> execfile("/home/yan/documents/bench/freecad/modding/face_test2.py")
disk-Orientation: Forward
disk-Surface: <Plane object>
disk-axis: Vector (-0.0, 0.0, -1.0)
hex-Orientation: Forward
hex-Surface: <Plane object>
hex-Axis: Vector (0.0, 0.0, -1.0)
>>> 
Cannot find that Shoogen's exporter. Can you please provide link?
Attachments
working.jpg
working.jpg (4.38 KiB) Viewed 3043 times
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Screw Maker

Post by ulrich1a »

Yan wrote:Cannot find that Shoogen's exporter. Can you please provide link?
It is already contained in FreeCAD, if the Sandbox-Workbench is activated with cmake. (see picture)
Export_to_DRAWEXE.png
Export_to_DRAWEXE.png (30.65 KiB) Viewed 3011 times
Unfortunately this does not help, because only the created shape is exported with a few commands to load and show it in DRAWEXE. What is needed in this case, is the procedure to create the shape. I looked up the DRAWEXE-commands. It could be "gplate" found here under Surface creation: http://dev.opencascade.org/doc/overview ... raw_7_10_1

I could not test so far.

Ulrich
Post Reply