diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/Arc.cpp libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/Arc.cpp --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/Arc.cpp 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/Arc.cpp 2016-03-10 21:32:11.000000000 +0000 @@ -66,7 +66,7 @@ //segments - number of segments per full revolution! //d_angle - determines the direction and the ammount of the arc to draw -void CArc::GetSegments(void(*callbackfunc)(const double *p), double pixels_per_mm, bool want_start_point)const +void CArc::GetSegments(void(*callbackfunc)(const double *p), double pixels_per_mm)const { if(m_s == m_e) return; diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/Arc.h libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/Arc.h --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/Arc.h 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/Arc.h 2016-03-10 21:32:11.000000000 +0000 @@ -21,5 +21,5 @@ double IncludedAngle()const; // always > 0 bool AlmostALine()const; Point MidParam(double param)const; - void GetSegments(void(*callbackfunc)(const double *p), double pixels_per_mm, bool want_start_point = true)const; + void GetSegments(void(*callbackfunc)(const double *p), double pixels_per_mm)const; }; \ No newline at end of file diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/AreaClipper.cpp libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/AreaClipper.cpp --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/AreaClipper.cpp 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/AreaClipper.cpp 2016-03-10 21:32:11.000000000 +0000 @@ -109,28 +109,6 @@ } } -static bool IsPolygonClockwise(const TPolygon& p) -{ -#if 1 - double area = 0.0; - unsigned int s = p.size(); - for(unsigned int i = 0; i 0.0; -#else - return IsClockwise(p); -#endif -} - static void MakeLoop(const DoubleAreaPoint &pt0, const DoubleAreaPoint &pt1, const DoubleAreaPoint &pt2, double radius) { Point p0(pt0.X, pt0.Y); diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/area clipper.vcproj libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/area clipper.vcproj --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/area clipper.vcproj 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/area clipper.vcproj 2016-03-10 21:32:11.000000000 +0000 @@ -118,13 +118,13 @@ Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" - AdditionalIncludeDirectories=""$(BOOST_PYTHON_PATH)";$(PYTHON_INCLUDE);.\" + AdditionalIncludeDirectories="$(BOOST43_PYTHON_PATH);$(PYTHON26_INCLUDE);.\" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;AREA_EXPORTS;__BOOST_PYTHON_NO_LIB__;BOOST_PYTHON_STATIC_LIB=1;BOOST_LIB_DIAGNOSTIC" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" WarningLevel="3" - DebugInformationFormat="3" + DebugInformationFormat="0" /> 0.0) ? 0.002 : (-0.002); - Point vt0 = p0 + right * radius; - Point vt1 = p1 + right * radius; - Point vt2 = p1 - right * radius; - Point vt3 = p0 - right * radius; - c.append(vt0); - c.append(vt1); - c.append(CVertex(1, vt2, p1)); - c.append(vt3); - c.append(CVertex(1, vt0, p0)); - obround.append(c); - return obround; -} - -static bool feed_possible(const CArea &area_for_feed_possible, const Point& p0, const Point& p1, double tool_radius) -{ - CArea obround = make_obround(p0, p1, tool_radius); - obround.Subtract(area_for_feed_possible); - return obround.m_curves.size() == 0; -} - void MarkOverlappingOffsetIslands(std::list &offset_islands) { for(std::list::iterator It1 = offset_islands.begin(); It1 != offset_islands.end(); It1++) diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/area.vcproj libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/area.vcproj --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/area.vcproj 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/area.vcproj 2016-03-10 21:32:11.000000000 +0000 @@ -124,7 +124,7 @@ EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" WarningLevel="3" - DebugInformationFormat="3" + DebugInformationFormat="0" /> Wed, 09 Mar 2016 21:31:41 +0000 + -- neomilium Thu, 10 Mar 2016 21:32:11 +0000 libarea (0.0.20140514-1) unstable; urgency=low diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/Construction.cpp libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/Construction.cpp --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/Construction.cpp 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/Construction.cpp 2016-03-10 21:32:11.000000000 +0000 @@ -18,7 +18,6 @@ double RESOLUTION = 1.0e-06; // dummy functions - const wchar_t* getMessage(const wchar_t* original, int messageGroup, int stringID){return original;} const wchar_t* getMessage(const wchar_t* original){return original;} void FAILURE(const wchar_t* str){throw(str);} void FAILURE(const std::wstring& str){throw(str);} @@ -358,7 +357,7 @@ // circle methods // *************************************************************************************************************************************** - Circle::Circle(const Point& p, double rad, bool okay){ + Circle::Circle(const Point& p, double rad){ // Circle pc = p; radius = rad; @@ -386,7 +385,7 @@ Circle Circle::Transform(Matrix& m) { // transform Point p0 = this->pc; double scale; - if(m.GetScale(scale) == false) FAILURE(getMessage(L"Differential Scale not allowed for this method", GEOMETRY_ERROR_MESSAGES, MES_DIFFSCALE)); + if(m.GetScale(scale) == false) FAILURE(getMessage(L"Differential Scale not allowed for this method")); return Circle(p0.Transform(m), radius * scale); } @@ -461,7 +460,7 @@ Point On(const Circle& c, const Point& p) { // returns point that is nearest to c from p double r = p.Dist(c.pc); - if(r < TOLERANCE) FAILURE(getMessage(L",Point on Circle centre - On(Circle& c, Point& p)", GEOMETRY_ERROR_MESSAGES, MES_POINTONCENTRE)); + if(r < TOLERANCE) FAILURE(getMessage(L",Point on Circle centre - On(Circle& c, Point& p)")); return(Mid(p, c.pc, (r - c.radius) / r)); } @@ -641,7 +640,7 @@ if(!s2.ok) return Thro(p0, p2); // p1 & p2 coincident Point p = Intof(Normal(s0, Mid(p0, p1)), Normal(s1, Mid(p0, p2))); - return (p.ok)? Circle(p, p0.Dist(p), true) : INVALID_CIRCLE; + return (p.ok)? Circle(p, p0.Dist(p)) : INVALID_CIRCLE; } Circle Tanto(int NF, int AT0, const CLine& s0, int AT1, const Circle &c1, double rad) { // circle tanto cline & circle with radius @@ -786,7 +785,8 @@ Plane::Plane(double dist, const Vector3d& n) { normal = n; double mag = normal.normalise(); - if((ok = (normal != NULL_VECTOR))) d = dist / mag; + ok = (normal != NULL_VECTOR); + if(ok) d = dist / mag; } double Plane::Dist(const Point3d& p)const{ diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/Finite.cpp libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/Finite.cpp --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/Finite.cpp 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/Finite.cpp 2016-03-10 21:32:11.000000000 +0000 @@ -36,7 +36,7 @@ } else { // arc arc - return ArcArcIntof(sp0, sp1, p0, p1, t); + return ArcArcIntof(sp0, sp1, p0, p1); } } } @@ -102,7 +102,7 @@ return nRoots; } - int ArcArcIntof(const Span& arc0, const Span& arc1, Point& pLeft, Point& pRight, double t[4]) { + int ArcArcIntof(const Span& arc0, const Span& arc1, Point& pLeft, Point& pRight) { // Intof 2 arcs int numInts = Intof(Circle(arc0.pc, arc0.radius), Circle(arc1.pc, arc1.radius), pLeft, pRight); diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/geometry.h libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/geometry.h --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/geometry.h 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/geometry.h 2016-03-10 21:32:11.000000000 +0000 @@ -110,7 +110,6 @@ #define ACW 1 // anti-clockwise #define CW -1 // clockwise - const wchar_t* getMessage(const wchar_t* original, int messageGroup, int stringID); const wchar_t* getMessage(const wchar_t* original); // dummy void FAILURE(const wchar_t* str); void FAILURE(const std::wstring& str); @@ -242,7 +241,7 @@ #define INVALID_POINT Point(9.9999999e50, 0, false) #define INVALID_POINT3D Point3d(9.9999999e50, 0, 0, false) #define INVALID_CLINE CLine(INVALID_POINT, 1, 0, false) -#define INVALID_CIRCLE Circle(INVALID_POINT, 0, false) +#define INVALID_CIRCLE Circle(INVALID_POINT, 0) // 3d point class class Point3d { @@ -479,8 +478,8 @@ // constructors etc... inline Circle() {ok = false;}; - Circle( const Point& p, double r, bool okay = true); // Circle c1(Point(10,30), 20); - Circle( const Point& p, const Point& pc); // Circle c1(p[222], p[223]); + Circle( const Point& p, double r); // Circle c1(Point(10,30), 20); + Circle( const Point& p, const Point& pc); // Circle c1(p[222], p[223]); Circle( const Circle& c ){*this = c;} // copy constructor Circle c1(c2); Circle( const Span& sp); // constructor @@ -932,7 +931,7 @@ int Intof(const Span& sp0 , const Span& sp1, Point& p0, Point& p1, double t[4]); int LineLineIntof(const Span& L0 , const Span& L1, Point& p, double t[2]); int LineArcIntof(const Span& line, const Span& arc, Point& p0, Point& p1, double t[4]); - int ArcArcIntof(const Span& arc0, const Span& arc1, Point& pLeft, Point& pRight, double t[4]); + int ArcArcIntof(const Span& arc0, const Span& arc1, Point& pLeft, Point& pRight); bool OnSpan(const Span& sp, const Point& p); bool OnSpan(const Span& sp, const Point& p, bool nearPoints, Point& pNear, Point& pOnSpan); // function returns true if pNear == pOnSpan diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/kurve.cpp libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/kurve.cpp --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/kurve.cpp 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/kurve.cpp 2016-03-10 21:32:11.000000000 +0000 @@ -676,7 +676,7 @@ void Kurve::Replace(int vertexnumber, int type, const Point& p0, const Point& pc, int ID) { // replace a span #ifdef _DEBUG - if(this == NULL || vertexnumber > m_nVertices) FAILURE(getMessage(L"Kurve::Replace - vertexNumber out of range", GEOMETRY_ERROR_MESSAGES, MES_BAD_VERTEX_NUMBER)); + if(this == NULL || vertexnumber > m_nVertices) FAILURE(getMessage(L"Kurve::Replace - vertexNumber out of range")); #endif SpanVertex* p = (SpanVertex*) m_spans[vertexnumber / SPANSTORAGE]; p->Add(vertexnumber % SPANSTORAGE, type, p0, pc, ID); @@ -686,7 +686,7 @@ void Kurve::ModifyIndex(int vertexnumber, WireExtraData* i) { // replace an index #ifdef _DEBUG - if(this == NULL || vertexnumber > m_nVertices) FAILURE(getMessage(L"Kurve::ModifyIndex - vertexNumber out of range", GEOMETRY_ERROR_MESSAGES, MES_BAD_VERTEX_NUMBER)); + if(this == NULL || vertexnumber > m_nVertices) FAILURE(getMessage(L"Kurve::ModifyIndex - vertexNumber out of range")); #endif SpanVertex* p = (SpanVertex*) m_spans[vertexnumber / SPANSTORAGE]; p->Add(vertexnumber % SPANSTORAGE, i); @@ -723,7 +723,7 @@ int Kurve::Get(int vertexnumber, Point& pe, Point& pc) const { // returns spantype with end / centre by reference - if(vertexnumber < 0 || vertexnumber >= m_nVertices) FAILURE(getMessage(L"Kurve::Get - vertexNumber out of range", GEOMETRY_ERROR_MESSAGES, MES_BAD_VERTEX_NUMBER)); + if(vertexnumber < 0 || vertexnumber >= m_nVertices) FAILURE(getMessage(L"Kurve::Get - vertexNumber out of range")); if(m_isReversed == true) { int revVertexnumber = m_nVertices - 1 - vertexnumber; SpanVertex* p = (SpanVertex*)m_spans[revVertexnumber / SPANSTORAGE]; @@ -745,14 +745,14 @@ } int Kurve::GetSpanID(int vertexnumber) const { // for spanID (wire offset) - if(vertexnumber < 0 || vertexnumber >= m_nVertices) FAILURE(getMessage(L"Kurve::Get - vertexNumber out of range", GEOMETRY_ERROR_MESSAGES, MES_BAD_VERTEX_NUMBER)); + if(vertexnumber < 0 || vertexnumber >= m_nVertices) FAILURE(getMessage(L"Kurve::Get - vertexNumber out of range")); if(m_isReversed == true) vertexnumber = m_nVertices - 1 - vertexnumber; SpanVertex* p = (SpanVertex*)m_spans[vertexnumber / SPANSTORAGE]; return p->GetSpanID(vertexnumber % SPANSTORAGE); } int Kurve::Get(int spannumber, Span& sp, bool returnSpanProperties, bool transform) const { // returns span data and optional properties - the function returns as the span type - if(spannumber < 1 || spannumber > m_nVertices) FAILURE(getMessage(L"Kurve::Get - vertexNumber out of range", GEOMETRY_ERROR_MESSAGES, MES_BAD_VERTEX_NUMBER)); + if(spannumber < 1 || spannumber > m_nVertices) FAILURE(getMessage(L"Kurve::Get - vertexNumber out of range")); if(m_nVertices < 2) return -99; int spanVertexNumber = spannumber - 1; @@ -778,7 +778,7 @@ #if 0 int Kurve::Get(int spannumber, Span3d& sp, bool returnSpanProperties, bool transform) const { // returns span data and optional properties - the function returns as the span type - if(spannumber < 1 || spannumber > m_nVertices) FAILURE(getMessage(L"Kurve::Get - vertexNumber out of range", GEOMETRY_ERROR_MESSAGES, MES_BAD_VERTEX_NUMBER)); + if(spannumber < 1 || spannumber > m_nVertices) FAILURE(getMessage(L"Kurve::Get - vertexNumber out of range")); if(m_nVertices < 2) return -99; int spanVertexNumber = spannumber - 1; @@ -812,7 +812,8 @@ } void Span::SetProperties(bool returnProperties) { - if((returnSpanProperties = returnProperties)) { + returnSpanProperties = returnProperties; + if(returnSpanProperties) { // return span properties if(dir) { // arc properties @@ -827,7 +828,7 @@ double radCheck = ve.normalise(); // if(FNE(radius, radCheck, geoff_geometry::TOLERANCE * 0.5)){ if(FNE(radius, radCheck, geoff_geometry::TOLERANCE)){ - FAILURE(getMessage(L"Invalid Geometry - Radii mismatch - SetProperties", GEOMETRY_ERROR_MESSAGES, MES_INVALIDARC)); + FAILURE(getMessage(L"Invalid Geometry - Radii mismatch - SetProperties")); } length = 0.0; @@ -978,10 +979,10 @@ Kurve temp; bool wrapped = false; - int nSpans = 0; int spanno = startSpanno; Span sp; - while(1) { + for(int nSpans = 0; nSpans <= this->nSpans(); nSpans++) + { this->Get(spanno, sp, false, true); if(spanno == startSpanno && wrapped == false) { temp.Start(*pNewStart); @@ -995,8 +996,7 @@ } spanno++; - nSpans++; - if(nSpans > this->nSpans()) break; + if(spanno > this->nSpans()) { if(this->Closed() == false) break; spanno = 1; @@ -1021,10 +1021,11 @@ if(spLast.p1 == *pNewEnd) return; } Kurve temp; - - int spanno = 1; + Span sp; - while(1) { + + for(int spanno = 1; spanno != (endSpanno + 1); spanno++) + { this->Get(spanno, sp, false, true); if(spanno == 1) { temp.Start(sp.p0); @@ -1047,7 +1048,7 @@ min = Point(1.0e61, 1.0e61); max = Point(-1.0e61, -1.0e61); - if(!GetScale(xscale)) FAILURE(getMessage(L"Differential Scale not allowed for this method", GEOMETRY_ERROR_MESSAGES, MES_DIFFSCALE)); // differential scale + if(!GetScale(xscale)) FAILURE(getMessage(L"Differential Scale not allowed for this method")); // differential scale Span sp; for(int i = 1; i < m_nVertices; i++) { Get(i, sp, true, true); @@ -1098,7 +1099,7 @@ double perim = 0; Span sp; double xscale = 1.0; - if(!GetScale(xscale)) FAILURE(getMessage(L"Differential Scale not allowed for this method", GEOMETRY_ERROR_MESSAGES, MES_DIFFSCALE)); // differential scale + if(!GetScale(xscale)) FAILURE(getMessage(L"Differential Scale not allowed for this method")); // differential scale if(m_nVertices > 1) { for(int i = 1; i < m_nVertices; i++) @@ -1113,7 +1114,7 @@ Span sp; if(Closed()) { - if(!GetScale(xscale)) FAILURE(getMessage(L"Differential Scale not allowed for this method", GEOMETRY_ERROR_MESSAGES, MES_DIFFSCALE)); // differential scale + if(!GetScale(xscale)) FAILURE(getMessage(L"Differential Scale not allowed for this method")); // differential scale for(int i = 1; i < m_nVertices; i++) { if(Get(i, sp, true)) area += ( 0.5 * ((sp.pc.x - sp.p0.x) * (sp.pc.y + sp.p0.y) - (sp.pc.x - sp.p1.x) * (sp.pc.y + sp.p1.y) - sp.angle * sp.radius * sp.radius)); @@ -1325,7 +1326,7 @@ return m_nVertices - kReduced.m_nVertices; #else - int dir1, dir2; + int dir1, dir2 = 0; Point p0, p1, p2, pc0, pc1, pc2; int vertex = 0; int dir0 = Get(vertex++, p0, pc0); // first vertex diff -Nru libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/Matrix.cpp libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/Matrix.cpp --- libarea-0.0.20140514.117+gita362d60+201603092131~ubuntu14.04.1/kurve/Matrix.cpp 2016-03-09 21:31:41.000000000 +0000 +++ libarea-0.0.20140514.118+git32d37c6+201603102132~ubuntu14.04.1/kurve/Matrix.cpp 2016-03-10 21:32:11.000000000 +0000 @@ -394,7 +394,7 @@ } // divide columns by minus pivot (value of pivot element is contained in biga) - if ( fabs ( biga ) < 1.0e-10 )FAILURE(getMessage(L"Singular Matrix - Inversion failure",GEOMETRY_ERROR_MESSAGES, -1)); // singular matrix + if ( fabs ( biga ) < 1.0e-10 )FAILURE(getMessage(L"Singular Matrix - Inversion failure")); // singular matrix for ( i = 0 ; i < n ; i++ ) { if ( i != k ) {