Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.
| Beide kanten vorige revisie Vorige revisie Volgende revisie | Vorige revisie | ||
|
software:icesl [2019/11/04 00:48] nobels [ICE SL] |
software:icesl [2021/01/13 09:41] (huidige) nobels [ICE SL] |
||
|---|---|---|---|
| Regel 1: | Regel 1: | ||
| ====== ICE SL ====== | ====== ICE SL ====== | ||
| + | |||
| + | [[http://shapeforge.loria.fr/icesl-online/|Online tool]] | ||
| + | |||
| + | ===== Documentatie ===== | ||
| * Cheatsheet kan je **[[https://icesl.loria.fr/cheatsheet/|Hier]]** vinden | * Cheatsheet kan je **[[https://icesl.loria.fr/cheatsheet/|Hier]]** vinden | ||
| * [[https://gforge.inria.fr/plugins/mediawiki/wiki/icesl/index.php/Scripting#Primitive_Shapes|Officieel ICL documentatie]] | * [[https://gforge.inria.fr/plugins/mediawiki/wiki/icesl/index.php/Scripting#Primitive_Shapes|Officieel ICL documentatie]] | ||
| + | * [[https://gitlab.inria.fr/mfx/icesl-documentation/-/wikis/Scripting-language|gitlab documentatie]] | ||
| * [[https://github.com/shapeforge/icesl-models|Github voorbeeld modellen]] | * [[https://github.com/shapeforge/icesl-models|Github voorbeeld modellen]] | ||
| * [[http://thomaslauer.com/download/luarefv51.pdf| Lua Code]] | * [[http://thomaslauer.com/download/luarefv51.pdf| Lua Code]] | ||
| + | * [[https://groups.google.com/g/icesl|Forum]] | ||
| + | * [[https://pastebin.com/AU4JGHqC|Lua Cheat Sheet for Programmers]] | ||
| ===== Functies ===== | ===== Functies ===== | ||
| - | * ''v4 = ui_scalar('.D', L, 0, 160)'' -> box met schuifbar tonen | + | * ''bal = ui_scalar('Bal/diameter (mm)', 239, 0, 600)'' -> 1e veld is text/label, default waarde, minimum waarde, max waarde) |
| - | * ''emit(dhoek)'' -> tekenen van Object 'dhoek' | + | * ''emit(object)'' -> tekenen van Object 'dhoek' |
| * ''difference(objetA,objectB)'' -> wegsnijden van objecte adv object. | * ''difference(objetA,objectB)'' -> wegsnijden van objecte adv object. | ||
| * ''emit(translate(0,0,0)*ring)'' -> op een specifieke plaats tekenen van het object | * ''emit(translate(0,0,0)*ring)'' -> op een specifieke plaats tekenen van het object | ||
| + | * ''print("Here is a string" .. ' concatenated with ' .. 2 .. ' other strings.')'' -> om text te printen/tussentijdse feedback | ||
| + | * | ||
| ===== Voorbeelden ===== | ===== Voorbeelden ===== | ||
| ==== Driehoek ==== | ==== Driehoek ==== | ||
| Regel 49: | Regel 57: | ||
| emit(ring) | emit(ring) | ||
| </code> | </code> | ||
| + | |||
| + | ==== Binnen verval ==== | ||
| + | <code> | ||
| + | bringbuitenrand = 92 /2 | ||
| + | bringbinnenrand = 35 /2 | ||
| + | kegellengte = 30 | ||
| + | bringdikte = 50 | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | -- DEEL 1 (Platte ring) | ||
| + | --******************************************* | ||
| + | bevestigingsring = difference(cylinder(bringbuitenrand,bringdikte), | ||
| + | cylinder(bringbinnenrand,bringdikte) | ||
| + | ) | ||
| + | |||
| + | --emit(bevestigingsring) | ||
| + | |||
| + | -- DEEL 2 (kegel) | ||
| + | --******************************************* | ||
| + | kegel = cone(bringbuitenrand, bringbinnenrand, kegellengte) | ||
| + | |||
| + | |||
| + | --emit(kegel) | ||
| + | |||
| + | -- DEEL 3 (Ring - kegel) | ||
| + | --******************************************* | ||
| + | emit(difference(bevestigingsring,kegel)) | ||
| + | </code> | ||
| + | ==== Code voorbeelden ==== | ||
| + | <code> | ||
| + | -- Lua Cheat Sheet for Programmers, by Al Sweigart http://coffeeghost.net | ||
| + | -- This cheat sheet is an executable Lua program. | ||
| + | --[[ This is | ||
| + | a multline comment]] | ||
| + | |||
| + | ---[[ This is a neat trick. The first -- makes -[[ not a multiline comment. | ||
| + | print("This line executes.") | ||
| + | --]] The rest of this line is also a comment. | ||
| + | |||
| + | print("Here is a string" .. ' concatenated with ' .. 2 .. ' other strings.') | ||
| + | |||
| + | -- Note: All number types are doubles. There're no integers. | ||
| + | print(type(42), type(42.0)) -- prints out "number number" | ||
| + | variable_one = 1 + 2 - 3 -- This will equal zero. | ||
| + | variable_One = "Variables are case sensitive." | ||
| + | negative_twofiftysix = -2^8 | ||
| + | |||
| + | a, b = 42, 101 --mulitple assignment | ||
| + | a, b = b, a --provides a nice value swap trick | ||
| + | x, y, z = 1, 2, 3, "this value is discarded" | ||
| + | |||
| + | print(previously_unused_variable == nil) -- prints true, all vars start as nil | ||
| + | print(nil == 0 or nil == "") -- prints false, nil is not the same as false or 0 | ||
| + | print('The # len operator says there are ' .. #'hello' .. ' letters in "hello".') | ||
| + | |||
| + | some_bool_variable = true and false or true and not false | ||
| + | |||
| + | a_table = {['spam'] = "Type something in:", ['eggs'] = 10} -- tables are dictionaries/arrays | ||
| + | print(a_table['spam']) | ||
| + | |||
| + | what_the_user_typed_in = io.read() | ||
| + | print('You typed in ' .. what_the_user_typed_in) | ||
| + | |||
| + | if 10 < 20 then | ||
| + | print( "apple" == "orange" ) -- prints false | ||
| + | print( "apple" ~= "orange" ) -- true, an apple is not equal to an orange | ||
| + | local foo | ||
| + | foo = 42 | ||
| + | print(foo) | ||
| + | elseif 50 < 100 then | ||
| + | --These clauses can contain no lines of code. | ||
| + | end | ||
| + | print(foo) -- prints nil, local foo exists only in that "if" block above | ||
| + | |||
| + | m = 0 | ||
| + | while m < 10 do | ||
| + | print("howdy " .. m) | ||
| + | m = m + 1 -- there is no m++ or m += 1 | ||
| + | repeat | ||
| + | print("Repeat loops check the condition at end, and stops if it is true.") | ||
| + | break -- breaks out of the loop early | ||
| + | until m == 9999 | ||
| + | end | ||
| + | |||
| + | for i = 1, 10 do | ||
| + | for j = 1, 10, 2 do | ||
| + | print("for loops add 1 to i and 2 to j each iteration " .. i .. ' ' .. j) | ||
| + | end | ||
| + | end | ||
| + | |||
| + | function Greet(name) | ||
| + | print('Hello ' .. name) | ||
| + | bar = 100 | ||
| + | return "returns nil if you don't have a return statement." | ||
| + | end | ||
| + | Greet('Al Sweigart') | ||
| + | print(bar) -- prints 100 | ||
| + | </code> | ||
| + | |||
| + | |||
| + | |||
you see this when javscript or css is not working correct