Hi, 

I'm trying to add dxf arc to the dxf_outlines extension but I'm having some problems:

At first I'm using only the arcs that have the same radius, basically the code goes like this

def dxf_arc(self,arc_info):
    """Draw an arc in the DXF format"""
    self.handle += 1
    self.dxf_add("  0\nARC\n  5\n%x\n100\nAcDbEntity\n  8\n%s\n  62\n%d\n100\nAcDbCircle\n" % (self.handle, self.layer, self.color))
    self.dxf_add(" 10\n%f\n 20\n%f\n 30\n0.0\n 40\n%f\n100\nAcDbArc\n 50\n%f\n 51\n%f\n" % (arc_info[0],arc_info[1], arc_info[2], arc_info[3], arc_info[4])

def arc_info(previous_end_point, arc_path):
    Ax = previous_end_point[0]
    Ay = previous_end_point[1]
    radius = arc_path[1]
    Bx = arc_path[-2]
    By = arc_path[-1]
         ...
    return [center_point_x, centerpoint_y, radius, start_angle, end_angle]

The problem is for this to work it must be before converting the path to superpath or all the svg arc information will be lost as it will become a curves but somewhere in the code there's the information that there is some issues when transforming(matrix) the path before converting it to superpath.

So I'm thinking if it would be possible to use something like simplepath (but now it's decrepted) and convert the path into segments and then the segments to curve as they go into the process_shape loop and separating the arcs that fulfill the conditions(same radius) from the others that should be converted to curves and then to dxf spline.

It would go like this:

path -> transform matrix -> simplepath -> separate the arcs from the others (M L C etc) -> arcs goes to arc_info and the others goes to either dxf line or dxf spline

as opposed to what it is now

path -> superpath -> transform matrix -> separed lines from curves to go to dxf line and dxf spline respectively

 

So my questions are :

How to convert the path to some sort of superpath but without converting it curves?

Does a command to do this exist or should I write a function to do it?

And if I should write one, what's the format of a superpath so it could match with my function?

What was the issues of having the transform matrix before converting it to a superpath?

It is possible to do it the way i intend?

Any help would be appreciated