[SUBROUTINE] icon = icons/rect-corner.png name = Rectangle image = images/rect-corner.png type = Rectangle help = Creates rectangle W H X0 Y0 order = 01 02 03 04 05 06 07 08 09 10 [PARAM_01] name = X0 type = float icon = icons/rect-corner.png tool_tip = X0 value = 0 [PARAM_02] name = Y0 type = float icon = icons/rect-corner.png tool_tip = Y0 value = 0 [PARAM_03] name = Width type = float icon = icons/width.png tool_tip = Width value = 20 [PARAM_04] name = Height type = float icon = icons/height.png tool_tip = Height value = 10 [PARAM_05] name = Angle type = float icon = icons/angle.png tool_tip = Angle value = 0 [PARAM_06] name = Depth type = float icon = icons/height.png tool_tip = Depth value = #<_global_depth> [PARAM_07] name = Depth step type = float icon = icons/dz.png tool_tip = Depth step per pass value = #<_global_depth_step> [PARAM_08] name = Surface type = float icon = icons/dz.png tool_tip = Surface height value = #<_global_surface> [PARAM_09] name = Rappid type = float icon = icons/height.png tool_tip = Rappid height value = #<_global_rappid> [PARAM_10] name = Final cut type = float icon = icons/height.png tool_tip = Rappid height value = #<_global_final> [DEFINITIONS] content = (Multipass sub definition) O SUB # = #1 # = #2 # = #3 # = #4 # = #5 # = #6 # = #7 # = #8 # = #9 # = #10 # = #11 G0 Z# G0 X# Y# # = # G1 Z[#] O WHILE [# GT [#+#]] # = [#] # = [#-#] O IF [# LT [#+#]] #=[#+#] O ENDIF (call pass sub with the restof parameters) # = #1 O#1 CALL [#] [#] [#] [#] [#] [#] [#-#] O ENDWHILE (Make final cut) O#1 CALL [#] [#] [#] [#] [#] [#] [#] O#1 CALL [#] [#] [#] [#] [#] [#] [0] G0 Z# O ENDSUB self.include_once("rotate-xy.ngc") #<_rect> = self.get_unique_id() ; should be unique id (Rectangle sub definition) O#<_rect> sub # = #1 # = #2 # = #3 # = #4 # = #5 # = #6 # = #7 # = [#/[2*[#+#]]] O CALL [0] [1] [0] [0] [#] # = #<_rotate_result_x> # = #<_rotate_result_y> # = [#+#*#] # = [#-#*#] # = [#-#*#] G01 X# Y# Z[#] # = [#+#*#] # = [#+#*#] # = [#-#*#] G01 X# Y# Z[#] # = [#-#*#] # = [#+#*#] # = [#-#*#] G01 X# Y# Z[#] # = [#-#*#] # = [#-#*#] # = [#-#*#] G01 X# Y# Z[#] O#<_rect> endsub [CALL] content = ( *********************************** ) ( Rect Call ) # = [#param_01] # = [#param_02] # = [#param_03] # = [#param_04] # = [#param_05] O CALL [#] [#] [#] [#] [#] # = #<_rotate_result_x> # = #<_rotate_result_y> ( sub depth step surf rappid final) O CALL [#<_rect>] [#param_06] [#param_07] [#param_08] [#param_09] [#param_10] [#] [#] [#] [#] [#] ( *********************************** ) [BEFORE] content = [AFTER] content =