Slicer Discord
OpenSCAD type detector – 3D-Druckmodell von Thingiverse Thingiverse

OpenSCAD type detector

von arpruss
21 Downloads
8 Likes
0 Makes
Zum Modell
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.
Quelle
Thingiverse
Was du zum Drucken brauchst: Anfänger Niedrige Konfidenz
Einteilig
Supports 1/3
Zusammenbau 0/3
Einstellungen 1/3
Druckbett 0/3
Nachbearbeitung 0/3
Drucker
FDM / FFF
Dateiformat
STL
Material
Software
Cura, PrusaSlicer o. Ä.
Gleicher Designer, mehr Plattformen

arpruss veröffentlicht auch auf

5 zusätzliche Modelle auf 1 weiteren Plattformen

Verifiziert durch übereinstimmende Modelltitel über Plattformen hinweg.
Noch keine Bewertungen
Noch keine Kommentare – sei der Erste!

Ähnliche Modelle

6 Vorschläge
Feed Blog Slicer Kostenrechner Bildersuche Einreichen Kontakt Discord ☕ Buy me a coffee
DE EN FR ES IT NL

Zur Sammlung hinzufügen