I'm working on a pet project to convert some map files into SVG, and I can't quite figure out how to handle splines.
Here's the background: I've got a bunch of maps created in an RPG mapping tool called Campaign Cartographer. The tool uses a file type based on FastCAD. I want to convert the files into SVG. I've had a lot of success figuring out most of the file format (I started with some C code that implemented some of the work, and I've also taken part on a mailing list that's been very helpful), and I've figured out how to convert a lot into SVG notation. But the area that I get stuck on is cubic splines. Here's the data I have available in the original file:
- Curve type (in this case, Cubic B-Spline)
- Resolution (as a float)
- A start parameter (float) and an end parameter (float)
- An array of points (float x and float y)
Unfortunately I don't understand the math of Cubic B-Splines well enough to figure out how to turn that data into SVG's control points to construct a valid path. Can anyone give me a pointer?
BC
Cubic Splines
Re: Cubic Splines
Conveniently, I figured out the answer to my own problem. Most of the data that I had was a red herring. The essential part was the list of points. A Cubic B-Spline is defined through interpolating those points. To convert a Cubic B-Spline into a Cubic Bezier, I needed to break up the spline into a series of curves, and calculate the end points and control points.
There's a PDF about splines and Bezier curves (and how to convert one to the other) over here that was tremendously helpful.
Thanks anyway!
BCing you
There's a PDF about splines and Bezier curves (and how to convert one to the other) over here that was tremendously helpful.
Thanks anyway!
BCing you
Re: Cubic Splines
Welcome to the forum!
I'm glad you solved it, because I (for one) don't know what a cubic spline is, or understand much of anything else about your question. But I'm glad you posted your question, because someday, someone else may have the same question, and your solution may help them
I'm glad you solved it, because I (for one) don't know what a cubic spline is, or understand much of anything else about your question. But I'm glad you posted your question, because someday, someone else may have the same question, and your solution may help them
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design