Subversion Repositories wimsdev

Rev

Rev 18159 | Rev 18308 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18159 Rev 18301
Line 711... Line 711...
711
void obj_arc(objparm *pm)
711
void obj_arc(objparm *pm)
712
{
712
{
713
  scale(pm->pd,pm->p,1);
713
  scale(pm->pd,pm->p,1);
714
  pm->p[2]=rint(pm->pd[2]*xscale); pm->p[3]=rint(pm->pd[3]*yscale);
714
  pm->p[2]=rint(pm->pd[2]*xscale); pm->p[3]=rint(pm->pd[3]*yscale);
715
  gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],
715
  gdImageArc(image,pm->p[0],pm->p[1],pm->p[2],pm->p[3],
716
           pm->pd[4],pm->pd[5],pm->color[0]);
716
           rint(pm->pd[4]),rint(pm->pd[5]),pm->color[0]);
717
  if(tikz_file) {
717
  if(tikz_file) {
718
    pm->pd[4]-=360*rint(pm->pd[4]/360);
718
    pm->pd[4]-=360*rint(pm->pd[4]/360);
719
    pm->pd[5]-=360*rint(pm->pd[5]/360);
719
    pm->pd[5]-=360*rint(pm->pd[5]/360);
720
    if(pm->pd[4]>pm->pd[5]) pm->pd[5]+=360;
720
    if(pm->pd[4]>pm->pd[5]) pm->pd[5]+=360;
721
    fprintf(tikz_file,
721
    fprintf(tikz_file,
Line 740... Line 740...
740
  dpts[4]=pm->pd[0]+pm->pd[2]*cos(DEG*pm->pd[4]);
740
  dpts[4]=pm->pd[0]+pm->pd[2]*cos(DEG*pm->pd[4]);
741
  dpts[5]=pm->pd[1]+pm->pd[2]*sin(DEG*pm->pd[4]);
741
  dpts[5]=pm->pd[1]+pm->pd[2]*sin(DEG*pm->pd[4]);
742
  scale(dpts, pts, 3);
742
  scale(dpts, pts, 3);
743
  gdImageLine(image,pts[0],pts[1],pts[2],pts[3],pm->color[0]);
743
  gdImageLine(image,pts[0],pts[1],pts[2],pts[3],pm->color[0]);
744
  gdImageLine(image,pts[0],pts[1],pts[4],pts[5],pm->color[0]);
744
  gdImageLine(image,pts[0],pts[1],pts[4],pts[5],pm->color[0]);
745
  gdImageArc(image,pts[0],pts[1],wx,wy,pm->pd[3],pm->pd[4],pm->color[0]);
745
  gdImageArc(image,pts[0],pts[1],wx,wy,rint(pm->pd[3]),rint(pm->pd[4]),pm->color[0]);
746
  if(tikz_file) {
746
  if(tikz_file) {
747
    fprintf(tikz_file, "\\draw\[%s, domain=%f:%f] plot ({%i+%f*cos(\\x)}, {%i+%f*sin(\\x)});\n",
747
    fprintf(tikz_file, "\\draw\[%s, domain=%f:%f] plot ({%i+%f*cos(\\x)}, {%i+%f*sin(\\x)});\n",
748
      tikz_options(pm->color[0],pm->fill),pm->pd[3],pm->pd[4],pts[0],wx*0.5,flip(pts[1]),wy*(-0.5));
748
      tikz_options(pm->color[0],pm->fill),pm->pd[3],pm->pd[4],pts[0],wx*0.5,flip(pts[1]),wy*(-0.5));
749
    fprintf(tikz_file, "\\draw\[%s] (%i, %i) -- (%i, %i) (%i, %i) -- (%i, %i);\n",
749
    fprintf(tikz_file, "\\draw\[%s] (%i, %i) -- (%i, %i) (%i, %i) -- (%i, %i);\n",
750
        tikz_options(pm->color[0],pm->fill),pts[0],flip(pts[1]),pts[2],flip(pts[3]),pts[0],flip(pts[1]),pts[4],flip(pts[5]));
750
        tikz_options(pm->color[0],pm->fill),pts[0],flip(pts[1]),pts[2],flip(pts[3]),pts[0],flip(pts[1]),pts[4],flip(pts[5]));