From paxton at kitp.ucsb.edu Thu Jun 1 09:28:57 2006 From: paxton at kitp.ucsb.edu (Bill Paxton) Date: Thu, 1 Jun 2006 06:28:57 -0700 Subject: [Tioga-users] Tioga 3d axes, making simple things simpler, and other good ideas In-Reply-To: References: Message-ID: <9C6366D1-CD4B-4017-8597-D5A49CE87BF2@kitp.ucsb.edu> Hello from the airport waiting area in Reykjavik! I'm on my way back to Santa Barabara after a wonderful trip in a converted Russian research ship around Iceland and up to the ice pack near Greenland. Here's one of the many photo's I took -- great fun! -------------- next part -------------- A non-text attachment was scrubbed... Name: ice.jpg Type: image/jpeg Size: 56224 bytes Desc: not available Url : http://rubyforge.org/pipermail/tioga-users/attachments/20060601/84b11869/attachment-0001.jpg -------------- next part -------------- During the voyage I was out of email contact, so I've been catching up this morning. I'm happy to see the conversations going on concerning Tioga. Here are a few comments. On May 28, 2006, at 6:48 AM, Edwin wrote: > I've been working (slowly) on adding 3d plotting capabilities to > tioga. > Till now I've jut plotted a line to represent every axis, but was > wondering about the best way to get proper axes. As far as I can > tell the > standard axis drawing routines of tioga only allow to draw them > horizontal > or vertical etc. Would it be possible to have a routine that accepts a > starting point and an ending point and draws an axis complete with > ticks+labels etc between those? Edwin: I believe you've quickly reached the crux of the problem with 3D. The issues around axes stopped me when I briefly considered trying to include 3D for the initial Tioga. I can only wish you luck and suggest that you leave lots of lower-level hooks to let people craft special axis layouts for themselves. Putting some effort into getting the defaults "right" is of course important, but there's no way to anticipate every case for every user. BTW: yes, the axis routines in Tioga are horizontal and verical only for plotting. For fancier stuff, you'll need to do your own, but perhaps we can find some useful utilities in the 2D code that might help. For example, I expect that the routines for picking locations for tick marks should be the same. If you haven't already done so, you should take a look at axes.c and see what if anything might be useful for the 3D code. On May 30, 2006, at 12:43 PM, Edwin wrote: > To be honest the way tioga > works with one _big_ figuremaker class is a bit counterintuitve for my > ruby eyes :) The "one big class" approach is admittedly a compromise. I'm hoping that Tioga will be a "gentle" introduction to the use of classes and methods for those who have not yet had their eyes opened to modern programming practices. Believe it or not, some of my friends still think fortran77 and supermongo are the perfect solution for any programming problem! Some of my design decisions where made to improve the chances of getting these poor folks to migrate to Tioga/ Ruby -- I'll have to ask for patience from the ruby experts for the counterintuitive monster class that results! On Wed, 31 May 2006 01:50:10 +0100, Alex Gutteridge wrote: > I'd just thought I'd mention that I've been > thinking along the same lines. Although I really like the flexibility > and pretty output from Tioga, there's quite a learning curve, even if > you just want to do simple things. On May 31, 2006, at 4:47 AM, Edwin wrote: > Something that I've been thinking about is a simple plot method > that just > plots a couple of dvectors/arrays and automatically opens the pdf > file. > I've created one of those to use gnuplot before, but it would be > nice to > be able to use tioga. On May 31, 2006, at 8:50 AM, Roy Mayfield wrote: > I asked Bill about the same thing last summer, and he gently noted > that > that is really easy to do in a ruby script (simpler than his > examples). > It took me awhile to get used to the make_preview_pdf() method, but I > now agree with him and suggest that Tioga's code space be guarded for > tough tasks (like your 3D idea, Edwin, which is really cool). On May 31, 2006, at 9:25 AM, Edwin wrote: > It is indeed rather simple and I agree that it should not be > included in > the FigureMaker class. On the other hand it doesn't make much sense > for > everyone to write this for himself. That's why it sounds like a > good idea > to make a separate module that provides some simplification methods > around > the tough tasks provided by FigureMaker. Yes, yes, yes, and yes! The focus in FigureMaker is to make the hard stuff possible and provide enough low-level access to build on for the unforeseen future. I haven't put much effort at all into making simple things simple enough, and that's definitely an important project. I expect that user-developers such as yourselves will be the source of such things. I'll be happy to listen to suggestions for modifications and extensions to FigureMaker to ease your task. On May 31, 2006, at 6:04 AM, vincent.fourmond at 9online.fr wrote: > I also wanted to say that I've been working for a long time on a > fully-featured (well, fully enough !) command-line interface for Tioga Excellent. My little "irb" interface is just a place holder for those unfortunate souls who haven't yet migrated to Mac and the wonderful Tioga GUI I've done there! ; - ) Cheers, Bill From edder at tkwsping.nl Sat Jun 3 16:29:24 2006 From: edder at tkwsping.nl (Edwin) Date: Sat, 03 Jun 2006 21:29:24 +0100 Subject: [Tioga-users] Tioga3d 0.0.1 Message-ID: Most of the basic plotting functionality of my 3d project is finished, so I decided to share it in the hope of some feedback :) I attached the source code ====The Good==== The good is that the plotting functionality works. Show_plot_3d draws the axes, and you should be able to use most default methods by putting _3d behind them. This should work at least with all functions that expect xs and ys coordinates (show_polyline). Methods that expect dicts (like show_marker) should also be covered as long as they use the standard coord-notations (at, point, x, y, xs, ys). Other methods might need custom wrappers (like show_arrow) which aren't provided yet. ====The Bad==== I only concentrated on plotting, because I don't see a reason to use 3d otherwise. This means that I have only concentrated on the plotting functions and I can see no reason to support "figure only" things like append_arc_to_path. If you disagree please let me know Testing has been very incomplete and there are probably quite a few functions that need customized wrappers, which I don't know about yet or have ignored for now (like show_arrow). If you find any "bugs" please let me know. ====The Ugly==== The way axes are handled is not nice and they don't look perfect yet. This is mostly because I have not yet taken the dive into writing c extensions. To be able to draw axes properly I would have to rewrite my show_axis function in c, so I can access the PlotAxis struct. On the plus side I wrote a more versatile show_axis method (called show_axis_3d), which should also be usable for 2d axes. The method basically needs an origin ([x,y] for 2d and [x,y,z] for 3d), the minimum value of the axis, the maximum value, the direction the axis takes ([1,0] or [1,0,0] for in the x direction) and the direction of the ticks ([0,1] or [0,1,0] are ticks parellel to the y axis) ====Performance==== I haven't checked performance, but the easiest way to gain performance would be by implementing the transform_coord method in c. I used the gnuplot code as an example and we could just use their code almost directly, although I'm not sure if you can use gpl'ed code in lgpl projects (prob not) ====Example==== require 'tioga3d.rb' class Test include Tioga include FigureConstants def initialize @figure_maker = FigureMaker.default #until the 3d code is part of the official tree you will need to initialize some constants separatedly t.initialize_3d t.save_dir = 'plots_out' #for linux users $open_command = 'xpdf' @cube = t.def_figure( "cube" ) { cube } @random = t.def_figure( "random" ) { random } end def t @figure_maker end def cube #t3d.view( 60,245 ) xs = Dvector[-1,-1,1,1,-1,-1,1,1] ys = Dvector[-1,-1,-1,1,1,1,1,-1] zs = Dvector[-1,1,1,1,1,-1,-1,-1] t.show_plot_3d([xs.min-0.05, xs.max+0.05, ys.min-0.05, ys.max+0.05, zs.min, zs.max]) { t.append_points_to_path_3d(xs, ys, zs) t.append_point_to_path_3d(0,0,0) t.stroke t.show_polyline_3d([-1,1],[-1,1],[-1,1], Red) } end def random t.show_plot_3d() { 100.times { x = rand y = rand z = rand t.show_marker_3d( 'marker' => Bullet, 'at' => [x, y, z], 'scale' => 0.2 ) } t.show_marker_3d( 'marker' => Bullet, 'xs' => [0,1,0], 'ys'=> [1,0,0], 'zs' => [0,0,1], 'color' => Red ) } end end Test.new ====Future==== First thing I want to do is implement the drawing of a surface from data points. I have no experience with this type of thing, but google tells me I should use Delaunay triangulations, if anyone knows more, please let me know. The easiest way to go about that is use the qhull library. This will also finally teach me how to extend ruby programs in c. If anyone has a good tutorial on that please let me know. After that I'll probably want to fix/rewrite the axes (unless Bill or Vincent find time to do it ofcourse :) ) -------------- next part -------------- A non-text attachment was scrubbed... Name: tioga3d.rb Type: application/octet-stream Size: 12816 bytes Desc: not available Url : http://rubyforge.org/pipermail/tioga-users/attachments/20060603/b3b0efbe/attachment.obj From paxton at kitp.ucsb.edu Sat Jun 3 17:59:56 2006 From: paxton at kitp.ucsb.edu (Bill Paxton) Date: Sat, 3 Jun 2006 14:59:56 -0700 Subject: [Tioga-users] Fwd: Tioga3d 0.0.1 References: Message-ID: <38ED3C30-86EC-47B7-A613-ADADFA43D4B7@kitp.ucsb.edu> I just sent this to Edwin, and then I realized it should probably go to the full users list. It is a comment on the prospects for using PDF's ability to do interpolated shading of a triangular mesh -- a rather esoteric subject, but one that may turn out to be useful for 3D! --Bill Begin forwarded message: > From: Bill Paxton > Date: June 3, 2006 2:46:42 PM PDT > To: Edwin > Subject: Re: [Tioga-users] Tioga3d 0.0.1 > > > On Jun 3, 2006, at 1:29 PM, Edwin wrote: > >> First thing I want to do is implement the drawing of a surface >> from data points. I have no experience with this type of thing, >> but google tells me I should use Delaunay triangulations, if >> anyone knows more, please let me know. > > Hi Edwin, > > Great progress! I'll download and play with it, but first I wanted > to reply to your comment about drawing surfaces. It sounds like > you are on the right track already concerning Delaunay > triangulations and qhull, but once you got that working we may want > to go one step more and take advantage of the PDF capability for > doing Gouraud shaded triangle meshes. That's something that I > skipped on the first round, but it might be worth doing for 3D. > In PDF, you can give a triangle mesh with colors at the vertices. > The interiors are interpolated (either linear or nonlinear). The > results aren't Pixar quality of course, but they are much nicer > than the sharp edges of flat shading. You should certainly go > ahead with flat shading first, but keep in mind the later option of > Gouraud. It will of course mean a shift from treating colors for > triangle faces to colors for triangle corners -- but beyond that > the main issue will be extending the Tioga PDF code to produce the > necessary stuff. That can't be too hard since the current > version of the PDF reference manual is now a mere 1236 pages! If > you don't have a copy, you can get one at http://partners.adobe.com/ > public/developer/pdf/index_reference.html#5. The relevant section > starts at page 284. > > Cheers, > Bill > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/tioga-users/attachments/20060603/ff7f7913/attachment-0001.htm From paxton at kitp.ucsb.edu Sat Jun 3 18:00:22 2006 From: paxton at kitp.ucsb.edu (Bill Paxton) Date: Sat, 3 Jun 2006 15:00:22 -0700 Subject: [Tioga-users] tutorial on extending ruby in c In-Reply-To: References: Message-ID: On Jun 3, 2006, at 1:29 PM, Edwin wrote: > This will also finally teach me how to extend ruby programs in c. > If anyone has a good tutorial on that please let me know. Hi Edwin, A while back I put together a small example in response to another Tioga user. You might want to give this a try. ???? 1) create a new folder and place the 4 files in it (no other c files please!) 2) do ruby extconf.rb make make install The 'ruby extconf.rb' should create a Makefile in the folder. The 'make' should compile spa.c and then create a dynamic lib. The 'make install' should put the dynamic lib into your Ruby release (this may need superuser status of course). 3) check it by ruby myspa_test.rb This should produce terminal output like this: Loaded suite myspa_test Started s.calc * 0.5e-9 is 3.141591 . Finished in 0.000506 seconds. 1 tests, 4 assertions, 0 failures, 0 errors If that works, you are off and running! If not, let me know where things go bad. Cheers, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/tioga-users/attachments/20060603/d6d6612a/attachment.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: extconf.rb Type: text/x-ruby-script Size: 107 bytes Desc: not available Url : http://rubyforge.org/pipermail/tioga-users/attachments/20060603/d6d6612a/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: myspa_test.rb Type: text/x-ruby-script Size: 399 bytes Desc: not available Url : http://rubyforge.org/pipermail/tioga-users/attachments/20060603/d6d6612a/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: spa.h Type: application/octet-stream Size: 185 bytes Desc: not available Url : http://rubyforge.org/pipermail/tioga-users/attachments/20060603/d6d6612a/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: spa.c Type: application/octet-stream Size: 1551 bytes Desc: not available Url : http://rubyforge.org/pipermail/tioga-users/attachments/20060603/d6d6612a/attachment-0001.obj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/tioga-users/attachments/20060603/d6d6612a/attachment-0001.htm From jilani.khaldi1 at virgilio.it Thu Jun 8 02:01:32 2006 From: jilani.khaldi1 at virgilio.it (Jilani Khaldi) Date: Thu, 08 Jun 2006 08:01:32 +0200 Subject: [Tioga-users] [Tioga-news] Tioga 1.1.1 -- the 1st beta release In-Reply-To: References: Message-ID: <4487BD3C.9060904@virgilio.it> Bill Paxton wrote: > Hi, > > After spending a year as an "alpha" release, I think Tioga is ready > for a wider audience, and moving it to "beta" status is one way to > help that happen. There will certainly be lots more changes (and > perhaps even a bug fix or two), but I think it no longer needs the > "use at your own risk" label. > Thank you very very very much Bill! Great job really! jk From ifinvers at ucalgary.ca Wed Jun 28 23:47:44 2006 From: ifinvers at ucalgary.ca (Ivars Finvers) Date: Wed, 28 Jun 2006 21:47:44 -0600 Subject: [Tioga-users] Setting absolute size of figure Message-ID: <5CC34D9F-9A29-4EE8-844E-3400CE66F761@ucalgary.ca> Hi, I'm a new user of Tioga. I would like to create a double column wide figure (with 3 subfigures) for a paper that I'm writing, but I can't find anything in the Tioga documentation regarding setting the absolute width of the figure. All the sizing commands are in relative dimensions. The standard figure width seems to be about 3-3.5 inches (what sets this?), while I would like a width of about 7 inches. Ideally I would like to specify the figure width and the absolute size of the font (so that the final figure text matches the rest of the paper). Any suggestions? Thanks. Ivars From paxton at kitp.ucsb.edu Thu Jun 29 00:33:46 2006 From: paxton at kitp.ucsb.edu (Bill Paxton) Date: Wed, 28 Jun 2006 21:33:46 -0700 Subject: [Tioga-users] Setting absolute size of figure In-Reply-To: <5CC34D9F-9A29-4EE8-844E-3400CE66F761@ucalgary.ca> References: <5CC34D9F-9A29-4EE8-844E-3400CE66F761@ucalgary.ca> Message-ID: <4255D2C6-B055-4242-A3C9-8A5B8792F353@kitp.ucsb.edu> Hi Ivars, On Jun 28, 2006, at 8:47 PM, Ivars Finvers wrote: > Hi, > > I'm a new user of Tioga. Great! > I would like to create a double column wide figure (with 3 > subfigures) for a paper that I'm writing, but I can't find anything > in the Tioga documentation regarding setting the absolute width of > the figure. All the sizing commands are in relative dimensions. The > standard figure width seems to be about 3-3.5 inches (what sets > this?), while I would like a width of about 7 inches. > > Ideally I would like to specify the figure width and the absolute > size of the font (so that the final figure text matches the rest of > the paper). > > Any suggestions? Coming Soon -- that's exactly the stuff I've been working on lately. (It would already be released if we hadn't had RubyForge network problems for the last week.) Here's a sneak preview of what's coming: for top-level page layout set_device_pagesize(width, height) # measured in tenths of points set_A4_portrait, set_A4_landscape set_A5_portrait, set_A5_landscape set_B5_portrait, set_B5_landscape set_JB5_portrait, set_JB5_landscape set_USLegal_portrait, set_USLegal_landscape set_USLetter_portrait, set_USLetter_landscape set_frame_sides(left, right, top, bottom) # sizes in page coords [0..1] for TeX preview page and figure size tex_preview_paper_width tex_preview_paper_height tex_preview_hoffset tex_preview_voffset tex_preview_figure_width tex_preview_figure_height for TeX preview font selection tex_preview_fontsize tex_preview_fontfamily tex_preview_fontseries tex_preview_fontshape I hope this will prove to be adequate to do what you're after -- but if not, please let me know. > Thanks. > > Ivars Your welcome. And I hope there will be a new release very soon! However, iIn case you are impatient (like me), here is an example of the new Tioga preview preamble. You can try cut-and-pasting it into your own file in your favorite TeX editor if you'd like to give it a try. Note that you can edit the preview TeX file for things like the font family or figure or page size, and then "typeset" the new version in the TeX editor to see the changes -- no need to rerun Tioga for that. You can play in the TeX editor until you get what you want, and then go back later to edit your Tioga program. You might even want to do the figures in the paper using the preview preamble approach rather than using the preview PDF's themselves -- i.e., instead of doing 'includegraphics' for the PDF's, use the preview preamble commands like TiogaFigureSized and build the figures "on the fly" from the pieces when you typeset the document. That way you delay the choice of fonts in the figures until the last moment, so if something changes you don't need redo the figures and you can also feel sure that the font choice is consistent across the full set. -------------- next part -------------- A non-text attachment was scrubbed... Name: Icon.tex Type: application/octet-stream Size: 2449 bytes Desc: not available Url : http://rubyforge.org/pipermail/tioga-users/attachments/20060629/81886510/attachment.obj -------------- next part -------------- Cheers, Bill From vincent.fourmond at 9online.fr Fri Jun 30 02:48:19 2006 From: vincent.fourmond at 9online.fr (vincent.fourmond at 9online.fr) Date: Fri, 30 Jun 2006 06:48:19 +0000 (GMT) Subject: [Tioga-users] Setting absolute size of figure In-Reply-To: References: <5CC34D9F-9A29-4EE8-844E-3400CE66F761@ucalgary.ca> <4255D2C6-B055-4242-A3C9-8A5B8792F353@kitp.ucsb.edu> <23C81F5A-4B5B-4D7A-A4D7-FD7A52894CBA@ucalgary.ca> Message-ID: An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/tioga-users/attachments/20060630/fcb921bd/attachment.html From paxton at kitp.ucsb.edu Fri Jun 30 11:04:17 2006 From: paxton at kitp.ucsb.edu (Bill Paxton) Date: Fri, 30 Jun 2006 08:04:17 -0700 Subject: [Tioga-users] Setting absolute size of figure In-Reply-To: References: <5CC34D9F-9A29-4EE8-844E-3400CE66F761@ucalgary.ca> <4255D2C6-B055-4242-A3C9-8A5B8792F353@kitp.ucsb.edu> <23C81F5A-4B5B-4D7A-A4D7-FD7A52894CBA@ucalgary.ca> Message-ID: <39F59EF5-7483-4902-A2D7-9F9353BD9DA5@kitp.ucsb.edu> Hi, This email is a comment on the issue of unintentionally getting multiple copies of additions to the tex_preview_preamble string. I now think this is simply a bug in Tioga. We get extra copies appended because the string is not being reset when a file is reloaded. We do automatically call reset_figures to clear the list of figures (or else we'd be having the same problem with the list of figures as well!) -- so my intention is to add to reset_figures so that it resets the entire figuremaker state to defaults. That fixes the preview_preamble problem and also eliminates one possible source of nasty confusion in which a Tioga figure gives different results depending on how many times the file has been reloaded! Unless I hear violent objections, that's what I'll do for the next release. Cheers, Bill On Jun 29, 2006, at 11:48 PM, vincent.fourmond at 9online.fr wrote: > > Hello ! > > > > I discovered a possible bug (or perhaps it is my usage). If I > > > include the following line in my .rb file: > > > > > > t.tex_preview_preamble = t.tex_preview_preamble + > > > "\n\t\\usepackage{MyCommonStuff}\n" + > > > "\n\t\\usepackage{mathtime}\n" > > > > > > I end up with repeated occurrences (about 20) of the \usepackage > > > lines in the .tex file. > > I would like to have a little more context however. You're using > irb or the graphical interface and you repeatedly try to plot the > same things ? Could you send us the file (or an extract) ? > > If that really is an annoyance, I propose the creation of a function > > def tex_preview_preamble_append(str, unique = true) > if not unique or tex_preview_preamble.index(str) > tex_preview_preamble += str > end > end > > Then, you call it > tex_preview_preamble_append("your string") > > and it will get appended only once. > > That's the best I see for now. > > Vincent > _______________________________________________ > Tioga-users mailing list > Tioga-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/tioga-users From vincent.fourmond at 9online.fr Fri Jun 30 14:16:30 2006 From: vincent.fourmond at 9online.fr (Vincent Fourmond) Date: Fri, 30 Jun 2006 20:16:30 +0200 Subject: [Tioga-users] Setting absolute size of figure In-Reply-To: <39F59EF5-7483-4902-A2D7-9F9353BD9DA5@kitp.ucsb.edu> References: <5CC34D9F-9A29-4EE8-844E-3400CE66F761@ucalgary.ca> <4255D2C6-B055-4242-A3C9-8A5B8792F353@kitp.ucsb.edu> <23C81F5A-4B5B-4D7A-A4D7-FD7A52894CBA@ucalgary.ca> <39F59EF5-7483-4902-A2D7-9F9353BD9DA5@kitp.ucsb.edu> Message-ID: <44A56A7E.3000100@9online.fr> Hello ! > This email is a comment on the issue of unintentionally getting multiple > copies of additions to the tex_preview_preamble string. I now think > this is simply a bug in Tioga. We get extra copies appended because the > string is not being reset when a file is reloaded. We do automatically > call reset_figures to clear the list of figures (or else we'd be having > the same problem with the list of figures as well!) -- so my intention > is to add to reset_figures so that it resets the entire figuremaker > state to defaults. That's sounds good to me. Then, we probably should name reset_figures otherwise (reset_state ?) and provide reset_figures as an alias for that ? Vincent