If I have a set of points how do I turn this into a spline ICurve? Are there any curve fitting API calls or will I have to do the fitting myself and then call one of the low level spline creation calls?
My use case is that I'm doing a non linear transformation of an input ICurve to an output ICurve. I do this by first sampling the input curve at a small enough interval. I then collect the points and want to generate a new ICurve.
SolidworksApi macros
I'm afraid you need to implement this yourself. A quick search given only the standard spline fit function but none on the modeler level.
Thanks,
Artem
Ok I have a library that can create a spline curve from a set of points. The result from this curve is
How to translate this to the
2015 SOLIDWORKS API Help - CreateBsplineCurve Method (IModeler)
I just discovered that the library I'm using is .Net 4.5 only. When will solidworks release support for .Net 4.5 and above?
The solution that seems to work well is to create first a list of trimmed lines for each line segment.
ICurve [] lines = ...
Then merge these lines into a single curve and simplify with a tolerance
var curve = modeler.MergeCurves(lines).SimpifyBCurve(ChordTolerance);
Great finding! Thank you for sharing the solution.