teepee changed the topic of #openscad to: OpenSCAD - The Programmers Solid 3D CAD Modeller | This channel is logged! | Website: http://www.openscad.org/ | FAQ: https://goo.gl/pcT7y3 | Request features / report bugs: https://goo.gl/lj0JRI | Tutorial: https://bit.ly/37P6z0B | Books: https://bit.ly/3xlLcQq | FOSDEM 2020: https://bit.ly/35xZGy6 | Logs: https://bit.ly/32MfbH5
califax has quit [Remote host closed the connection]
califax has joined #openscad
N4buc0 has quit [Remote host closed the connection]
lostapathy has joined #openscad
peeps[zen] has joined #openscad
peeps[win] has quit [Ping timeout: 240 seconds]
peepsalot has quit [Ping timeout: 260 seconds]
use-value1 has joined #openscad
use-value has quit [Ping timeout: 260 seconds]
use-value1 is now known as use-value
ur5us_ has joined #openscad
J2226 has joined #openscad
J22 has quit [Ping timeout: 250 seconds]
SilentSquares has joined #openscad
<SilentSquares> I'm having trouble with re-assigning variables within a loop. With python, you would go something like
<SilentSquares> x = 0
<SilentSquares> for i in (len(range(10)))
<SilentSquares>     x =+
<SilentSquares> and at the end x would be equal to 9
<SilentSquares> but within openscad
<SilentSquares> A) you cant specifically assign an *index* of a variable/array, you're reassigning the whole array.
<SilentSquares> B ) When I'm running my code, and running echo, x will do 0, 10 times
<SilentSquares> Can Iget some help on this?
<SilentSquares> basically, I'm unable to re-assign a variable from within a loop. The tutorial shows using i, a, etc. whatever the iterative variable *is.* but I cannot use that alone.
SilentSquares has quit [Ping timeout: 250 seconds]
arebil has joined #openscad
drkow has joined #openscad
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
drfff has quit [Ping timeout: 246 seconds]
ViktorasCNC has joined #openscad
arebil has joined #openscad
ur5us_ has quit [Ping timeout: 268 seconds]
J2226 has quit [Quit: Client closed]
J2226 has joined #openscad
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
arebil has joined #openscad
J2226 has quit [Quit: Client closed]
J2226 has joined #openscad
<J2226> silentsquares went silent
califax has quit [Remote host closed the connection]
teepee has quit [Remote host closed the connection]
califax has joined #openscad
teepee has joined #openscad
ali1234 has quit [Remote host closed the connection]
ali1234 has joined #openscad
Guest27 has joined #openscad
Guest27 has quit [Quit: Client closed]
fling has quit [Ping timeout: 240 seconds]
fling has joined #openscad
KimK has joined #openscad
KimK has quit [Quit: Leaving]
<gbruno> [github] hroncok opened issue #4204 (OpenSCAD 2021.01 renders imported 3MF files weirdly) https://github.com/openscad/openscad/issues/4204
KimK has joined #openscad
fling has quit [Ping timeout: 240 seconds]
fling has joined #openscad
ViktorasCNC has quit [Ping timeout: 256 seconds]
lastrodamo has joined #openscad
use-value1 has joined #openscad
use-value has quit [Ping timeout: 260 seconds]
use-value1 is now known as use-value
fling has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
fling has joined #openscad
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
KimK has quit [Ping timeout: 245 seconds]
KimK has joined #openscad
fling has quit [Ping timeout: 240 seconds]
fling has joined #openscad
use-value has quit [Quit: use-value]
J2226 has quit [Quit: Client closed]
J2226 has joined #openscad
arebil has joined #openscad
use-value has joined #openscad
Guest35 has joined #openscad
Guest35 has quit [Client Quit]
Guest35 has joined #openscad
Guest35 has quit [Client Quit]
toulene has joined #openscad
fling has quit [Ping timeout: 240 seconds]
fling has joined #openscad
GNUmoon has quit [Remote host closed the connection]
fling has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
fling has joined #openscad
myosotis has joined #openscad
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
KimK has quit [Ping timeout: 248 seconds]
<cbmuser_> teepee: ping
<teepee> meetings!
<J2226> me pings
<cbmuser_> teepee: OK, let me know on Matrix when you're done ;)
fling has quit [Ping timeout: 240 seconds]
fling has joined #openscad
arebil has joined #openscad
fling has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
fling has joined #openscad
N4buc0 has joined #openscad
<gbruno> [github] hroncok edited issue #4204 (OpenSCAD 2021.01 renders imported 3MF files weirdly due to locale lib3mf bug) https://github.com/openscad/openscad/issues/4204
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
N4buc0 has quit [Quit: Leaving]
noonien2 has joined #openscad
noonien has quit [Ping timeout: 246 seconds]
noonien2 is now known as noonien
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
Guest3 has joined #openscad
Guest3 has quit [Write error: Broken pipe]
lastrodamo has quit [Quit: Leaving]
<J2226> ctrl+shift click  to fold unfold .. good to know Ü
arebil has joined #openscad
leif_kc8rwr has quit [Remote host closed the connection]
KimK has joined #openscad
<J2226> seems this fold unfold is still bit buggy  maybe if there are too many lines between
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
ur5us_ has joined #openscad
<gbruno> [github] thehans closed issue #4190 (Submit modification from clone repository https://github.com/AGZ-france/openscad) https://github.com/openscad/openscad/issues/4190
extor has joined #openscad
GNUmoon has joined #openscad
KimK has quit [Ping timeout: 260 seconds]
TheAssass1n is now known as TheAssassin
miique has joined #openscad
miique has quit [Remote host closed the connection]
myosotis has quit [Quit: myosotis]
SilentSquares has joined #openscad
<SilentSquares> has anybody responded to my question?
<teepee> nope
<teepee> you can't reassign variables
<gbruno> [github] Antiswitcher opened issue #4206 (can't iterate variables in loops?) https://github.com/openscad/openscad/issues/4206
<gbruno> [github] Antiswitcher edited issue #4206 (can't iterate variables in loops?) https://github.com/openscad/openscad/issues/4206
<teepee> and github is not a forum :/
<peeps[zen]> SilentSquares: you left the channel before anyone had a chance to
<SilentSquares> i work from 5am to 430 pm, 5 days a week, + saturdays. I could have looked at the archives.
<gbruno> [github] thehans closed issue #4206 (can't iterate variables in loops?) https://github.com/openscad/openscad/issues/4206
<peeps[zen]> as a new user in the channel, it makes it looks like you were impatient and quit. if you wanted replies while offline you should mention that before logging off
<peeps[zen]> but the answer is: no, you can't reassign variables like that. Openscad is a functional language, which follows a declarative model of programming (as opposed to imperative which you are likely accustomed to).
<SilentSquares> then why does the documentation not mention this? in fact it's super unclear how loop heiarchy works, and I've only gotten so far due to my novice experience in python.
<SilentSquares> when is a ";" needed? why is it needed? why are the tutorials so barebones? I'm literally writing testing code to attempt to figure out this.
<SilentSquares> if openscad has it's own language, there's a lot of heritage from python's syntax that *isn't mentioned anywhere.*
<AndrewStone[m]> how many languages do you know?
<AndrewStone[m]> (computer)
<SilentSquares> I'm a novice at python and that's *it*
<SilentSquares> i just wanted to make fractals
<peeps[zen]> i'd say its closer to C/C++ in syntax
<SilentSquares> why can't I re-assign value to a specific index of an array? i have to re-construct the whole array
<SilentSquares> the list goes on
<AndrewStone[m]> SilentSquares: its syntax isn't much like python compared to many other computer languages. Computer languages fall into 2 broad categories and the similarities you are finding with python are just those.
<AndrewStone[m]> a VERY long time ago, 2 major families of computer languages were invented: declarative and functional.
<AndrewStone[m]> Python is declarative but borrows some functional elements like lambdas, openscad is functional.
<AndrewStone[m]> what functional means is like math functions.
<AndrewStone[m]> a math function always returns the same value if given the same input.
<AndrewStone[m]> ha by "declarative" I meant "imperative", oops
<AndrewStone[m]> so by extension, in a functional language you can't set a variable to another value, because just returning that variable from a function breaks the "function always returns the same value if given the same input" rule.
<peeps[zen]> specifically openscad is "purely functional", meaning that values are not mutable https://en.wikipedia.org/wiki/Purely_functional_programming
<AndrewStone[m]> since you are used to imperative style, declarative style will seem awkward to you. (and people have their preference, its religious war for programmers)
<AndrewStone[m]> but under the covers there are cool optimizations functional languages can do. For example, if openscad has already executed "spur_gear(a,b)" and it is called again, it doesn't have to execute it again. It can just grab the prior result.
<AndrewStone[m]> you can also more effectively do proofs of program behavior on functional style.
<AndrewStone[m]> these advantages are likely to be irrelevant to you for years -- and yes, you are going to smack straight into functional programming's major drawback -- you can't change variables once set.
<AndrewStone[m]> So imperative style certainly appeals more to beginners. It might be frustrating, but ultimately probably rewarding to learn both major language families. Each family has advantages and disadvantages
<AndrewStone[m]> typically in a functional language you want to construct the array "right" the first time, modify it in "passes" -- that is, don't modify just 1 element, pass through the array creating a new array by applying the change to every element in the original one. This is efficient.
<AndrewStone[m]> WRT openscad though, I don't know, I've been working with the lang for only a week now.
<peeps[zen]> SilentSquares: what type of fractals did you want to make? there are likely some existing examples you could study, which might help understanding how such things are done
<AndrewStone[m]> s/declarative/functional/
<peeps[zen]> SilentSquares: for example, you can see a Menger Sponge implementation in "Examples -> Old -> example024.scad"
<SilentSquares> Sierpinski gasket, for  example
SilentSquares has quit [Quit: Client closed]
TheCoffeMaker has quit [Ping timeout: 260 seconds]
TheCoffeMaker has joined #openscad
SilentSquares has joined #openscad
<SilentSquares> sorry, my browser malfunctioned