________________________________
From: Jim mack <j...@less2do.com>
To: factor-talk@lists.sourceforge.net
Sent: Wed, February 3, 2010 10:02:50 PM
Subject: Re: [Factor-talk] slide-rule

> I am just getting started in Factor, and am partially drawn to the ability to 
> do cross platform GUI development, but I thought I should mention a cool 
> ability to ship a self-contained HTTP server using their easy to use furnace 
> library.  It could launch a browser to itself on startup and produce the 
> output format file locally.  If you already do web programming it shouldn't 
> be much of a learning curve.



I have never done any GUI programming or web programming, so either approach 
would represent new ground for me. I am somewhat dubious of the idea of a 
browser/server, as there is a lot of data to work with. I could be wrong, 
considering that I've never done this, but my understanding of the 
browser/server idea is that the program running on the browser is dealing with 
a very small amount of data such as the fields in a data-entry form.

Perhaps it would help if I explained how my slide-rule program works: It is a 
three-stage process:

1.) I have words such as D-scale, A-scale, etc., that each generate a 
linked-list representing the scale. Each node is a MARK:

list
    w field .kind                \  the kind of mark this is (TNY, SML, MID, 
BIG or XTR)
    f field .n                       \ the numeric value of the mark 
(corresponds to .LABEL)
    f field .dist                   \ derived from N and measured in Lunits 
(distance from left edge)
    w field .orientation       \ the direction of the label in relation to the 
mark
    w field .label                \ the hstr of the label if there is a label
constant mark

\ If .ORIENTATION is N/A, then there is no label and .LABEL is irrelevant.
\ The DIST value is nominally in the range [0,1], although it might extend over 
the edge slightly.

2.) I convert these MARK lists into SHAPE lists. These contain absolute 
coordinates (in inches) of all the marks and labels on a particular face of the 
slide-rule. Each node is a SHAPE:

list 
    p field .src
    p field .dst
    w field .siz
    w field .txt
constant shape         \ a text string or a line segment

\ The P fields are .X and .Y pairs.
\ If the .SIZ field is a KIND (TNY, SML, MID, BIG or XTR), then the shape is a 
text string.
\ The .SRC field is the lower-left corner and the .DST field is not used.
\ If the .SIZ field is N/A, then the shape is a line segment.
\ The .SRC and .DST fields are the endpoints.

3.) I convert the SHAPE lists into gcode. All the information in each SHAPE 
node gets etched with G01 commands, and I also pick up the tool and move it 
with a G00 command from each element to the next.

The Factor program would be the same as the Forth except that I will use 
sequences rather than linked lists, as linked lists are apparently not 
idiomatic in Factor. The GUI would allow the user to drag-and-drop the scales 
into place to construct the slide-rule, and would also allow the user to 
simulate the use of the slide-rule by moving the slide and the cursor to and 
fro on the constructed slide-rule. There would have to be an alternative #3 
step above that generates some kind of graphical image rather than gcode.

Does Factor have the ability to display SVG on the screen? Or would I need to 
generate some other kind of graphical image? If Factor has support for 
displaying graphical images (of any kind) on the screen, then I think the whole 
thing would be best written in Factor as a GUI program. If Factor can't do 
this, then it might be better to have the Factor program generate SVG on the 
server side, and then write a JavaScript program to run in a browser and 
display the SVG images. 



      
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to