global mom_pos_arc_plane
global mom_sys_cir_vector
global mom_sys_helix_pitch_type
global mom_helix_pitch
global mom_prev_pos mom_pos_arc_center
global PI
switch $mom_pos_arc_plane {
XY { MOM_suppress once K ; set cir_index 2 }
YZ { MOM_suppress once I ; set cir_index 0 }
ZX { MOM_suppress once J ; set cir_index 1 }
}
switch $mom_sys_helix_pitch_type {
none { }
rise_revolution { set pitch $mom_helix_pitch }
rise_radian { set pitch [expr $mom_helix_pitch / ($PI * 2.0)]}
other {
#
# Place your custom helix pitch code here
#
}
default { set mom_sys_helix_pitch_type "none" }
}
MOM_force once X Y Z
if { [string compare "none" $mom_sys_helix_pitch_type] } {
MOM_force once I J K
#<08-01-06 gsl>
switch $mom_sys_cir_vector {
"Vector - Arc Center to Start" {
set mom_prev_pos($cir_index) $pitch
set mom_pos_arc_center($cir_index) 0.0
}
"Vector - Arc Start to Center" -
"Unsigned Vector - Arc Start to Center" {
set mom_prev_pos($cir_index) 0.0
set mom_pos_arc_center($cir_index) $pitch
}
"Vector - Absolute Arc Center" {
set mom_pos_arc_center($cir_index) $pitch
}
}
}
#
# You may need to edit this line if you output more than one block
# or if you have changed the name of your circular_move block template
#
global mom_pos
global mom_prev_pos
global mom_helix_turn_number
set pitch [expr abs($mom_helix_pitch)]
set feed_distance [expr abs($mom_pos($cir_index) - $mom_prev_pos($cir_index))]
if {[EQ_is_zero $pitch]} {
set mom_helix_turn_number 0
} else {
set mom_helix_turn_number [expr floor($feed_distance/$pitch)]
if { [EQ_is_equal $feed_distance [expr $mom_helix_turn_number * $pitch]] } {
set mom_helix_turn_number [expr $mom_helix_turn_number - 1]
}
}
switch $mom_pos_arc_plane {
XY { MOM_suppress once K ; MOM_force Once I J }
YZ { MOM_suppress once I ; MOM_force Once J K }
ZX { MOM_suppress once J ; MOM_force Once I K }
}