Function parser for OpenSCAD and parametric curve grapher

Function parser for OpenSCAD and parametric curve grapher

Ücretsiz STL Diğer
  • 13 görüntülenme

Bu model Cults3D üzerinde barındırılıyor. Dosyalar, görseller ve lisans bilgileri tasarımcısına aittir.

Cults3D üzerinde görüntüle ↗

Açıklama

One of the OpenSCAD limitations is the inability to pass functions to functions or modules. This library lets you define mathematical functions in a string, using all of the OpenSCAD mathematical operators (and a bit more). This string is then compiled to an optimized representation which can be evaluated fairly quickly. For instance: use ; f = "pow(x,3)*y-x*cos(y)+y"; fc = compileFunction(f); echo(eval(fc, [["x", 12], ["y", -5]])); will evaluate the function at x=12 and y=-5. Parsing the string is not fast, but if you evaluate the compiled function for different variable values, the evaluated function should be fairly fast (in my test, about 10,000 eval()s per second). There are three public functions provided: * compileFunction(f): takes a function string f and returns an optimized compiled representation; the representation is described here: http://www.thingiverse.com/thing:2289738 There may be some bugs in the optimization. If you run into problems, add the optional argument optimize=false. * eval(fc, variables): takes a compiled function fc and evaluates it for the specified parameter values; variables is a vector of [variableName, value] pairs; for instance, [["x",1],["y",2]] * evaluateFunction(expression, variables): use this to evaluate an uncompiled function once; this is a convenience function equivalent to eval(compileFunction(expression,optimize=false),variables); if you are going to evaluate the function more than a couple of times, please compile it once…

Bu model hakkında

Function parser for OpenSCAD and parametric curve grapher, Cults3D topluluğunda paylaşılan ücretsiz bir Diğer 3D modelidir. 3D baskı için indirebilir ve orijinal lisans koşulları çerçevesinde kendi projelerinde kullanabilirsin.

Dosya formatları

  • STL — 3D baskı için en yaygın mesh formatı — neredeyse her yazıcıda dilimlenip basılmaya hazır.

Bu modelin dosyaları Cults3D üzerinde barındırılır. Orijinal sayfayı açıp indirmek için yukarıdaki düğmeyi kullan.

Benzer modeller