<UCW>
I don't think it's a good lesson to show someone how to translate something without some sort of grid units on the diagrams.
<UCW>
Then to use a sphere... A person needs to know which edge will be counted. Some software languages are 0 based others 1 based for indexing into arrays, and if you forget this rule, the outcomes are radically different.
fluter has joined #openscad
myosotis has quit [Remote host closed the connection]
<InPhase>
UCW: We put a good pedagogical arrangement into that, to rapidly introduce the key concepts and how they go together.
<UCW>
Thx Phase, but did you understand my point on the documentation as it is?
<InPhase>
UCW: translate is basically the second thing taught there, and by the end of Chapter 1 someone following along with it should be extremely comfortable with it.
<InPhase>
UCW: Actually it sounded like a misunderstanding, as no edges are used.
<InPhase>
UCW: It's a translation, so it is a relative displacement.
<InPhase>
UCW: But that is resolved with the tutorial's approach, which teaches to drop the object and then translate it.
<UCW>
Well, when center=true, it's using the center of the object,but then you get fractional units when dealing with a sphere.
<InPhase>
sphere is centered by default. But either way, it's relative. So you can make the object, look at it, and translate it. And you can translate, rotate, and translate, and no edges are used, but just relative to what it is at each point. You should train to build up arrangements iteratively (until you're doing that automatically in your head).
<UCW>
Also when you say drop the unit then translate, that's what I would think....but that's not how the code is written sequentially. It's I'm about to translate the next object.
<InPhase>
Yeah, you write the object first. Then you add a translate above it.
<UCW>
translate([5,0,0]) sphere(1,center = true);
<UCW>
I find that bizarro. Most modern day languanges would do sphere(1).translate(5,0,0)'
<InPhase>
Well it's written as an operator.
<InPhase>
And thus you build them up right to left.
<UCW>
++var is usually not used but c++ is
<InPhase>
A classical operator, like from mathematics.
<UCW>
Well it is what it is, but just saying this was supposed to be a programmers cad language, and .... not seeing it.
<UCW>
If I wanted to write a tutorial on translate I would just put a cube(1).translate(1,0,0) That's it and show how it ends up on a matrix.
<InPhase>
It's a programmer's cad language, but it's not an imperative language, nor trying to be one. :) It's a declarative functional language.
<InPhase>
cube(1).translate(1,0,0) is what you'd write for "I'm going to modify this already created object". But everything is constant within scope in OpenSCAD.
<InPhase>
So the declared geometry has operators applied to it.
<InPhase>
It really is not hard to pick up and adapt to though. I've taught plenty of non-programmers to use it just fine. :)
<UltimateCodeWarr>
I just don't get why they would use a model that has a very small following (Haskill, Erling,Clojure ) these languages haven't been adopted by industry anywhere near the level of javascript, java, c,c++,c#
<InPhase>
There is a simplification convenience that arises from it. It's typically extremely clear where every result comes from in a model. There's generally no hunting around for interaction effects or anything like that.
<InPhase>
And it happens to be a language style that works extremely well for the domain specific task.
<UltimateCodeWarr>
It's not insurmountable, but if I wanted wide adoption, I would go with the flow
<InPhase>
I actually DON'T prefer functional languages for general purpose programming. But if you give it a try for a while, you'll probably find as most do that it fits the specific problem domain pretty well.
<InPhase>
Well, I think we got wide adoption already. :)
<UltimateCodeWarr>
Curious, how so?
<InPhase>
There are plenty of alternative attempts to code cad with imperative languages. OpenSCAD is by far the dominant choice for this.
stealth_ has quit [Remote host closed the connection]
<InPhase>
There are javascript code cad attempts, python code cad attempts. OpenSCAD is the one under popular use, because it's custom-fit to the problem domain.
<UltimateCodeWarr>
Are there any other cad programs that can output to OpenSCAD?
<InPhase>
There are, yes. They are not particularly popular, but some niche users make use of them.
<InPhase>
It is generally simpler to use the language as is. I was repeatedly able to teach non-programmers to use it effectively with like 2 hours of instruction. Programmers don't tend to have less trouble picking it up.
<UltimateCodeWarr>
Usually industry adoption is the index of popularity. Remember Windows .BMP format, terrible format, never really used in the web, but still plenty of Paint programs output to it.
<InPhase>
Programmers can then leap quickly into advanced usages if they're familiar with recursive function writing, which opens up the next level of some more advanced functionality.
<UltimateCodeWarr>
Fractals and Mandlebrots
<UltimateCodeWarr>
I could see a torus, translating a sphere through space.
<InPhase>
This is a torus in OpenSCAD: $fa=1; $fs=0.4; rotate_extrude() translate([10,0]) circle(5);
<UltimateCodeWarr>
Great little gasket script
<UltimateCodeWarr>
Well, I'm off to the races, better work my way through the Boyscout Derby Car Tutorial.
<InPhase>
:) Maybe someday those Boyscout races will upgrade from wood to 3D printing.
<UltimateCodeWarr>
and put an Estes D3 Rocket engine in the back.
<InPhase>
Although I did have fun working on those wooden racecars as a kid. I still have the two I made, and my youngest child plays with them.
<UltimateCodeWarr>
Heirlooms Wished todays stuff lasted as long.
<J24k36>
UCW you need to code like Yoda if openscad master you want.
<UCW>
lol, I've set up a mirror to reflect my monitor and erased the letters on my keyboard. Going to take the Race Car competency test, wish me luck
<J24k36>
ucw as you noticed scad is different and e.g. there are no variables only constants - so you can't do x=x+1; but you can do recursion - it requires a different mind set but when you adapt it is great - have a look at the scadvent galleries
<J24k36>
after a while it become natural like "move the box" ↦ translate([10, 0])cube(10);
<J24k36>
think about not like have a cube and translating - but translating the origin and then creating the cube on this location
<J24k36>
openSCAD also comes with some examples when you open it
<InPhase>
lol. If more people made use of the examples, we probably wouldn't have had to recently add them to the testing suite. ;)
UCW has quit [Remote host closed the connection]
<J24k36>
We could add the tutorial or some step by step learning into the examples .. maybe a good idea or?
<UltimateCodeWarr>
Just saw two yellow cubes, is that the expected outcome?
<InPhase>
Ugh, yeah, because I never got around to finishing updating the default color scheme. :)
<InPhase>
UltimateCodeWarr: Oh wait, are you running J24k36's code or the tutorial?
<UltimateCodeWarr>
I just ran JK's code, and it had color("blue") cube(10) and I saw a yellow cube
<UltimateCodeWarr>
I took a break from the tutorial
<InPhase>
You pressed preview or render?
<InPhase>
Currently color only works in preview.
<J24k36>
(snapshot should also render colors)
<InPhase>
Oh is that merged now?
<InPhase>
I didn't build in a little while.
<J24k36>
öh maybe i use something not so official
<UltimateCodeWarr>
I see the Red/Blue in prevew, I've been used to pressingF6
<InPhase>
J24k36: Öh.
<J24k36>
Ü
<UltimateCodeWarr>
There was a bug, I had create a new file and pressed F6, and since there was no code, it left the old torus up
<UltimateCodeWarr>
I think if the code file is empty, so should the drawing area.
<J24k36>
InPhase i just wonder how you made the ö a capital Ö
<UltimateCodeWarr>
So in this example, you translated it out 20 on the X, but when you look at the Red Cube on the Grid line it's resting on the 15 mark?
<InPhase>
lol. Well I can bring it up with a symbol keyboard. Or I could have memorized the unicode for it. Or I could have grabbed it off of my extended ascii table that I keep around. But no, I googled "capital O with umlaut" and copied and pasted.
<J24k36>
UltimateCodeWarr the cubes right corner is in the origin and then on the 20 .. but you can use a cube(10,true); // center = true
<J24k36>
LEFT LOWER corner
<UltimateCodeWarr>
I was misreading the scale, sorry. I wish this had a nicer font for numbers, a 2 looks like a 5 at different rotations
<UltimateCodeWarr>
If it had the bezier sweeps in there, it might be a bit easier to distinguish.
<J24k36>
InPhase + for effort .. I had the idea that some automated parser made the first letters capital
<UltimateCodeWarr>
Also wish the Gridlines were like a Mouse Cursor that would XOR themselves so that if it was a dark background they were up against, the gridlines would be white, but if they were up against a light background, they would be dark.
<TylerTork>
I expected to give me a cube with a cube cut out of it, but instead I get the two cubes unioned
<TylerTork>
Is there not a way to have the children of a for treated as distinct objects to pass to a module?
<TylerTork>
this is not the exact use case, but a simplified example. I'm writing a module that uses children() and I'd like to be able to pass it objects generated by a loop for it to position independently of each other
TheCoffeMaker_ has quit [Ping timeout: 252 seconds]
TheCoffeMaker has joined #openscad
<teepee>
TylerTork: no, you can only separate via multiple children() calls, but not the result of a for()
<TylerTork>
well poo.
<teepee>
in most cases it's possible to extract the data needed for the operation and pass that instead of the already generated geometry
teepee_ has joined #openscad
<InPhase>
TylerTork: Note that difference only treats the first object as the positive object anyway, so it's not much different to isolate out the first one, and then you can still loop over the remainder.
teepee has quit [Ping timeout: 260 seconds]
teepee_ is now known as teepee
<TylerTork>
right -- but using difference was just an example. In the actual use case I want to receive an array of children and translate them to different positions -- changing the spacing between them.
TheCoffeMaker_ has joined #openscad
TheCoffeMaker has quit [Ping timeout: 252 seconds]
misterfish has quit [Ping timeout: 244 seconds]
<J24k>
with lazy union this should work
misterfish has joined #openscad
<TylerTork>
J24k please elaborate
<TylerTork>
I see. So I can't put it in the code, I have to enable it in the preferences and someone else running the code will get a different result.
<TylerTork>
Not ideal but I suppose it satisfies some use cases.
<J24k>
if you use experimental settings - it sure is different if they are off - like textmetrics or roof
<TylerTork>
New question: Is there any reason, perhaps performance-related, to make regular polygons using polygon and/or the MCAD/regular_shapes library as opposed to circle with $fn argument?
<J24k>
MCAD is very old - there are some solutions that are no solved by build in code directly
<J24k>
but manual polygon are slower than using circle($fn=x);
<TylerTork>
okay. So I want to work on the MCAD code. I have decades of software development experience. Does anyone own this stuff right now?
<teepee>
no, it does not work with lazy union, and never will
<TylerTork>
So: again -- is there someone "owning" the MCAD library, or what do I need to do to make edits and get them processed? I haven't done open source projects like this one before and I'm unsure of the protocol
<InPhase>
The project owns it. But honestly I don't think anyone is paying much attention to it.
<InPhase>
It was the first attempt at "we should have a library", but now most things that are in it, people use other libraries to solve those same problems.
<InPhase>
And the future is viewed as supporting a library system so that many libraries are more naturally integrated, which would dethrone MCAD from special status. A lot of work was done on that already this year.
<TylerTork>
So I create a pull request and submit it to hyperair for review and merging?
<teepee>
mcad is not so much a library as a collection of useful random scripts from the old days
<teepee>
I believe there was a develop branch as an effort to bring a new version eventually
<TylerTork>
I get that. I just want to make sure the implementations there are up to modern standards for efficiency, what there is is documented, including whether things are deprecated because there's a better way to do it.
<teepee>
but I don't know if that is still happening, it does not get much time but fixes and extensions are merged from time to time
<InPhase>
Hmm. I see there is a hyperair here, but I have no comments in the logs from hyperair going back to before the formation of libera.chat :)
* InPhase
waves at hyperair with a greeting.
<teepee>
dev branch: "This branch is 356 commits ahead of, 8 commits behind"
<TylerTork>
teepee, not sure what that means. Are submissions not getting processed?
<teepee>
that means there's quite a large amount of changes in the dev branch compared to the master branch
<InPhase>
Mostly over Covid it looks like.
<J24k>
I fixed some - never got pushed .. so i stopped working on MCAD
<teepee>
if we get the library manager actually running, it could make sense to just call that dev branch mcad2 and put mcad into full archive mode
<J24k>
was 2021
<teepee>
still waiting for the final Snap-Store approval
<teepee>
but it already has two +1 :-)
<teepee>
well, pyinstaller seems to work fine too, so maybe we don't even need to wait for the Snap
guso78k has joined #openscad
<guso78k>
kintel, thank you for your suggestion. i just read it now.
misterfish has quit [Ping timeout: 265 seconds]
Artea has joined #openscad
<InPhase>
teepee: Yeah. Version management means breaking changes can be potentially handled a bit better.
<InPhase>
Or even just alternate versions of the same library.
<teepee>
yep, new major version allows to break compatibility
L29Ah has joined #openscad
<guso78k>
@kintel, the 2 additional blender lines are great. once i draw the opaque things first, everything, works as expected. Thank you!