0

I want to draw Hermite Splines in an SVG document.

When looking at the specification of SVG, it turns out that SVG will only support Bézier curves.

One solution is: When generating my SVG document, I could do the interpolation myself, in code, and then write out a whole bunch of linear segments.

However, this will make the SVG output incredibly bloated, as all the sample points along the curve will end up in the document.

Can I have somehow a custom coded curve generation in SVG, which the document viewer will then execute? Does SVG allow procedural content, like PostScript does?

Bram
  • 7,440
  • 3
  • 52
  • 94
  • 2
    If you have read the specification, you have already found out the answer is no. However, Hermite splines can be expressed as Bezier splines, so there is no problem with drawing them. Math answer: https://math.stackexchange.com/questions/4128882/nonparametric-hermite-cubic-to-bezier-curve, Programmiing answer: https://stackoverflow.com/questions/7880884/how-to-convert-from-an-hermite-curve-into-bezier-curve – ccprog Oct 10 '22 at 22:42

0 Answers0