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

# Re: [femm] obtaining node co-ordinates

- To: femm@yahoogroups.com
- Subject: Re: [femm] obtaining node co-ordinates
- From: David Meeker <dmeeker@ieee.org>
- Date: Thu, 21 Aug 2003 12:59:21 -0400
- In-reply-to: <bi2nrp+br0r@eGroups.com>
- References: <bi2nrp+br0r@eGroups.com>
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4; MultiZilla v1.4.0.4A) Gecko/20030624

James Pawson wrote: `I'm using a basic LUA file in BELA to start evaluating its scripting capabilities. When I call showmesh() from the console or script file, the mesh appears and then as the view is refreshed, disappears agian. It's just a minor niggle, but does anyone know a way around it? LUA file being used -- Run "triangle" to generate a mesh createmesh() -- show the mesh in BELAdraw showmesh()` The "showmesh" command actually toggles the state of some internal variable called showmesh which determines whether or no the mesh is shown. By default, "createmesh" shows the mesh that it creates. So, by calling createmesh() and then showmesh(), you're actually telling it to not display the mesh. If you want to make a mesh and have it displayed, just calle createmesh() alone. ``In addition to my first question, I have another (this is the first time I've used BELA) I want to obtain the x,y co-ordinates for a selected node in LUA. There is already the facility to select the node nearest to a set of given x,y co-ordinates using the selectnode() command, but I want to extract the exact co-ordinates of the selected node Can anyone help?`` There currently isn't a built-in way of doing that, but it would be easy to modify the implementation of the selectnode() command to return the coordinates of the selected node. At the end of the lua_selectnode implemenation in luadoc.cpp, just replace: return 0; with lua_pushnumber(L,thisDoc->nodelist[node].x); lua_pushnumber(L,thisDoc->nodelist[node].y); return 2; and recompile. This would then return the coordinates of the selected node. -- David Meeker email: dmeeker@ieee.org www: http://femm.berlios.de/dmeeker

- Follow-Ups:
  - Re: obtaining node co-ordinates
    - From: "James Pawson" <thedatastream@yahoo.com>
  - Re: obtaining node co-ordinates
    - From: "James Pawson" <thedatastream@yahoo.com>

- References:
  - Re: obtaining node co-ordinates
    - From: "James Pawson" <thedatastream@yahoo.com>

- Prev by Date: Re: [femm] Some doubtful in BELA..
- Next by Date: Re: obtaining node co-ordinates
- Previous by thread: Re: obtaining node co-ordinates
- Next by thread: Re: obtaining node co-ordinates
- Index(es):
  - Date
  - Thread