# newbie: MakeCurveParametric function

hi all,

how can local variables be passed to MakeCurveParametric function? here is my script fot the automatic generation of a parabola and i get:

RuntimeError: MakeSplineInterpolation : Can't evaluate the expressions

where is the error?

import sys

import salome

salome.salome_init()

theStudy = salome.myStudy

import salome_notebook

notebook = salome_notebook.NoteBook(theStudy)

sys.path.insert( 0, r'C:/Users/Syrio/Desktop')

import GEOM

from salome.geom import geomBuilder

import math

import SALOMEDS

geompy = geomBuilder.New(theStudy)

a= 1

b=-4

c= 5

f(x)= a*t**2+ b*t + c

tmin= 0

tmax= 100

O = geompy.MakeVertex(0, 0, 0)

OX = geompy.MakeVectorDXDYDZ(1, 0, 0)

OY = geompy.MakeVectorDXDYDZ(0, 1, 0)

OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)

Curve_1 = geompy.MakeCurveParametric("t", "dx", "0", tmin, tmax, 10, GEOM.Bezier, True)

geompy.addToStudy( O, 'O' )

geompy.addToStudy( OX, 'OX' )

geompy.addToStudy( OY, 'OY' )

geompy.addToStudy( OZ, 'OZ' )

geompy.addToStudy( Curve_1, 'Curve_1' )

if salome.sg.hasDesktop():

salome.sg.updateObjBrowser(1)

HI,

first of all thank you for your prompt reply . But I must tell you that the program gives me the same error as before. And I just uploaded your script on the platform , I did not change anything about what you gave me

just downloaded and reloaded but i still have the same issues

FIle C.\.................... in RaiseFailed

raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()

MakeSplineInterpolatio : Canìt Evaluate the expression, please chek them!!!

maybe i have to set up something before start use variables? canìt understand

Hi,

I just found 'MakeCurveParametric' and wonder if it is possible to feed it with predefined functions.

Basically instead of:

geompy.MakeCurveParametric( str(L), "t*cos(t)", "t*sin(t)", startArc, endArc, 100, GEOM.Interpolation, theNewMethod=True)

def funcX(t):

def funcY(t):return L

return t*cos(t)

def funcZ(t):

return t*sin(t)geompy.MakeCurveParametric( funcX, funcY, funcZ, startArc, endArc, 100, GEOM.Interpolation, theNewMethod=True)