FreeCad cartesian coordinates

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Geraldhemel2
Posts: 55
Joined: Mon Sep 15, 2014 10:18 am

Re: FreeCad cartesian coordinates

Post by Geraldhemel2 »

No that file was just a example.
The lenses are normally not rotation symmetric.
If I had money to spend, I didn't try to do this by myself. :lol:

Could you look at this problem I have?:

The jump from z0.0000 tot Z2.499954 isnt good, and the last jump from x0.087502 to 2.4975 is also a big problem.
I like the CNC to go easy from C0X0Z0Y0 until the end.
What could this be?
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: FreeCad cartesian coordinates

Post by shoogen »

Geraldhemel2 wrote:Could you look at this problem I have?:
The jump from z0.0000 tot Z2.499954 isnt good, and the last jump from x0.087502 to 2.4975 is also a big problem.
That is nearly impossible. The script contains an if-clause. if the distance between the surface and the "ray" along z is greater that the threshold (0.1µm) the whole point is skipped.
You could increase the threshold, which might lead to a coarser output.
You could reenable the debug output in the else-clause (below "pass"). This will output the distance calculated an further details on the geometry involved.
But can't do anything without geometry data.
Geraldhemel2
Posts: 55
Joined: Mon Sep 15, 2014 10:18 am

Re: FreeCad cartesian coordinates

Post by Geraldhemel2 »

Thank you,

I allready understand somethings from your code.
Can you tell me how I can increase the distance? From 0.7mm Xax, till something larger?
The Zax doesnt give me numbers, only 0.0000
Can you tell me what I'm doing wrong?
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: FreeCad cartesian coordinates

Post by shoogen »

Geraldhemel2 wrote:Can you tell me how I can increase the distance? From 0.7mm Xax, till something larger?
There was a mistake. The maximal value is given by the rmax paramter. And it should have been set to the rmax definded by the boundding box of the selected shape. https://gist.github.com/5263/1e9c326657 ... /revisions
Geraldhemel2 wrote:The Zax doesnt give me numbers, only 0.0000
Can you tell me what I'm doing wrong?
No, I'm afraid. I can't.
shoogen wrote:But can't do anything without geometry data.
Geraldhemel2
Posts: 55
Joined: Mon Sep 15, 2014 10:18 am

Re: FreeCad cartesian coordinates

Post by Geraldhemel2 »

At the moment I have renamed the :

Code: Select all

if dist < 10:
        maxz = 10 # max([p1.z for p1,p2 in pts])
        return (r,phi,maxz)
Now I have 20mm size products.
The moment I have found how to get an X, I also will post it here.
Shoogen, many thanks, if you remember a way to get the Zax also functional, please let me know.
:)
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: FreeCad cartesian coordinates

Post by shoogen »

Code: Select all

if dist < 10:
        maxz = 10 # max([p1.z for p1,p2 in pts])
        return (r,phi,maxz)
dist < 10 allows a deviation of 10 mm between the calculated point and the surface. I repeat 10mm. 10000µm. 40% of the workpiece diameter (in the file you posted)
And this is not meant in Z direction. The purpose was to detect when the "z-ray" does not intersect. and distance has components in X and Y.
if you don't use the z component of p1 (orp2) and replace it the constant z=10 the whole script becomes pointless.
Five lines of manual G-Code should allow you to perform a planar facing operation.
Geraldhemel2 wrote:if you remember a way to get the Zax also functional, please let me know.
I don't understand the problem.
Geraldhemel2
Posts: 55
Joined: Mon Sep 15, 2014 10:18 am

Re: FreeCad cartesian coordinates

Post by Geraldhemel2 »

When I change the

Code: Select all

if dist < 1:
Then the program does the full CNC size, until X12.
If I dont change this parameter the CNC code only goes untill X0.7

The Zax is always zero. I would like to know the Zax , thats the point of this program.
this is an example of the CNC code that the program generates :

Code: Select all

C43353.966793X12.042769Z1.390658Y0.0000
C43362.644529X12.045179Z1.390658Y0.0000
C43371.322264X12.047590Z1.390658Y0.0000
C43380.000000X12.050000Z1.390658Y0.0000
I appreciate your effort and input ;)
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: FreeCad cartesian coordinates

Post by shoogen »

Do you mean the Y-Axis?
https://gist.github.com/5263/1e9c326657 ... ing-py-L48

Code: Select all

print 'C%1.6fX%1.6fZ%1.6fY%1.4f' % (math.degrees(phi),r,z,0)
The tuple contains the values. The 0 is for the Y-Axis. r is for X and z is Z.

In your example Z is 1.390658.
Geraldhemel2
Posts: 55
Joined: Mon Sep 15, 2014 10:18 am

Re: FreeCad cartesian coordinates

Post by Geraldhemel2 »

But the Z is also non variable, the value stays the same.
Geraldhemel2
Posts: 55
Joined: Mon Sep 15, 2014 10:18 am

Re: FreeCad cartesian coordinates

Post by Geraldhemel2 »

shoogen wrote:Do you mean the Y-Axis?
https://gist.github.com/5263/1e9c326657 ... ing-py-L48

Code: Select all

print 'C%1.6fX%1.6fZ%1.6fY%1.4f' % (math.degrees(phi),r,z,0)
The tuple contains the values. The 0 is for the Y-Axis. r is for X and z is Z.

In your example Z is 1.390658.
Yes I , you are right. But the value stays 1.390658 for the last 500 lines. The first 6866 lines it is 0.0000.

This is my output file :

https://dl.dropboxusercontent.com/u/861 ... ogen12.txt
Post Reply