elliotf / heekscnc

Automatically exported from code.google.com/p/heekscnc
Other
1 stars 0 forks source link

CW arcs displayed as CCW arcs in preview #261

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
- load attached arctest.heeks, generate and run py, use perspective view

What is the expected output? What do you see instead?
the first arc is CCW, the second is CW. Both are displayed spiraling down CCW. 
See bug.png screenshot.

I have a tentative fix for the problem - I'd appreciate a review (output after 
fix is in ok.png, sorry for the white stripe):

mah@ubuntu-10:~/HeeksCAD/heekscnc/src$ svn diff NCCode.cpp 
Index: NCCode.cpp
===================================================================
--- NCCode.cpp  (Revision 1218)
+++ NCCode.cpp  (Arbeitskopie)
@@ -284,6 +284,11 @@
        angle_step = (end_angle - start_angle) / number_of_points;
    } // End if - else

+   if (m_dir == -1)
+   {
+       // fix preview problem for cw arcs
+       angle_step = -angle_step;
+   } // End if - else
    points.push_back( gp_Pnt( prev_po->m_x[0], prev_po->m_x[1], prev_po->m_x[2] ) );

    for(unsigned int i = 0; i< number_of_points; i++)

Original issue reported on code.google.com by haberl...@gmail.com on 31 Oct 2010 at 8:56

Attachments:

GoogleCodeExporter commented 9 years ago
this seems to be finally fixed in r1225. 

Happened only on full CW circles; CW arcs smaller than 360 degrees displayed OK.

Original comment by haberl...@gmail.com on 1 Nov 2010 at 11:53

GoogleCodeExporter commented 9 years ago
This is OK for me. I don't think I use full arcs in the NC code.

Original comment by danhe...@gmail.com on 1 Nov 2010 at 12:03