Slicer Discord
OpenSCAD type detector – Modello 3D stampabile da Thingiverse Thingiverse

OpenSCAD type detector

di arpruss
21 Download
8 Likes
0 Makes
Vai al Modello
This is a small library to detect the types of OpenSCAD variables/expressions. Publicly exposed functions are: `isVector(x)`, `isBoolean(x)`, `isFloat(x)`, `isDefiniteFloat(x)` (float, but not NaN or infinity), `isRange(x)`, `isString(x)` and `typeOf(x)`.

The last of these returns a string describing the type: `vector`, `boolean`, `float`, `range`, `string`, `undef`, `unknown`.

Googling showed other solutions to the type detection problem, but I worked to make my solution as efficient as possible.

**Update:** More speed. In particular, I now avoid `concat()` and I also noticed that `len()` runs in O(1) time when applied to a vector but O(n) when applied to a string of length n, so I now avoid applying `len()` to strings, and as a result all the functions should now run in O(1) time.

**Update:** May 8, 2017: Optimized `typeOf()` by removing function calls and duplication of code between tests.
Fonte
Thingiverse
Cosa serve per stampare: Principiante Bassa affidabilità
Pezzo unico
Supporti 1/3
Assemblaggio 0/3
Impostazioni 1/3
Dimensioni piano 0/3
Post-lavorazione 0/3
Stampante
FDM / FFF
Formato file
STL
Materiale
Software
Cura, PrusaSlicer o simile
Stesso designer, più piattaforme

arpruss pubblica anche su

5 modelli aggiuntivi su altre 1 piattaforme

Verificato dalla corrispondenza dei titoli dei modelli tra le piattaforme.
Ancora nessuna valutazione
Ancora nessun commento – sii il primo!

Modelli simili

6 Suggerimenti
Feed Blog Slicer Calcolatore Ricerca per immagine Invia Contatto Discord ☕ Buy me a coffee
DE EN FR ES IT NL

Aggiungi alla collezione