arc.cpp

Go to the documentation of this file.
00001 /**
00002  *\file         arc.cpp
00003  *
00004  *\brief        
00005  *
00006  *\author       Xianming Chen\n
00007  *              Computer Science Department\n
00008  *              University of Utah
00009  *
00010  *\date         19 Aug 2006\n
00011  *              Copyright (c) 2006, University of Utah
00012  */
00013 
00014 
00015 
00016 #include "euler.h"
00017 #include "print.h"
00018 #include <cmath>
00019 
00020 
00021 namespace euler
00022 {
00023   /**
00024    *  construct an arc at xy-plane, assume the start point of arc (e->v) is positioned at angle theta1.
00025    *  return the edge tailed at the last vertex.
00026    */
00027   edge_t* face_t :: arc(edge_t* e, point_t const& cntr, float r, float theta1, float theta2, int segs)
00028   {
00029     loop_t *l = e->l;
00030     float step = (theta2-theta1)/segs, theta = step;
00031     for(int i=0; i<segs; i++, theta += step)
00032     {
00033       e = l->mev(e, point_t (cntr[0] + r * cos( theta ),
00034                               cntr[1] + r * sin( theta ),
00035                               cntr[2]));
00036     }
00037     l->del_single_vertex_edge_pair(); 
00038     return e;
00039   }
00040 
00041 
00042 
00043 }//end namespace euler

Generated on Wed Aug 30 16:27:58 2006 for euler by  doxygen 1.4.6