Two new commands, FILEPUTARRAY Fix, and general speed boost

8 views
Skip to first unread message

John Bridges

unread,
Aug 8, 2013, 1:41:35 PM8/8/13
to after...@googlegroups.com
New build of AfterGRASP is up for download:
 
 
agsetup_20130808.exe
 
----------------------------------------------------------------------------
Thu, 08 Aug 2013

FILEPUTARRAY and FILEPUTARRAYNAMED were converting array contents to all
strings. Fixed so the data is now untouched.

DRAWSEGMENTSSORT & DRAWSEGMENTSMERGE
Two new commands added for dealing with arrays of line segments. Usually
X axis only, or Y axis only, with an optional overlap check field.

local test array(array(102,108),array(5,75),array(112,150),array(5,75),array(80,109))
drawsegmentssort test ;gives:
;array(array(5,75),array(80,109),array(102,108),array(112,150))

drawsegmentsmerge test ;gives:
;array(aray(5,75),array(80,109),array(112,150))


Script code which does exactly what these new commands do (although far far
slower).


DRAWSEGMENTSSORT:
 declare s
redo1:
 if s->size>1
  for a from 0 to s->size-2
   for b from @a+1 to s->size-1
    if @s[@a][0]>@s[@b][0]
     local tmp &s[@b]
     s[@b] = &s[@a]
     s[@a] = &tmp
    else
     if @s[@a][0]==@s[@b][0]&&@s[@a][1]==@s[@b][1]
      s[@a][2] = @s[@a][2]||@s[@b][2]
      arraydelete s @b
      goto redo1
     endif
    endif
   next
  next
 endif
 return


DRAWSEGMENTSMERGE:
 declare s
redo2:
 if s->size>1
  for a from 0 to s->size-2
   for b from @a+1 to s->size-1
    if @s[@a][2]||@s[@b][2] continue
    if @s[@a][1]>@s[@b][0]
     if @s[@a][1]<@s[@b][1]
      s[@a][1] = @s[@b][1]
     endif
     arraydelete s @b
     goto redo2
    endif
   next
  next
 endif
 return
 


----------------------------------------------------------------------------
Mon, 05 Aug 2013

Several general performance boosts to AG Interpreter, particular with
constant numerical values and strings, and simple function calls.

----------------------------------------------------------------------------
Fri, 02 Aug 2013

Occasional crash bug in DEBUGPROFILE fixed.

----------------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages