<guso78k>
ecraven, did you enable Manifold ? Manifold union can preserve the colors when unioning
<ecraven>
no, I don't know about that. thank you, I'll read up!
<guso78k>
In the settings somehwere you can setup backend to manifold
<ecraven>
hm.. the problem seems to be that the *difference* I run after the union changes the colors again
<ecraven>
ok, so I need to reorder things ;)
<guso78k>
ahh , so colors are not maintained ;)
<guso78k>
not=now
<ecraven>
difference seems to recolor everything
J25k80 has quit [Quit: Client closed]
J25k80 has joined #openscad
<J25k80>
manifold is under advanced
<J25k80>
face colors of difference is the color of the differenced object
<ecraven>
can I use manifold for preview? it seems to be fast enough for my simple models?
<InPhase>
You can just render instead of preview. There's an aspiration to eventually replace the preview subsystem with manifold rendering, but as you are seeing it needs the coloring to work properly, and this is a new feature.
<InPhase>
Preview was only created in the first place because of how slow rendering used to be.
<ecraven>
but each time I change my file (in an external editor), I go back to preview, can I set it so that it always directly goes to render?
<ecraven>
(there's a reason I want polygon instead of two squares, because I need the points to add rounded corners in some places)
<ecraven>
ok, please ignore, found it .. missing a -
guso78k has quit [Quit: Client closed]
rapha has joined #openscad
<rapha>
hi all!
<rapha>
i'm running into the functional-paradigm / immutable-variables brick wall again
<rapha>
so i have this thing where i have a number of parts and need to use as many as possible of them, but not more than i have
<rapha>
so it'd be nice to have part_a_counter = 50 and then each time i use part A, part_a_count--, and in the end printf(part_a_counter)
Guest26 has joined #openscad
<rapha>
is there anything in OpenSCAD that allows for something like this?
<Guest26>
Hi there, can anyone help me understand the rules for inclusion?
<rapha>
Inclusion of what, Guest26?
<Guest26>
Other SCAD-files
<rapha>
Oh. What about it are you having trouble with?
<rapha>
s/printf/echo/
<Guest26>
You see, (for testing) I've created three files: A, B and C. B includes A and C, C includes B and A and A includes nothing. Obviously, there's a cycle and OpenSCAD interrupts this cyclic inclusion. The second instance of C is ignored. What I do not get about this is: Why is the second instance of B not also ignored?
<rapha>
there's people in here who work *on* openscad, so if you just idle around for a few hours, one of them will answer towards the evening
<rapha>
(mostly middle european time zones, is my feeling of the channel)
<Guest26>
My original idea was to write my own little libraries, because I've been copying the same functions and modules into several files, but those modules are now growing, so I'd like to keep them separate. However, I run into these pesky "variable has been overwritten"-warnings, so I read the page you linked and I've come across a common scenario (at
<Guest26>
least that's how I'd classify it): A->B->C and A->C (with "->" meaning" includes"). In my library-files, this leads to those warnings and I don't quite get why, so I considered using "use" instead of "include" (and found out the global variables there *are* actually declared and then used, for example for default arguments), but... Well, I might
<Guest26>
just be confused about all this. It just doesn't behave according to my intuition.
<Guest26>
Alright, thanks! I'll linger and watch. :)
fling has quit [Remote host closed the connection]
fling has joined #openscad
vinayakjeet has joined #openscad
vinayakjeet has quit [Client Quit]
<ecraven>
openscad doesn't support complex numbers for math, does it?
<InPhase>
Nope. But you can convert those operations to matrix ones, as this has some support, and can be augmented easily enough.
<InPhase>
Most complex number operations relating to geometries are just a shorthand for some straightforward matrix ops. And ultimately all of them can be re-expressed as operations on vectors with appropriate steps.
<ecraven>
however, I have no idea how to convert the formula to work with polar coordinates, and if I solve it for x (depending on y), this leads to complex numbers
drkow has joined #openscad
drfff has quit [Ping timeout: 252 seconds]
<InPhase>
ecraven: a = 4; b = 3; polygon([for (t=[0:359]) let(xs=t<90||t>270?1:-1, ys=t<180?1:-1, tm=90-abs(t%180-90)) [xs*a*sqrt(cos(tm)), ys*b*sqrt(sin(tm))]]);
<InPhase>
ecraven: I think.
<ecraven>
thanks, I'll check!
<InPhase>
ecraven: In summary, the superellipse parametric form, repeating quadrant 1 four times, and flipping things appropriately.
ali1234 has quit [Remote host closed the connection]
ali1234 has joined #openscad
<J25k80>
rapha you can use a recursion for this, but i assume there is a better way to get the result - so why do you want to count?
cart_ has quit [Ping timeout: 246 seconds]
<J25k80>
you can use parents for some kind of BOM
<J25k80>
"allegedly"
Guest8 has joined #openscad
<J25k80>
counting modules is probably not possible if they are in different scopes and not children of each other
<InPhase>
rapha: I missed your question until I saw J25k80's reply. But maybe you can give a little more detail of the use case. Recursion-is-looping is the way to think about the problem. Either you do function recursion and count up what you're going to do ahead of time, and then just instantiate what you precalculated with your functions, or you do module recursion as looping and put everything you do
<InPhase>
inside this module recursion looping.
<InPhase>
rapha: But whether or not this has any secondary problems, or which of these is smarter to try, depends on some details of your scenario.
<ecraven>
InPhase: hm.. I don't understand how to add the parameter for the "amount" of rounding into that :-/
<InPhase>
ecraven: There is no amount of rounding in the first definition.
<ecraven>
I'm using the Fernandez-Guasti squircle.
<ecraven>
I need to control the amount of rounding too :-/
<InPhase>
ecraven: Well, a random mathematical guess lets me introduce this q parameter which works for values from 0 to 1: a = 4; b = 3; q = 1; polygon([for (t=[0:359]) let(xs=t<90||t>270?1:-1, ys=t<180?1:-1, tm=90-abs(t%180-90)) [xs*a*cos(tm)^q, ys*b*sin(tm)^q]]);
<InPhase>
Oh, actually it works above 1 as well.
<InPhase>
Just don't go negative.
<InPhase>
But 1 is the ellipse it seems.
<InPhase>
It's possible that the q I introduced is equivalent to 1-s from the bottom of that page, but if you want to prove they're the same, I'll leave that as an exercise for the reader. They have the same range though, just backwards. :)
<ecraven>
thanks, I'll play around with this!
<ecraven>
somehow playing with openscad always comes back to needing to understand more maths :D
<InPhase>
Nice. 2 gives a diamond.
<InPhase>
It kind of makes sense that 2 would give a diamond. :)
<InPhase>
The diamond is not one of the shapes from that mathworld page, but I don't suppose you'd want those other asymptotic non-geometric shapes anyway.
<ecraven>
no, I'm playing with keycaps, and just want "nice" rounded rectangles
<InPhase>
That is within shape of a pretty shape for that.
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stealth_ has joined #openscad
<stealth_>
i 3d printed some cellphone stand and gave it to my mom to use, and her boss at work is asking me if i want to sell it at their store! is it worth it?