Thank you on both counts!

Here's my sub to make a turner's cube:


(Makes a turner's cube. See projects.txt for formulas).

O<turners_cube> sub
  #<xc>    = #1 (X Center)
  #<yc>    = #2 (Y Center)
  #<z>     = #3 (Current Z)
  #<size>     = #4 (Side)
  #<milld> = #5 (Mill Diameter)
  #<k1>    = #6
  #<k2>    = #7

  #<R> = [#<k1> * #<size>/2]

  O<if> if [ #<R> gt #<milld>]
    G0 X#<xc> Y#<yc>
    O<withdraw> call [#<z> + 0.01]
    #<d> = [ [#<x>/2 - #<R>] + #<k2>*#<R>*[1 - 1/sqrt[ 2 ]]]

    O<deepcylindricalpocket> call [#<xc>] [#<yc>] [#<z> + 0.01] [#<z> -
#<d>] [#<R>] [#<milld>]

    #<X1> = [#<size> - 2*#<d>]

    O<turners_cube> call [#<xc>] [#<yc>] [#<z> - #<d>] [#<X1>] [#<milld>]
[#<k1>] [#<k2>]
  O<if> endif

  G0 X#<xc> Y#<yc>
  O<withdraw> call [#<z> + 0.01]
O<turners_cube> endsub

M2

i

On Mon, Mar 14, 2011 at 11:34 PM, Kim Kirwan <[email protected]> wrote:

> Hi Igor,
>
> Good to write to you. I have been following your BP2
> project with great interest.
>
> >From the docs, EMC2 User Manual v2.4, Chapter 17.1, page 121:
>
> [Subroutines] may be called from other functions, and may
> call themselves recursively if it makes sense to do so.
> The maximum subroutine nesting level is 10.
>
> Kim
>
>
> On 03/14/2011 09:47 PM, Igor Chudov wrote:
> > I am thinking about making a turner's cube on a mill.
> >
> > It is an easy task, but for elegance, I would really like to write a
> > turner's cube subroutine that would call itself recursively.
> >
> > O<mysub> sub
> > ...
> > ...
> > ... O<if> if [something]
> >        O<mysub> call [...]
> >    O<if> endif
> > ...
> > O<mysub> endsub
> >
> > Can I do that?
> >
> ------------------------------------------------------------------------------
> > Colocation vs. Managed Hosting
> > A question and answer guide to determining the best fit
> > for your organization - today and in the future.
> > http://p.sf.net/sfu/internap-sfd2d
> > _______________________________________________
> > Emc-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/emc-users
> >
> >
>
>
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users
>
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to