I’ve got a problem with export to dxf. I need to export bezier curve, i have coordinates of start point, end point ang control points. Unfortunately, on the dxf entiti section there is no it.
Hello again Andrew, in your previous code you wrote this little formula:
kd = DL_KnotData(1.0/(numKnots-2*k+1) * (i-k));
to calculate the knot value in the mid section of the knot array, im reading the document you posted for me but i cant figure out how to assign that “constant”, any advise?
This is just a way to evenly distribute the knot values and clamp the knot vector at both ends (make sure spline starts at first control point and ends at last control point).
Something wierd is happening to me now, in the bezier curve definition says that splineDegree=nControlPoints, but if i try to draw any spline with degree higher that 3 doesnt work.
im testing my writing program using QCAD by the way, it has something to do with QCAD methods?
im using the same formula Andrew implemented for knot calculation.
pd: sorry about my english, its not my native lenguage.
The spline degree is either 2 (quadratic spline) or 3 (cubic spline). Higher-degree splines exist but are not supported by QCAD or dxflib (and I’ve never encountered any spline curves with a higher degree than 3 in real life applications).
However, what you might have read somewhere is that a spline of degree 2 (quadratic) needs at least 3 control points to be defined. A spline of degree 3 (cubic) needs at least 4 control points to be defined.
i did, and you’ve just saved me probably another 3 days of research about splines in just a min, i really thank you for your time and your wonderfull library, greeting from méxico.
I actually run into a new and even worse problem, Bezier curve definition says that Bezier curves k curve degree must always be equal to n control points… so if i want to draw a Bezier spline with 4+ control points im… lost?