Skip to content

evaluating a b-spline from external program (FreeCAD) #96

Open
@nlosacco

Description

@nlosacco

Hi,

I have a planar b-spline obtained in a parametric modelling program (FreeCAD), e.g.:

>>> poles0 = [Vector (347.119461269, -1.1369e-13, 251.048911919), Vector (421.35826684612715, -1.6527880167093929e-13, 234.39242900777492), Vector (568.0349611242125, -2.3352933708996786e-13, 190.78154071596157), Vector (787.6981915383186, -2.9627895102551153e-13, 130.3077433064477), Vector (1017.878120964171, -4.549438679112047e-13, 122.11454085418023), Vector (1166.9796636987746, -5.400003939056869e-13, 154.29592542750504), Vector (1239.265344, -5.6843e-13, 182.878520542)]
>>> weights0 = [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
>>> knots0 = [0.0, 229.98020932693515, 456.5562217064585, 682.584333954564, 912.1417114001321]
>>> mults0 = [4, 1, 1, 1, 4]
>>> periodic0 = False
>>> degree0 = 3
>>> rational0 = False
>>> bs0 = Part.BSplineCurve()
>>> bs0.buildFromPolesMultsKnots(poles0, mults0, knots0, periodic0, degree0, weights0, rational0)

This is actually 2D, as you can see the second coordinate is practically zero.
Then I want to evaluate (i.e. obtain the z value) of the b-spline at a given abscissa (x)

I am trying to figure out how to do it with your library. Is this possible?
Sorry for the naive question, I am not an expert in b-splines nor in Fortran, and thanks for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions