Passing formulas to OpenSCAD modules/functions
- 16 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
This page is mainly for reference. Most users will want this simpler solution which parses strings containing OpenSCAD formulas: http://www.thingiverse.com/thing:2295309 One of the features that OpenSCAD is lacking is the ability to pass functions to modules or to functions. This is a quick-and-dirty proof-of-concept solution to the not uncommon problem of wanting to pass a mathematical formula to a module or function: an eval() function that evaluates expressions in a simple LISP-inspired language that supports all of the OpenSCAD mathematical operators. The evaluation is moderately fast: about 10,000 evaluations of the sample formula below per second on my laptop. The downside is that it's pretty inconvenient to write expressions in this language. Call the function with: eval(expression, variables). Here, variables is a table of variable values, where each line of the table has the name of the variable followed by its value, e.g., [["x", 12.3], ["y", 7]]. An expression is one the following: 1. a string naming a variable and expressing the value of that variable 2. a vector of the form ["'", value] expressing the given literal value (e.g., ["'", [12,3]] expresses the vector [12,3]) 3. for convenience, a number expressing itself (e.g., 12.3) 4. a vector of the form [operator argument1 argument2 ...] For instance, the OpenSCAD formula 3*(x*pow(y,3)-pow(x,3)*y) is expressed with ["*", 3, [ "-", ["*", "x", ["^", "y", 3]], ["*", ["^", "x", 3], "y"] ]]. The operators supported…
Bu model hakkında
Passing formulas to OpenSCAD modules/functions, 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.