pline.addVertex(first);
Iterator<DXFEntity> i = this.elements.iterator();
while (i.hasNext()) {
DXFEntity e = (DXFEntity) i.next();
if (DXFConstants.ENTITY_TYPE_LINE.equals(e.getType())) {
DXFLine line = (DXFLine) e;
first = new DXFVertex(line.getEndPoint());
pline.addVertex(first);
} else if (DXFConstants.ENTITY_TYPE_POLYLINE.equals(e.getType()) ||
DXFConstants.ENTITY_TYPE_LWPOLYLINE.equals(e.getType())) {
DXFPolyline pl = (DXFPolyline) e;
double bulge = pl.getVertex(0).getBulge();
if (bulge != 0.0) {
first.setBulge(bulge);
}
for (int x = 1; x < pl.getVertexCount(); x++) {
first = pl.getVertex(x);
pline.addVertex(first);
}
} else if (DXFConstants.ENTITY_TYPE_ARC.equals(e.getType())) {
DXFArc arc = (DXFArc) e;
if (arc.getTotalAngle() > 0.0) {
double h = arc.getRadius() * (1 -
Math.cos(Math.toRadians(arc.getTotalAngle() / 2)));