Changing Functionality of Circle in LibreCAD

I just changed the code of LibreCAD. Changed the functionality of “drawing circle from 2 points” to “drawing flower pattern from two points”.

Make following changes in this file librecad/src/action/rs_actiondrawcircle2p.cpp

     double px=data.center.x;
     double py=data.center.y;
     RS_Circle* flower;
     for (int i=0;i<=360;i=i+60){ 
          flower = new RS_Circle(container,data);
          double radian=i*(M_PI/180.0); 
          flower->setLayerToActive();
          flower->setPenToActive(); 
          container->addEntity(flower);
          data.center=RS_Vector(px+data.radius*cos(radian),py+data.radius*sin(radian));   
         }

Compile the source code again and choose Draw->Circle->2 Points.

It will draw pattern as follow:

flo3

Thats all 🙂

Advertisements

About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s