[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

# RE: [femm] lua scripting

- To: <femm@yahoogroups.com>
- Subject: RE: [femm] lua scripting
- From: "Robin Cornelius" <robin.cornelius@hirst-magnetics.com>
- Date: Thu, 18 Oct 2001 14:21:34 +0100
- Importance: Normal
- In-reply-to: <OF469FD6E4.37C30E45-ONC1256AE9.00359A54@sogagroup.com>
- Reply-to: <robin.cornelius@hirst-magnetics.com>

    ;
    ;Hi everybody
    ;
    ;In a Lua setgrid() is not available for preprocessor.
    ;Since i find comfortable switching from polar to cartesian coordinates and
    ;vice versa for adding nodes, is there a way to do this?
    ;I think about setgrid() for preprocessor or, better, something like
    ;addnodepolar(r, theta) and eventually selectnodepolar(r, theta).

    you could very easily create an addnodpolar() user function as you have full
    maths functions in lua
    eg.

    function addnodepolar(r,theta)
    x=r * sin(theta);
    y=r * cos(theta);
    addnode(x,y);
    end

    remembering to switch sine and cosine to be approprate for your 0 degree
    point.

    just insert that at the top of your lua script and it can be used like any
    other function.

    you can build a whole libray of these sort of functions. Maybe if i get five
    minues I will create a polar include library as above but for all functions
    with co-ordinates. then you can just use

    dofile(polarinclude.lua)

    to insert the polar routines!

    ;Another question.
    ;Is it possible to create a recording of the interaction with femm, in Lua?
    ;I mean something like a macro recording in Lua.
    ;In this way it would be very fast to set up a problem directly in Femm, and
    ;than manage modifications in Lua.

    I thought about that when I first started adding lua to femm. It would be
    very nice to turn recording on press buttons etc and have a lua script of
    what you did. Maybe in the future ? ( A lot of cold rainy nights are ahead
    for winter!)

    Hope that helps

    Robin

    _______________________________
    ing. G.Bortolan

    Sincro srl
    via Tezze, 3 loc. Cereda
    36073 Cornedo Vicentino (VI)
    Tel: (++39) 0445 450 500
    Fax: (++39) 0445 446 222
    e-mail: Giovanni.Bortolan@sogagroup.com
    tecnico.sincro@sogagroup.com

    REA 194515/VI
    Reg. Imp. 20968/VI 116
    P.IVA 01925820241

    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

- References:
  - lua scripting
    - From: giovanni.bortolan@sogagroup.com

- Prev by Date: lua scripting
- Next by Date: Re: [femm] Boundary conditions of induction motor
- Previous by thread: lua scripting
- Next by thread: Re: [femm] Boundary conditions of induction motor
- Index(es):
  - Date
  - Thread