Revision 2323 branches/CqCMSDvp/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfEntityMaker.java

View differences:

DxfEntityMaker.java
250 250
			((DxfPolyline) lastEntity).add(pt);
251 251
			if (((DxfPolyline)lastEntity).pts.size() == 1) firstPt = pt;
252 252
			int cnt = ((DxfPolyline) lastEntity).pts.size();
253
			Vector arc = DxfPolyline.createArc((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-2)), (Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-1)), bulge);
254
			((DxfPolyline) lastEntity).pts.remove(cnt-1);
255
			for (int i=0; i<arc.size(); i++) {
256
				pt = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY());
257
				((DxfPolyline) lastEntity).add(pt);
258
				if (((DxfPolyline)lastEntity).pts.size() == 1) firstPt = pt;
253
			if (((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-2))).getX()==((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-1))).getX() && ((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-2))).getY()==((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-1))).getY()) {
254
			    // no se construye el arco
255
			} else {
256
				Vector arc = DxfPolyline.createArc((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-2)), (Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-1)), bulge);
257
				((DxfPolyline) lastEntity).pts.remove(cnt-1);
258
				for (int i=0; i<arc.size(); i++) {
259
					pt = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY());
260
					((DxfPolyline) lastEntity).add(pt);
261
					if (((DxfPolyline)lastEntity).pts.size() == 1) firstPt = pt;
262
				}
259 263
			}
260 264
			bulge = bulge_aux;
261 265
		} else { //si el bulge es menor que cero.
......
272 276
			((DxfPolyline) lastEntity).add(pt);
273 277
			if (((DxfPolyline)lastEntity).pts.size() == 1) firstPt = pt;
274 278
			int cnt = ((DxfPolyline) lastEntity).pts.size();
275
			Vector arc = DxfPolyline.createArc((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-2)), (Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-1)), bulge);
276
			((DxfPolyline) lastEntity).pts.remove(cnt-1);
277
			for (int i=arc.size()-1; i>=0; i--) {
278
				pt = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY());
279
				((DxfPolyline) lastEntity).add(pt);
280
				if (((DxfPolyline)lastEntity).pts.size() == 1) firstPt = pt;
279
			if (((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-2))).getX()==((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-1))).getX() && ((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-2))).getY()==((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-1))).getY()) {
280
			    // no se construye el arco
281
			} else {
282
				Vector arc = DxfPolyline.createArc((Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-2)), (Point2D)(((DxfPolyline) lastEntity).pts.get(cnt-1)), bulge);
283
				((DxfPolyline) lastEntity).pts.remove(cnt-1);
284
				for (int i=arc.size()-1; i>=0; i--) {
285
					pt = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY());
286
					((DxfPolyline) lastEntity).add(pt);
287
					if (((DxfPolyline)lastEntity).pts.size() == 1) firstPt = pt;
288
				}
281 289
			}
282 290
			bulge = bulge_aux;			
283 291
		}

Also available in: Unified diff