Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
wangchenxicool/LibreCAD
LibreCAD/LibreCAD
0825732889/LibreCAD
ADVALAIN596/LibreCAD
ASF-inhambane/LibreCAD
Airsquire/LibreCAD
Alpha-Kand/LibreCAD
BEINAR/LibreCAD
BogusCurry/LibreCAD
CNClaus/LibreCAD
CNXTEoEorg/LibreCAD
Cantar4/LibreCAD
DINKIN/LibreCAD
DevinderKaur/LibreCAD-1
Equoda/LibreCAD
ForeverDavid/LibreCAD
FsCad/LibreCAD
HUANGMENGDI/LibreCAD
Harpalus/LibreCAD
HelloArsenal/LibreCAD
JGabriel85/LibreCAD
Jameslai54/LibreCAD
Joeycc/LibreCAD
Leboudin/LibreCAD
MichaelTaylor3D/LibreCAD
MoneySail/LibreCAD
NHellFire/LibreCAD
Ngassa/LibreCAD
OnlyMe2/LibreCAD
OskarLinde/LibreCAD
Osndok/LibreCAD
PlastecProfiles/LibreCAD
Rallaz/LibreCAD
Regmos/LibreCAD
RobertvonKnobloch/LibreCAD
RoboMod/LibreCAD
RoyOnWheels/LibreCAD
Rupicapra-rupicapra/LibreCAD
Samsagax/LibreCAD
SkipUFO/LibreCAD
TNick/LibreCAD
TNick2/LibreCAD
WandererFan/LibreCAD
Windyztree/LibreCAD
YChuan1115/LibreCAD
absorb-it/LibreCAD
aisq2008/LibreCAD
aitolos/LibreCAD
alexmpcb/LibreCAD
alice23/LibreCAD
ankush1995/LibreCAD
anotteau-cc/LibreCAD
aromis/LibreCAD
bdube/LibreCAD
beginner1/LibreCAD
bert/LibreCAD
bgoodr/LibreCAD
bgpiraja/LibreCAD
bhabanism/LibreCAD
borneq/LibreCAD
boundaryfree/LibreCAD
bygreencn/LibreCAD
cbirla/LibreCAD
cgrzemba/LibreCAD
chenchizhao/LibreCAD
ckvk/LibreCAD
coryjc190/LibreCAD
daodaoliang/LibreCAD
darrelo2/LibreCAD
dbenamy/LibreCAD
dellus/LibreCAD
diegoroman17/LibreCAD
dinkel/LibreCAD
dongzk/LibreCAD
drjolo/LibreCAD
dstrev/LibreCAD
duk3luk3/LibreCAD
dvstrom/LibreCAD
dxli/LibreCAD
effad/LibreCAD
emagdalena/LibreCAD
enfreeworld/LibreCAD
epagel/LibreCAD
erburrell/LibreCAD
fhchina/LibreCAD
fitorec/LibreCAD
frankhardy/LibreCAD
gbonnema/LibreCAD
github20150101/LibreCAD
gitter-badger/LibreCAD
gonboy/LibreCAD
gordonc64/LibreCAD
gracie89/LibreCAD
halftanolger/LibreCAD
hatindera/LibreCAD
hcarsten/LibreCAD
hekaiyuany/LibreCAD
hemanshupa/LibreCAD
hulu1528/LibreCAD
hwwh1999/LibreCAD
iborrell/LibreCAD
ilkos90/SEdit
inderpreetsingh/LibreCAD
inkscaper/LibreCAD
isdsi/LibreCAD
isili/LibreCAD
izikhuang/LibreCAD
jacklibj/LibreCAD
jasleenkaur/LibreCAD
jmundry/LibreCAD
joseph-oc/LibreCAD
juilyoon/LibreCAD
kevincox/LibreCAD
kfoltman/LibreCAD
kk4728/LibreCAD
kleopatra999/LibreCAD
korhadris/LibreCAD
korval937/LibreCAD
kosnick/LibreCAD
kromanenko/LibreCAD
kumans/LibreCAD
lentin/LibreCAD
leogargu/LibreCAD
liangcheng/LibreCAD
liberostelios/LibreCAD
ljbuller/LibreCAD
ljx0305/LibreCAD
lksj/LibreCAD
locke314/LibreCAD
lordofbikes/LibreCAD
louemusic/LibreCAD
lovlyFarhan/LibreCAD
luisivan/LibreCAD
lukeandrew/LibreCAD
luzhongtong/LibreCAD
lxb66666/LibreCAD
mandeepsimak/LibreCAD
maqifrnswa/LibreCAD
mbornoz/LibreCAD
mcanthony/LibreCAD
mcvsama/LibreCAD
meantaipan/LibreCAD
miguelramosfdz/LibreCAD
mojadita/LibreCAD
mszczygiel/LibreCAD
myutwo/LibreCAD
n89nanda/LibreCAD
navyzhao/LibreCAD
noselhq/LibreCAD
oktay454/LibreCAD
oskardolch/LibreCAD
p-friedrich/LibreCAD
paul-kennedy/LibreCAD
peizhan/LibreCAD
perepujal/LibreCAD
petroleo/LibreCAD
priyankacool10/LibreCAD
qiujiejia/LibreCAD-1
qtonthat/LibreCAD
r-a-v-a-s/LibreCAD
ranky2009/LibreCAD
rbarraud/LibreCAD
rbuj/LibreCAD
rmamba/LibreCAD
rmdz76/LibreCAD
rubdos/LibreCAD
rvt/LibreCAD
sambar-fgfs/LibreCAD
seasonsfx/LibreCAD
secretgenes342/LibreCAD
seem-sky/LibreCAD
shainline/LibreCAD
silerya/LibreCAD
singhnavdeep/LibreCAD
smallfix/LibreCAD
sway913/LibreCAD
tarun112/LibreCAD
theking0/LibreCAD
tianqizi/LibreCAD
tin-pot/LibreCAD
trojohn5/LibreCAD
turboic/LibreCAD
tytower/LibreCAD
viewsat/LibreCAD
vinayan/LibreCAD
vlachoudis/LibreCAD
wdmchaft/LibreCAD
wiesiwies/LibreCAD
xdiosdev/LibreCAD
xiaomailong/LibreCAD
xnakos/LibreCAD
xyuan/LibreCAD
yadvirkaur/LibreCAD-1
yangkf1985/LibreCAD
yehaike/LibreCAD
yekose/LibreCAD
yoc3/LibreCAD
yori5070/LibreCAD
zhmzhgis/LibreCAD
zhongxingzhi/LibreCAD
Nothing to show
Choose a base branch
...
Choose a Head Repository
wangchenxicool/LibreCAD
LibreCAD/LibreCAD
0825732889/LibreCAD
ADVALAIN596/LibreCAD
ASF-inhambane/LibreCAD
Airsquire/LibreCAD
Alpha-Kand/LibreCAD
BEINAR/LibreCAD
BogusCurry/LibreCAD
CNClaus/LibreCAD
CNXTEoEorg/LibreCAD
Cantar4/LibreCAD
DINKIN/LibreCAD
DevinderKaur/LibreCAD-1
Equoda/LibreCAD
ForeverDavid/LibreCAD
FsCad/LibreCAD
HUANGMENGDI/LibreCAD
Harpalus/LibreCAD
HelloArsenal/LibreCAD
JGabriel85/LibreCAD
Jameslai54/LibreCAD
Joeycc/LibreCAD
Leboudin/LibreCAD
MichaelTaylor3D/LibreCAD
MoneySail/LibreCAD
NHellFire/LibreCAD
Ngassa/LibreCAD
OnlyMe2/LibreCAD
OskarLinde/LibreCAD
Osndok/LibreCAD
PlastecProfiles/LibreCAD
Rallaz/LibreCAD
Regmos/LibreCAD
RobertvonKnobloch/LibreCAD
RoboMod/LibreCAD
RoyOnWheels/LibreCAD
Rupicapra-rupicapra/LibreCAD
Samsagax/LibreCAD
SkipUFO/LibreCAD
TNick/LibreCAD
TNick2/LibreCAD
WandererFan/LibreCAD
Windyztree/LibreCAD
YChuan1115/LibreCAD
absorb-it/LibreCAD
aisq2008/LibreCAD
aitolos/LibreCAD
alexmpcb/LibreCAD
alice23/LibreCAD
ankush1995/LibreCAD
anotteau-cc/LibreCAD
aromis/LibreCAD
bdube/LibreCAD
beginner1/LibreCAD
bert/LibreCAD
bgoodr/LibreCAD
bgpiraja/LibreCAD
bhabanism/LibreCAD
borneq/LibreCAD
boundaryfree/LibreCAD
bygreencn/LibreCAD
cbirla/LibreCAD
cgrzemba/LibreCAD
chenchizhao/LibreCAD
ckvk/LibreCAD
coryjc190/LibreCAD
daodaoliang/LibreCAD
darrelo2/LibreCAD
dbenamy/LibreCAD
dellus/LibreCAD
diegoroman17/LibreCAD
dinkel/LibreCAD
dongzk/LibreCAD
drjolo/LibreCAD
dstrev/LibreCAD
duk3luk3/LibreCAD
dvstrom/LibreCAD
dxli/LibreCAD
effad/LibreCAD
emagdalena/LibreCAD
enfreeworld/LibreCAD
epagel/LibreCAD
erburrell/LibreCAD
fhchina/LibreCAD
fitorec/LibreCAD
frankhardy/LibreCAD
gbonnema/LibreCAD
github20150101/LibreCAD
gitter-badger/LibreCAD
gonboy/LibreCAD
gordonc64/LibreCAD
gracie89/LibreCAD
halftanolger/LibreCAD
hatindera/LibreCAD
hcarsten/LibreCAD
hekaiyuany/LibreCAD
hemanshupa/LibreCAD
hulu1528/LibreCAD
hwwh1999/LibreCAD
iborrell/LibreCAD
ilkos90/SEdit
inderpreetsingh/LibreCAD
inkscaper/LibreCAD
isdsi/LibreCAD
isili/LibreCAD
izikhuang/LibreCAD
jacklibj/LibreCAD
jasleenkaur/LibreCAD
jmundry/LibreCAD
joseph-oc/LibreCAD
juilyoon/LibreCAD
kevincox/LibreCAD
kfoltman/LibreCAD
kk4728/LibreCAD
kleopatra999/LibreCAD
korhadris/LibreCAD
korval937/LibreCAD
kosnick/LibreCAD
kromanenko/LibreCAD
kumans/LibreCAD
lentin/LibreCAD
leogargu/LibreCAD
liangcheng/LibreCAD
liberostelios/LibreCAD
ljbuller/LibreCAD
ljx0305/LibreCAD
lksj/LibreCAD
locke314/LibreCAD
lordofbikes/LibreCAD
louemusic/LibreCAD
lovlyFarhan/LibreCAD
luisivan/LibreCAD
lukeandrew/LibreCAD
luzhongtong/LibreCAD
lxb66666/LibreCAD
mandeepsimak/LibreCAD
maqifrnswa/LibreCAD
mbornoz/LibreCAD
mcanthony/LibreCAD
mcvsama/LibreCAD
meantaipan/LibreCAD
miguelramosfdz/LibreCAD
mojadita/LibreCAD
mszczygiel/LibreCAD
myutwo/LibreCAD
n89nanda/LibreCAD
navyzhao/LibreCAD
noselhq/LibreCAD
oktay454/LibreCAD
oskardolch/LibreCAD
p-friedrich/LibreCAD
paul-kennedy/LibreCAD
peizhan/LibreCAD
perepujal/LibreCAD
petroleo/LibreCAD
priyankacool10/LibreCAD
qiujiejia/LibreCAD-1
qtonthat/LibreCAD
r-a-v-a-s/LibreCAD
ranky2009/LibreCAD
rbarraud/LibreCAD
rbuj/LibreCAD
rmamba/LibreCAD
rmdz76/LibreCAD
rubdos/LibreCAD
rvt/LibreCAD
sambar-fgfs/LibreCAD
seasonsfx/LibreCAD
secretgenes342/LibreCAD
seem-sky/LibreCAD
shainline/LibreCAD
silerya/LibreCAD
singhnavdeep/LibreCAD
smallfix/LibreCAD
sway913/LibreCAD
tarun112/LibreCAD
theking0/LibreCAD
tianqizi/LibreCAD
tin-pot/LibreCAD
trojohn5/LibreCAD
turboic/LibreCAD
tytower/LibreCAD
viewsat/LibreCAD
vinayan/LibreCAD
vlachoudis/LibreCAD
wdmchaft/LibreCAD
wiesiwies/LibreCAD
xdiosdev/LibreCAD
xiaomailong/LibreCAD
xnakos/LibreCAD
xyuan/LibreCAD
yadvirkaur/LibreCAD-1
yangkf1985/LibreCAD
yehaike/LibreCAD
yekose/LibreCAD
yoc3/LibreCAD
yori5070/LibreCAD
zhmzhgis/LibreCAD
zhongxingzhi/LibreCAD
Nothing to show
Commits on Apr 06, 2012
Commits on Apr 07, 2012
Commits on Apr 08, 2012
Commits on Apr 10, 2012
Commits on Apr 11, 2012
Commits on Apr 13, 2012
Squashed commit of the following:
commit ed096b4
Author: Dongxu Li <dongxuli2011@gmail.com>
Date:   Fri Apr 13 08:56:43 2012 -0400

    equation solvers: astyle

commit 0800a11
Author: Dongxu Li <dongxuli2011@gmail.com>
Date:   Fri Apr 13 08:55:20 2012 -0400

    equation solvers: file cleanup

commit a711601
Author: Dongxu Li <dongxuli2011@gmail.com>
Date:   Thu Apr 12 19:23:16 2012 -0400

    circle tan2: recalculate centers when new radius supplied

commit 78898f9
Author: Rallaz <rallazz@gmail.com>
Date:   Thu Apr 12 20:23:52 2012 +0200

    libdxfrw: added write image support
Commits on Apr 15, 2012
Merge branch 'master' into dli
Conflicts:
	libraries/libdxfrw/src/libdxfrw.h
	librecad/src/lib/filters/rs_filterdxfrw.h
Commits on Apr 16, 2012
Commits on Apr 17, 2012
Commits on Apr 19, 2012
Commits on Apr 21, 2012
Commits on May 07, 2012
merged master branch
Conflicts:
	librecad/src/lib/engine/rs_circle.h
	librecad/src/lib/engine/rs_entity.h
Commits on May 08, 2012
Commits on May 12, 2012
Merge branch 'master' into dli
Conflicts:
	libraries/libdxfrw/src/drw_objects.cpp
	libraries/libdxfrw/src/drw_objects.h
	libraries/libdxfrw/src/libdxfrw.cpp
	librecad/src/lib/engine/rs_ellipse.cpp
	librecad/src/lib/engine/rs_entity.h
	librecad/src/lib/filters/rs_filterdxfrw.cpp
	librecad/src/lib/filters/rs_filterdxfrw.h
	librecad/src/main/qc_applicationwindow.cpp
	librecad/src/main/qc_applicationwindow.h
	librecad/src/ui/forms/qg_dlgimageoptions.cpp
	librecad/src/ui/forms/qg_dlgimageoptions.ui
Commits on May 13, 2012
Commits on May 14, 2012
Commits on May 18, 2012
Commits on May 19, 2012
@@ -33,6 +33,7 @@
#include "rs_constructionline.h"
#include "rs_graphicview.h"
#include "rs_modification.h"
+#include "lc_hyperbola.h"
/**
* Default constructor.
@@ -894,6 +895,44 @@ RS_Line* RS_Creation::createTangent2(const RS_Vector& coord,
return ret;
}
+/**
+ * create the path of centers of common tangent circles of the two given circles
+ *@ return NULL, if failed
+ *@ at success return either an ellipse or hyperbola
+ */
+ std::vector<RS_Entity*> RS_Creation::createCircleTangent2( RS_Entity* circle1,RS_Entity* circle2)
+{
+ std::vector<RS_Entity*> ret(0,NULL);
+ if(circle1==NULL||circle2==NULL) return ret;
+ RS_Entity* e1=circle1;
+ RS_Entity* e2=circle2;
+
+ if(e1->getRadius() < e2->getRadius()) std::swap(e1,e2);
+
+ RS_Vector&& center1=e1->getCenter();
+ RS_Vector&& center2=e2->getCenter();
+ RS_Vector&& cp=(center1+center2)*0.5;
+ double dist=center1.distanceTo(center2);
+ if(dist<RS_TOLERANCE) return ret;
+ RS_Vector&& vp= center1 - cp;
+ double c=dist/(e1->getRadius()+e2->getRadius());
+ if( c < 1. - RS_TOLERANCE) {
+ //two circles intersection or one circle in the other, there's an ellipse path
+ ret.push_back(new RS_Ellipse(NULL, RS_EllipseData(cp,vp,sqrt(1. - c*c),0.,0.,false)));
+ }
+ if( dist + e2 ->getRadius() < e1->getRadius() +RS_TOLERANCE ) {
+ //one circle inside of another, the path is an ellipse
+ return ret;
+ }
+ if(c > 1. + RS_TOLERANCE) {
+ //not circle in circle, there's a hyperbola path
+ c= (e1->getRadius() - e2->getRadius())/dist;
+ ret.push_back(new LC_Hyperbola(NULL, LC_HyperbolaData(cp,vp*c,sqrt(1. - c*c),0.,0.,false)));
+ return ret;
+}
+ ret.push_back( new RS_Line(NULL, RS_LineData(cp, RS_Vector(cp.x - vp.y, cp.y+vp.x))));
+ return ret;
+}
/**
* Creates a line with a relative angle to the given entity.
@@ -100,6 +100,12 @@ class RS_Creation {
RS_Line* createTangent2(const RS_Vector& coord,
RS_Entity* circle1,
RS_Entity* circle2);
+ /**
+ * create the path of centers of common tangent circles of the two given circles
+ *@ return NULL, if failed
+ *@ at success return either an ellipse or hyperbola
+ */
+ std::vector<RS_Entity*> createCircleTangent2( RS_Entity* circle1,RS_Entity* circle2);
RS_Line* createLineRelAngle(const RS_Vector& coord,
RS_Entity* entity,
@@ -34,6 +34,8 @@
#include <QString>
+/** print out a debug header*/
+#define DEBUG_HEADER() std::cout<<__FILE__<<" : "<<__FUNCTION__<<" : line "<<__LINE__<<std::endl
#define RS_DEBUG RS_Debug::instance()
/**
@@ -0,0 +1,135 @@
+/****************************************************************************
+**
+** This file is part of the LibreCAD project, a 2D CAD program
+**
+** Copyright (C) 2010 R. van Twisk (librecad@rvt.dds.nl)
+** Copyright (C) 2001-2003 RibbonSoft. All rights reserved.
+**
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file gpl-2.0.txt included in the
+** packaging of this file.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+**
+** This copyright notice MUST APPEAR in all copies of the script!
+**
+**********************************************************************/
+
+#include <QVector>
+#include "lc_hyperbola.h"
+
+#include "rs_graphic.h"
+#include "rs_graphicview.h"
+#include "rs_painter.h"
+#include "rs_information.h"
+#include "rs_linetypepattern.h"
+#include "lc_quadratic.h"
+
+
+#ifdef EMU_C99
+#include "emu_c99.h" /* C99 math */
+#endif
+
+/**
+ * Constructor.
+ */
+LC_Hyperbola::LC_Hyperbola(RS_EntityContainer* parent,
+ const LC_HyperbolaData& d)
+ :RS_AtomicEntity(parent), data(d) {
+
+ //calculateEndpoints();
+ calculateBorders();
+}
+
+
+/**
+ * Recalculates the endpoints using the angles and the radius.
+ */
+/*
+void LC_Hyperbola::calculateEndpoints() {
+ double angle = data.majorP.angle();
+ double radius1 = getMajorRadius();
+ double radius2 = getMinorRadius();
+
+ startpoint.set(data.center.x + cos(data.angle1) * radius1,
+ data.center.y + sin(data.angle1) * radius2);
+ startpoint.rotate(data.center, angle);
+ endpoint.set(data.center.x + cos(data.angle2) * radius1,
+ data.center.y + sin(data.angle2) * radius2);
+ endpoint.rotate(data.center, angle);
+}
+*/
+
+
+/**
+ * Calculates the boundary box of this ellipse.
+ */
+
+
+
+/**
+ * return the foci of ellipse
+ *
+ *@Author: Dongxu Li
+ */
+
+RS_VectorSolutions LC_Hyperbola::getFoci() const {
+ RS_Vector vp(getMajorP()*sqrt(1.-getRatio()*getRatio()));
+ return RS_VectorSolutions(getCenter()+vp, getCenter()-vp);
+}
+
+RS_VectorSolutions LC_Hyperbola::getRefPoints() {
+ RS_VectorSolutions ret;
+ ret.push_back(data.center);
+ ret.appendTo(getFoci());
+ return ret;
+}
+
+bool LC_Hyperbola::isPointOnEntity(const RS_Vector& coord,
+ double tolerance) const
+{
+ double a=data.majorP.magnitude();
+ double b=a*data.ratio;
+ if(fabs(a)<tolerance || fabs(b)<tolerance) return false;
+ RS_Vector vp(coord - data.center);
+ vp=vp.rotate(-data.majorP.angle());
+ return fabs( vp.x*vp.x/(a*a)- vp.y*vp.y/(b*b) -1.)<tolerance;
+}
+
+
+LC_Quadratic LC_Hyperbola::getQuadratic() const
+{
+ std::vector<double> ce(6,0.);
+ ce[0]=data.majorP.squared();
+ ce[2]=-data.ratio*data.ratio*ce[0];
+ if(ce[0]>RS_TOLERANCE) ce[0]=1./ce[0];
+ if(ce[2]>RS_TOLERANCE) ce[2]=1./ce[2];
+ ce[5]=-1.;
+ LC_Quadratic ret(ce);
+ ret.rotate(data.majorP.angle());
+ ret.move(data.center);
+ return ret;
+}
+
+//RS_Vector LC_Hyperbola::getNearestEndpoint(const RS_Vector& /*coord*/,
+// double* /*dist*/ = NULL) const
+//{
+//}
+
+/**
+ * Dumps the point's data to stdout.
+ */
+std::ostream& operator << (std::ostream& os, const LC_Hyperbola& a) {
+ os << " Hyperbola: " << a.data << "\n";
+ return os;
+}
+
Oops, something went wrong.

No commit comments for this range