I need a C program which (applying already-written open-source code) converts spline control points for curvy lines into SVG (standard XML vector graphics) format.
Coder should have experience with C and some familiarity with vector graphics format SVG (although the latter might be picked up on this small job).
I need a program (we can call it “SplinetoSVG?? that takes in sequences of x,y points (in an ascii file generated by a Matlab program I am writing) and (interpreting these points as spiro spline points) generates an output file in Scalable Vector Graphics (.svg) format which shows paths connecting these lines.
The tricky part of this task is already accomplished by a set of C programs available open-source here:
<[login to view URL]>
I suspect that given this code, it should be a fairly minor task for someone familiar with C to produce the program I need, and I would do it myself except that I have no experience with C. Basically I need an executable that uses this open source code exactly as intended, but the program should be customized to allow input and output in the format I desire. I do not need a GUI??"I want to the program from the command prompt in Windows, or embed it in a batch file. I specify the format of the datafile below, and I want the output to be in .SVG format. The Bezier points output by the libspiro code are used in the “path?? command of SVG, and I don’t think any further conversion should be necessary. <[login to view URL]>
The output .svg format can be viewed in just about any browser.
## Deliverables
Input Data format:
The data input by SplinetoSVG will be in the form of a text file. This text file provides spline points defining an unlimited number of curvy lines. Lines composed of m spline points are defined by m+4 lines in the datafile. The first line reads “newline??, the second line specifies strokewidth, the third line specifies color (RGB triplet), and the fourth line specifies fill color (or none), and lines 5…m+4 specify the points to be fit with the spline, and then converted to SVG.
The following datafile would specify two different lines, one a red line (no fill) of width 2 beginning at 44,54 and ending at 100,82, and one a green line (green fill) of width 4 beginning and 44,54 and ending at 280,82.
newline
strokewidth=2
color=255 0 0
fill=none
44, 54
116, 55
100, 82
newline
strokewidth=4
color=0 255 0
fill=0 255 0
44, 54
300, 100
280, 82