ccox_ has quit [Remote host closed the connection]
ccox has joined #openscad
ccox_ has joined #openscad
ccox has quit [Ping timeout: 260 seconds]
J24k73 has joined #openscad
J24k87 has quit [Ping timeout: 256 seconds]
LordOfBikes has quit [Ping timeout: 265 seconds]
snaked has quit [Quit: Leaving]
LordOfBikes has joined #openscad
UltimateCodeWarr has joined #openscad
<UltimateCodeWarr>
Why would the documentation insist on calling a constant a variable?
<UltimateCodeWarr>
Chapter 8 Tutorial on OpenScad thoughts on creating the taurus?
<InPhase>
Sometimes they are called constants, but the word choice is somewhat variable.
<UltimateCodeWarr>
In loops, the act as variables, but whey you declare them in the file, they behave like a constant.
<InPhase>
UltimateCodeWarr: What do you mean by "thoughts"? The normal proposed solution is provided in the tutorial.
<InPhase>
They are immutable within scope, but can take on different values each time a scope is entered.
<InPhase>
So the values can in fact vary. But each scope gets to have only a single declared value.
<InPhase>
The exception to this is the C-style for loop in list comprehensions, which is syntactic sugar defined as equivalent to a recursive generator in the manual.
<InPhase>
s/recursive generator/recursive function call/
<UltimateCodeWarr>
Top of file a=1, bottom of file a=100, the OpenSCAD takes a's value to be 100. But if you were a normal person reading the program from top to bottom, you would think a=1 and would wonder why the math was wrong.
<InPhase>
UltimateCodeWarr: If you were used to imperative languages, yes.
<UltimateCodeWarr>
I just don't think wonky behavior like that is good in any language
<InPhase>
Do you know that people who learn math, and then learn imperative programming, are often very confused that one can write "x = 1" and then "x = 100" and this is not a contradiction? It's hammered out of people when they learn imperative programming. :)
<InPhase>
These are two styles. A thousand people coming from imperative programming backgrounds have said the same thing. The view is known. :)
<InPhase>
Both are valid and can work fine.
<InPhase>
I myself primarily use imperative languages. One can work with both, and it's not really that hard.
<UltimateCodeWarr>
Well, to really understand what's going on, you have to read the entire program instead of looking at the first couple of chunks
<UltimateCodeWarr>
Ot
<UltimateCodeWarr>
It's ok if the program fits on you screen, but if it starts scrolling to infinity, that's a little harder to grasp unless you are the code processor.
teepee_ has joined #openscad
mmu_man has quit [Ping timeout: 252 seconds]
<UltimateCodeWarr>
It's like those "trick" follow instructions things that say: "#1 Read all instructions First" "#2 Color the Teeth" "#3 Color The Cape" "#4 Do nothing and sit quietly"
<teepee_>
no, just think of that 2nd line as a fax machine
teepee has quit [Ping timeout: 260 seconds]
teepee_ is now known as teepee
<hyperair>
InPhase: hello!
Guest73 has joined #openscad
<InPhase>
UltimateCodeWarr: Well if you tried to redefine x in a program anyway, it would issue a warning from having done so. It isn't really that hard to notice.
<InPhase>
UltimateCodeWarr: In OpenSCAD you should interpret most warnings as errors, which is the common practice. It will continue to make a best effort to keep running anyway whenever it can, but a warning is almost certainly an indication that you have done something wrong that you should not have.
<InPhase>
UltimateCodeWarr: It is really not so different from, say, C, where a function could be defined at the bottom of the program, and you would have to scroll to figure out where it is actually defined.
<InPhase>
UltimateCodeWarr: Although C++ does not give me a warning for this even if I turn on -Wall -Wextra -pedantic.
<InPhase>
OpenSCAD gives a warning. :)
<InPhase>
(on the redefining case at least)
<InPhase>
C++ will permit the redefining as well without a warning, except that formally it is actually undefined what the value will actually be. In OpenSCAD it has a fixed definition, plus a warning.
<InPhase>
So in fact it is generally extremely easy to track where values come from in OpenSCAD. If you didn't have any warnings, they come from a single place that is typically straightforward to find.
<InPhase>
One particularly nice thing about OpenSCAD, is that there is never any mutation of variables in an outer scope. You simply aren't allowed to do it, because they have been declared with a fixed value. This fixes most of the chaos of tracking state in other languages.
<InPhase>
And consequently, if you need to track the contents of a cash register over time, OpenSCAD is not your language. It would be frustrating to try to do it. But that is not the target purpose of the language.
<InPhase>
By sacrificing the easy of doing these mutable imperative tasks, greater clarity arises for the domain specific application it does target.
<InPhase>
s/the easy/the ease/
<InPhase>
All sorts of wild things are still computable. I wrote a CSV parser in OpenSCAD once just to prove I could.
<InPhase>
I won't say it was pretty, because the language isn't built for this. But it was short.
krushia has quit [Ping timeout: 252 seconds]
myosotis has quit [Remote host closed the connection]
Guest73 has quit [Ping timeout: 256 seconds]
<UltimateCodeWarr>
The real mystery is if this computer science methodology is superior, why did they program it in C/C++.
<UltimateCodeWarr>
I would think there would be a lot of code reduction if OpenSCAD used a well supported C/C++ lexigraphical parser at least, and it's adoption/learning would be more widespread/quicker as all the rules and behaviors are well understood for decades by generations. I use about 6 languages regularly and dabble in another 12. Honestly, I
<UltimateCodeWarr>
haven't found it too useful or productive to learn a new syntax. The Garbage collection and machine independence in Java/javascript/C# is what made those languages widely accepted. Ditching Multiple Inheritance for Single Inheritance was a good thing. I have noticed how programing in one language like python, then needing to switch to
<UltimateCodeWarr>
JavaScript introduces a lot of syntactic bugs/hang-ups because of trying to flip flop syntactic rules in your head. I don't enjoy that mental hopscotch.
<UltimateCodeWarr>
I couldn't stand XSLT
<UltimateCodeWarr>
So in Chapter 8 Tutorial on OpneSCAD, creating that donut, this is what I don't understand.
<UltimateCodeWarr>
create a circle in x/y plain, ok
<UltimateCodeWarr>
translate it away from the origin, ok
<pca006132>
regarding why they programmed it in C/C++... there are many reasons, but historical reason is also one reason :)
<UltimateCodeWarr>
then call this function rotate_extrude(angle=360) <-- problem
roleroz has quit [Quit: Client closed]
<pca006132>
apart from historical reasons, functional programming languages are typically also less efficient (but they are improving), so using C++/Rust to write high performance code is still the only way for now
<UltimateCodeWarr>
The problem is, if that angle=360 means the X-Axis, that donut wouldn't be lying the way it is in the X,Y plane.
<UltimateCodeWarr>
I wish there was some sort of Figure Captions Figure 8-5 or something like that where I could reference it.
<UltimateCodeWarr>
Haven't seen much demand on DICE or any of the job boards lately for Rust / Ruby / Objective C / Perk / Visual Basic / COBOL / fortran. C/C++/C#/Java/Javscript/PHP/Python still seem to be industry staples.
<pca006132>
well, I wouldn't call Java/JavaScript/PHP/Python high performance... but yeah, rust is still not as widely used as C/C++
<UltimateCodeWarr>
I go by two things, #1 - Number of Jobs Demanding that Language #2 - Amount in which they are willing to pay for those skills.
lastrodamo has joined #openscad
<UltimateCodeWarr>
So this rotate_extrude() function, looking at the documentation, it doesn't clearly state "about which axis" the object is rotated around.
<UltimateCodeWarr>
The diagrams indicate that it's rotated 360 degrees about the Z-axis, but the text does not come out and explicitly state that.
lastrodamo has quit [Quit: Leaving]
<UltimateCodeWarr>
Also, the 2D shape would have to be tipped up 90 deg about the X axis FIRST and then Rotated 360 about the Z Axis in order to make that donut shape. No?
misterfish has joined #openscad
<J24k73>
Why are commands in one line not causing a warning? x=1;cube(x);x=100;cube(x);
<UltimateCodeWarr>
it's not python ?
<J24k73>
the same in different lines cause a warning
<J24k73>
when overwriting a constant it normally cause a warning
<J24k73>
UltimateCodeWarr the wiki can be edited - make the changes you think are needed for better understanding ( but be sure you understood what you are changing)
misterfish has quit [Ping timeout: 265 seconds]
<UltimateCodeWarr>
I just didn't find that part of the documentation easily understandable.
<J24k73>
UltimateCodeWarr in your link it starts with "Rotational extrusion spins a 2D shape around the Z-axis to form a solid which has rotational symmetry. "
<J24k73>
That a 2D shape is rotated is trivial as any dimensional extrusion need to be done on a new dimension.
<J24k73>
But that is also mentioned "Note that the object started on the X-Y plane but is tilted up (rotated +90 degrees about the X-axis) to extrude."
<J24k73>
(last change was 2016)
<UltimateCodeWarr>
Ok, must have missed that.
<J24k73>
UltimateCodeWarr regarding the loop - in other programming a loop has only one result at a time, while in openSCAD all results exist simultaneously ↦ for (i=[5,10]) cube(i); // ↦ two cubes exist with i =5 and i=10 both i are a constant and not the same variable.
<J24k73>
this becomes more clear when you use recursions where it seems as you can change the constant but you just create a new scope with a new constant ( although a for loop doesn't create multiple scopes afaik)
<J24k73>
well maybe they are parallel existing not consecutive nested like in C# or recursions
<UltimateCodeWarr>
Is there anyway to turn on some sort of 'ghosting' where say you were differencing part B from part A, and you wanted to see both the result, but also the edges of part B and how they were subtracted from part A just to make sure things were accurate.
<J24k73>
"#" will highlight a part - and "!" will exclude it from processing and show transparent - but you can use color("blue",alpha=.5) if you want too
<UltimateCodeWarr>
Ok, went through the tutorial and didn't see any mention of modifier
<J24k73>
sorry "!" will show only this part - "%" is to remove it from processing
<UltimateCodeWarr>
(When those fancy wheels with spokes were being created, would have been a good chance to introduce it)
<J24k73>
it seems the parser stops evaluation after the first ! .. would it be difficult to refine this with a second ! because without if you call the same module several times - it just uses the first and you can't check the others without disabling the rest or changing the order
<buZz>
doesnt the '!' modifier mean 'render only this one item' ?
<J24k73>
buZz yes but if you have this in a module and the module is called several times "this one item" exist multiple times and possibly with different values
<buZz>
ah yeah i guess
<J24k73>
I think at the moments it just stops after the first - and not evaluating any hierarchy
<J24k73>
or checking if a second ! will refine the selection further
<J24k73>
and from the time used - i am sure the whole script is always fully evaluated and not disabling the other parts as "*" would do.
<J24k73>
so it seems we have the worst of both options
<buZz>
i dont think i ever used * , thats also a 'render only this' modifier?
<buZz>
oh, its disable
<buZz>
TIL :)
<J24k73>
if you have large polyhedra and you disable them (working on other parts of your design) they are not calculated when preview and save you time
<J24k73>
while ! is only show this - but calculate everything
Smeef has quit [Killed (NickServ (GHOST command used by deathonater))]
deathonater has quit [Remote host closed the connection]
Smeef has joined #openscad
meshugga1 has joined #openscad
LordOfBikes has quit [*.net *.split]
meshugga has quit [*.net *.split]
dalias has quit [*.net *.split]
stefanct has quit [*.net *.split]
Non-ICE has quit [*.net *.split]
stefanct__ is now known as stefanct
dalias has joined #openscad
LordOfBikes has joined #openscad
mmu_man has joined #openscad
foul_owl has quit [Ping timeout: 260 seconds]
foul_owl has joined #openscad
foul_owl has quit [Ping timeout: 246 seconds]
foul_owl has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 260 seconds]
teepee_ is now known as teepee
rvt has quit [Quit: rvt]
mmu_man has quit [Ping timeout: 248 seconds]
Non-BEAST is now known as Non-ICE
mmu_man has joined #openscad
lastrodamo has quit [Quit: Leaving]
<UltimateCodeWarr>
for a cube why do they use cube(width,depth,height), why not something more standard like (width,length,height)
<UltimateCodeWarr>
depth and height, an elevation of a kind, are usually like a z-axis thing
<teepee>
because it's x,y,z
<UltimateCodeWarr>
whereas width,length are 2d
<teepee>
it's not getting more standard than that
<UltimateCodeWarr>
One thing that would help with learning from the guides/tutorials/documentation is if the OpenSCAD function calls were hyperlinked back to the documentation so you could set the various parameters and examples for use. Of course you might need to add a [copy raw code to clipboard] button at the top, but an automated crawler could do that.
<teepee>
yep, that was one of the proposed projects for Google Summer of Code
<UltimateCodeWarr>
When I was fooling around with the cylinder, and didn't specify the r= on the radius parameter, it became a cone. Accidental, but wouldn't have expected behavior like that.
<teepee>
UltimateCodeWarr: could you check if the axis font rendering is fixed?
snaked has joined #openscad
meshugga1 is now known as meshugga
TylerTork has joined #openscad
<TylerTork>
I'm confused about best practices in the use of the use and include statements in conjunction with libraries. In particular, is there not a way to design a library so it includes everything it needs rather than relying on the caller to know to include other specific libraries? Example: BOSL2/drawing.scad seems to be relying on the availabiliy of an
<TylerTork>
functions in std.scad, but it doesn't "use" this library, instead expecting the caller to load it. Shouldn't libraries be able to manage their own dependencies?
<teepee>
ask the BOSL developers?
TheAssassin has quit [Remote host closed the connection]
<TylerTork>
This isn't specific to BOSL -- I'm talking about best practices for use of the language. And once I have a handle on that, THEN I'll talk to the BOSL developers and probably recommend some changes.
<TylerTork>
Is there a reason a library can't add use statements for other libraries it needs that are in the same folder?
<teepee>
2 things I can imagine, bigger one might be performance, BOSL is a huge project relative to most scad projects
<teepee>
there could be issues with include vs. use, not sure