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

# Re: [femm] Selectgroup problem

- To: femm@yahoogroups.com
- Subject: Re: [femm] Selectgroup problem
- From: David Meeker <dmeeker@ieee.org>
- Date: Sat, 24 May 2003 09:53:01 -0400
- In-reply-to: <009f01c321c8$b9ea1f10$0b00a8c0@SEFDP003>
- References: <balnce+10tit@eGroups.com> <009f01c321c8$b9ea1f10$0b00a8c0@SEFDP003>
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3.1) Gecko/20030425

The last segment in the square never gets assigned to group 3. If you change the line:
selectsegment(x1,y1)
in function setsegment(x1, y1, x2, y2, group) to:
selectsegment((x1+x2)/2,(y1+y2)/2)
it ought to work ok. The way that you had it, there was ambiguity as to which segment actually got selected.
Dave.
Eric Vogels wrote:

> Hello.
> I made a lua-script but I have a problem with it. I stripped all the code that works fine and only have the problem left.
> -- ---------------------------------------------------------Start code
> -- function to add nodes to group x
> function setnode(x, y, group)
> addnode(x,y)
> selectnode(x,y)
> setnodeprop("<none>",group)
> clearselected()
> end
> -- function to add segement to group x
> function setsegment(x1, y1, x2, y2, group)
> addsegment(x1,y1,x2,y2)
> selectsegment(x1,y1)
> setsegmentprop("<none>",1,1,0,group)
> clearselected()
> end
> -- Stators
> setnode(8,4,3)
> setnode(8,3,3)
> setnode(9,3,3)
> setnode(9,4,3)
> setsegment(8,3,8,4,3)
> setsegment(9,4,8,4,3)
> setsegment(9,3,9,4,3)
> setsegment(8,3,9,3,3)
> selectgroup (3)
> copyrotate(4.076,4.076,45,7)
> -- ---------------------------------------------------------End code
> The problem is that the last 'setsegment(- statement does not set the groupnr 3 but all other statements work fine. The copyrotate is missing a segment while copying because of that. Does someone see what I did wrong? I tried a lot of changes and I'm running out of fantasy. Please help.
> Best regards,
> Eric.

    --
    David Meeker
    dmeeker@ieee.org
    http://femm.berlios.de/dmeeker

- Follow-Ups:
  - Re: [femm] Selectgroup problem
    - From: "Eric Vogels" <eric.vogels@telia.com>

- References:
  - Voice Coil Motor with Aluminum bobbin
    - From: "tano1938" <rgarritano@comcast.net>
  - Selectgroup problem
    - From: "Eric Vogels" <eric.vogels@telia.com>

- Prev by Date: Selectgroup problem
- Next by Date: Re: [femm] Selectgroup problem
- Previous by thread: Selectgroup problem
- Next by thread: Re: [femm] Selectgroup problem
- Index(es):
  - Date
  - Thread