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)));
double chordLength = arc.getChordLength();
if (DXFUtils.equals(arc.getStartPoint(), first.getPoint(),
radius)) {
// the last point is our start point,
// which is always set
// we have to calculate the bulge
first.setBulge((2 * h) / chordLength);
first = new DXFVertex(arc.getEndPoint());
pline.addVertex(first);
} else {
// reverse the arc, we change the start/end points
// and set the bulge to >0
first.setBulge(-1.0 * ((2 * h) / chordLength));
first = new DXFVertex(arc.getStartPoint());
pline.addVertex(first);
}
}
}