Changeset d85126 in git


Ignore:
Timestamp:
Jul 21, 2005, 11:19:42 AM (18 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
54e883b94f59e2e4f4eae57d4ab1d445925534ad
Parents:
634dab087e9b393fec1655c78c584e20750b3db3
Message:
surf.lib
---> autoresize
---> help string modified


git-svn-id: file:///usr/local/Singular/svn/trunk@8439 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/surf.lib

    r634dab0 rd85126  
    1 //last change: 02.03.2001 (Eric Westenberger)
     1// last modified 21.07.2005, Oliver Wienand
    22///////////////////////////////////////////////////////////////////////////////
    3 version="$Id: surf.lib,v 1.24 2005-05-06 14:39:19 hannes Exp $";
     3version="$Id: surf.lib,v 1.25 2005-07-21 09:19:42 wienand Exp $";
    44category="Visualization";
    55info="
     
    3939}
    4040
    41 proc  plot(ideal I,list #)
     41proc plot(ideal I,list #)
    4242"USAGE:   plot(I);  I ideal or poly
    4343ASSUME: I defines a plane curve or a surface given by one equation
    4444RETURN: nothing
    45 NOTE: requires the external program 'surf' to be installed
     45NOTE: requires the external program 'surf' to be installed, to close the graphical just press 'Q'
    4646EXAMPLE: example plot; shows an example
    4747"
    4848{
    49   string extra_surf_opts=" -x "; // remove this line for surf 0.9
    50   string l="/tmp/surf"+string(system("pid"));
     49  string extra_surf_opts=" -x --auto-resize "; // remove this line for surf 0.9
     50  string l = "/tmp/surf"+string(system("pid"));
    5151  string err_mes; // string containing error messages
    5252  def base=basering;
     
    9696    if (ncols(I)==1 and (n==3 or nvars(base)==3)) // surface
    9797    {
    98       write(":w "+l,
    99       "root_finder=d_chain_bisection;epsilon=0.0000000001;iterations=20000;");
    100      write(l, "width=500; height=500; set_size; do_background=yes;
    101 background_red=255; background_green=255; background_blue=255;");
    102       write(l,"rot_x=0.14; rot_y=-0.3;");
    103      if (size(#)>0)
    104        {
    105          write(l,#[1]);
    106        }
    107       write(l,"surface=",I[1],";");
    108       write(l,"draw_surface;");
     98      write(":w " + l,
     99            "root_finder=d_chain_bisection;epsilon=0.0000000001;iterations=20000;");
     100      write(l, "width=500; height=500; set_size; do_background=yes; background_red=255; background_green=255; background_blue=255;");
     101      write(l, "rot_x=0.14; rot_y=-0.3;");
     102      if (size(#) > 0)
     103      {
     104          write(l, #[1]);
     105      }
     106      write(l, "surface=",I[1],";");
     107      write(l, "draw_surface;");
    109108    }
    110109    else
    111110    {
    112       err_mes="cannot plot "+string(ncols(I))+" equations in "
    113              +string(n)+" variables";
     111      err_mes = "cannot plot " + string(ncols(I)) + " equations in "
     112              + string(n) + " variables";
    114113      ERROR(err_mes);
    115114    }
     
    119118  if (defined(extra_surf_opts))
    120119  {
    121     surf_call = surf_call + extra_surf_opts + " ";
     120    surf_call = surf_call + " " + extra_surf_opts;
    122121  }
    123   surf_call =surf_call+ l +" >/dev/null 2>&1";
     122  surf_call =surf_call + l + " >/dev/null 2>&1";
    124123
    125   if("ppcMac-darwin"!=system("uname")){
    126      i=system("sh",surf_call);
     124  if ("ppcMac-darwin" != system("uname")) {
     125     i=system("sh", surf_call);
    127126  } else {
    128     surf_call= surf_call + " || "+ "singularsurf " +
    129       extra_surf_opts + " " +l +" >/dev/null 2>&1";
    130       i=system("sh",surf_call);
     127     surf_call = surf_call + " || " + "singularsurf "
     128                 + extra_surf_opts + " " + l +" >/dev/null 2>&1";
     129     i = system("sh", surf_call);
    131130  }
    132131
    133   if (i!=0)
     132  if (i != 0)
    134133  {
    135134    err_mes = "calling `surf` failed. (the shell return the error code "
    136           +string(i)+")."+newline+
    137     "probably the executable `surf` is not found.";
     135          + string(i) + ")." + newline +
     136          "probably the executable `surf` is not found.";
    138137    ERROR(err_mes);
    139138  }
    140   i=system("sh","/bin/rm "+l);
     139  i = system("sh", "/bin/rm "+l);
    141140}
    142141example
    143 { "EXAMPLE:"; echo =2;
     142{ "EXAMPLE:"; echo = 2;
    144143  // ---------  plane curves ------------
    145144  ring rr0 = 0,(x1,x2),dp;
Note: See TracChangeset for help on using the changeset viewer.