[qet] [3373] dxfTOelmt correction of polyline close

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3373
Author:   rdsivd
Date:     2014-10-12 12:28:36 +0200 (Sun, 12 Oct 2014)
Log Message:
-----------
dxfTOelmt correction of polyline close

Modified Paths:
--------------
    branches/dxftoelmt/src/ui/dxf_ellipse.cpp
    branches/dxftoelmt/src/ui/dxf_polyline.cpp
    branches/dxftoelmt/src/ui/dxf_solid.cpp
    branches/dxftoelmt/src/ui/dxftoelmt.h

Modified: branches/dxftoelmt/src/ui/dxf_ellipse.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_ellipse.cpp	2014-10-12 09:40:10 UTC (rev 3372)
+++ branches/dxftoelmt/src/ui/dxf_ellipse.cpp	2014-10-12 10:28:36 UTC (rev 3373)
@@ -43,7 +43,7 @@
 	double width;
 	double height;
 
-	double N;
+	/*double N;
 	double O;
 	double J;
 	double K;
@@ -54,13 +54,18 @@
 	double T;
 	double U;
 	double V;
-	double W;
+	double W;*/
 	double hoek2;
 
 
+	double a;
+	double b;
+	double i;
+	double j;
+	double Pstart;
+	double Pend2;
 
 
-
 	for (x=0;x<Counter;x++)
 	{
 		if (LineTable4[x].Line1.contains(" 10", Qt::CaseSensitive) )
@@ -92,7 +97,7 @@
 		}
 		if (LineTable4[x].Line1.contains(" 42", Qt::CaseSensitive))
 		{
-			end=LineTable4[x].Line2.toDouble();
+			end2=LineTable4[x].Line2.toDouble();
 			//end=2*end2;
 		}
 
@@ -119,10 +124,23 @@
 
 	LineStyle1= Check_LineType.Check_LType(LTypeDXF, LayerDXF);
 
+	width=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)));
+	height=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)) *ratio_of_minor);
 
-	begin=start+270;
-	hoek=-end;
+	a=width/2;
+	b=height/2;
 
+	i=1;
+	j=0.1;
+
+	Pstart=((center_x+a)*acos(start))*i+((center_y+b)*asin(start))*j;
+
+	Pend2=((center_x+a)*acos(end2))*i+((center_y+b)*asin(end2))*j;
+
+
+	begin=Pstart;
+	hoek=-Pend2;
+
 	/* hoek ACAD omrekenen naar QET */
 
 
@@ -233,8 +251,8 @@
 
 	//<arc x="27.00" y="5.40" antialias="false" width="4.20" height="4.20" style="line-style:normal;line-weight:thin;filling:none;color:black" start="30" angle="299" />
 
-	width=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)));
-	height=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)) *ratio_of_minor);
+	//width=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)));
+	//height=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)) *ratio_of_minor);
 
 
 	x_center=QString::number ((center_x-(width/2) ),'f',2);

Modified: branches/dxftoelmt/src/ui/dxf_polyline.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_polyline.cpp	2014-10-12 09:40:10 UTC (rev 3372)
+++ branches/dxftoelmt/src/ui/dxf_polyline.cpp	2014-10-12 10:28:36 UTC (rev 3373)
@@ -9,6 +9,7 @@
 
 	int x;
 	int check;
+	Polyclose=0;
 
 	for (x=0;x<Counter;x++)
 	{

Modified: branches/dxftoelmt/src/ui/dxf_solid.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_solid.cpp	2014-10-12 09:40:10 UTC (rev 3372)
+++ branches/dxftoelmt/src/ui/dxf_solid.cpp	2014-10-12 10:28:36 UTC (rev 3373)
@@ -120,6 +120,16 @@
 	Lineout.append(QString::number(lijn_y3,'f',2));
 	Lineout.append(QChar(34));
 
+	//3
+	Lineout.append(" x4=");
+	Lineout.append(QChar(34));
+	Lineout.append(QString::number(lijn_x4,'f',2));
+	Lineout.append(QChar(34));
+	Lineout.append(" y4=");
+	Lineout.append(QChar(34));
+	Lineout.append(QString::number(lijn_y4,'f',2));
+	Lineout.append(QChar(34));
+
 	Lineout.append(" antialias=");
 	Lineout.append(QChar(34));
 	Lineout.append("false");

Modified: branches/dxftoelmt/src/ui/dxftoelmt.h
===================================================================
--- branches/dxftoelmt/src/ui/dxftoelmt.h	2014-10-12 09:40:10 UTC (rev 3372)
+++ branches/dxftoelmt/src/ui/dxftoelmt.h	2014-10-12 10:28:36 UTC (rev 3373)
@@ -27,8 +27,10 @@
 #include "dxf_block.h"
 #include "dxf_insert.h"
 #include "dxf_ellipse.h"
+#include <cmath>
 
 
+
 class dxfTOelmt : public DXF_Data
 {
 	public:


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/