<kintel>
..the above doesn't work with msys2 python, as binary wheels aren't hosed on pypi
<kintel>
..but pacman does come with numpy and pillow packages, so I'll try to install those and get the venv to use them
<kintel>
^ Just in case you also went down that rabbithole and failed :)
<InPhase>
kintel: But did you separately install python-pip? Just having pip is not the same as having "python-pip" installed by pacman.
<kintel>
Yeah, that one comes from msys2-install-dependencies.sh
<InPhase>
What's the log sequence of the error you're getting?
<InPhase>
I'm pretty sure someone previously in here got a successful msys2 build from those steps locally, way back in the logs. So I'm trying to figure out what's different.
<kintel>
Found existing installation: setuptools 66.1.0
<kintel>
Not uninstalling setuptools at c:/msys64/ucrt64/lib/python3.10/site-packages, outside environment C:/msys64/home/kintel/code/OpenSCAD/openscad/build/tests/venv
<kintel>
Can't uninstall 'setuptools'. No files were found to uninstall.
<kintel>
Looks like setuptools is already from pacman
<InPhase>
Basically, it tries to do a compile (and fails) when it can't find the wheels.
actiondave has quit [Ping timeout: 248 seconds]
<InPhase>
So the core problem is that it can't find the wheels, because of something going wrong with something like setuptools.
<kintel>
I don't actually know how pip resolves Python package wheels. I assume they'd be hosted on pypi, or some user-configurable location?
<InPhase>
Yeah, they're on pypi, and then cached locally if recently downloaded.
<kintel>
Do you know if regular win32 wheels would be compatible, or if we need msys2/mingw wheels?
<InPhase>
Should be regular ones.
fedorafan has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
GNUmoon has quit [Ping timeout: 255 seconds]
GNUmoon has joined #openscad
<kintel>
InPhase Pip is somehow not able to request a wheel; looks like it expects "any" rather than a win32 wheel
<Guest7068>
Folks, is there a programmatic way to export to STL? I know I commands can import but there isn't (or I can't find) commands to export... (I know F6 save as STL) but I want to create 300+ stl files and this isn't practical manually...
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<teepee>
Guest7068: via script no, but you can automate via command line call
<InPhase>
Clarifying teepee, not via scad commands, but you can script it with bash or another script of your choice. Note the -D command line parameter that lets you select different parameters for your design in each call of one scad file.
<teepee>
yeah, I just wanted to rephrase "not via openscad script" :)
<teepee>
but via bash / cmd / powershell / whatever the system supports
<Guest7068>
Ok - got this... will -D size=10 overwrite a size=10; statement in the openscad program? do I need to do anything in the program to declare that a variable is set externally?
<teepee>
you need to give it a value at the top of the main script
<teepee>
the -D will then overwrite that
<teepee>
but otherwise no special setup needed
<Guest7068>
This seems to be a missing feature in the openscad language - I guess it's a fairly unusual issue and relying on external scripting is acceptable but it seems very clunky in an otherwise elegant world!
<teepee>
for complex list of values, the customizer could be an option too, but if you have that many scripts and if it's just 2 or 3 values, that -D path is probably the best option
<teepee>
openscad script is unlikely to ever write files
<teepee>
that said, there's potentially a totally different (and maybe for lots of people surprising) way coming :D
<Guest7068>
-D... Thanks! I'll bodge it based on this - I only need to do this once but I cannot be arsed to sit and press buttons every few minutes for the entire day!
<InPhase>
Guest7068: Actually it's an intentional design choice.
<teepee>
someone was working on using python directly in openscad. it's working for some cases but having it mix and match existing scripts, may take quite a while still
<InPhase>
Guest7068: We prohibit scad files from triggering their own file writing operations to avoid security holes.
<InPhase>
Guest7068: So no scad file you download from the Internet will ever modify your file system contents.
<InPhase>
(Unless there is a flaw in OpenSCAD itself.)
<teepee>
yep, that, plus it does not match the "describe object" vs. "run code" logic
<InPhase>
Guest7068: This leaves it as a "domain specific language" which has one role, a description of one or more models. Making use of it is the job of either the gui, or scripts which invoke it by the command line.
<InPhase>
Guest7068: The good news is this leaves a lot of flexibility. A person can trigger it however they want, and we work very hard to make sure every applicable feature for generating something has a sensible command-line way to trigger it.
<InPhase>
It could be a bash script, a python script, a perl script, even if you like suffering a powershell script.
<peeps[zen]>
kintel: i'm reading scrollback and confused about what the python / msys2 issue is. msys2 tests seems to be fine on master?
<InPhase>
peeps[zen]: kintel is having a local-only msys2 problem running tests, and struggling to figure out why.
<InPhase>
It is for some reason failing to setup the venv.
<InPhase>
Although I'm pretty sure others using msys2 have been doing this in the intervening months. Yet somehow there is a difference.
<peeps[zen]>
i'm wondering if its related to the fact that venv is unintentially installed/packaged by cmake/cpack. it was something teepee brought up the other day
<peeps[zen]>
since I worked on packaging up tests for windows, right before you added python dependencies
<peeps[zen]>
the tests setup for windows is especially complicated, because there are provisions to allow for running tests on a different platform than that which it was built on
<Guest7068>
A little vi magic and I'm away - thanks (main hassle was coordinating the filename with the parameter). I still maintain this is a missing language feature! thanks for your help folks!
<InPhase>
It is missing! But it's missing on purpose for the good goal of having a stronger sharing community.
<InPhase>
Sometimes there are fundamental tradeoffs in design goal choices.
<peeps[zen]>
also, I saw some of the msgs in the log about pip being outdated. i wonder if upgrading that would potentially resolve any of the issues?
<peeps[zen]>
it was 3 minor versions behind
<InPhase>
peeps[zen]: I would say the venv is intentionally installed by cmake, since I put code for that in there on purpose. :) But there could be other ways to arrange the setup.
<peeps[zen]>
no no, i mean "cmake install"
<InPhase>
Oh right, that. Where it gets carried over.
<InPhase>
Yeah, that was not a design goal.
kintel has joined #openscad
<peeps[zen]>
also the PIL install fails on something about MSVC 6.0, while it appears to be in a stack trace regarding MSVC 9
<ndnihil>
here on libera it's .60 currently, but cycling through that whole block it looks
<kintel>
Yeah I know, I just wanted to use the same macro. Will try porting to FindPython3 everywhere instead
<kintel>
..but this at least makes the two environments behave the same
<teepee>
ndnihil: different ip though
<kintel>
I can always try to manually install Python on Windows locally
<kintel>
..but it would be great with a more isolated build env
<teepee>
ndnihil: ah, having lots of ips to spare?
<InPhase>
Yeah. I'd like it to not require much setup.
<ndnihil>
yeah, it's a /23
<teepee>
thanks, lets have that for a bit then :)
<ndnihil>
right on
<kintel>
anyway, gotta run, I'll read the log later if anyone has great ideas related to Python
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ndnihil>
compromised host on kaopucloud.com it looks
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
Guest7068 has quit [Quit: Client closed]
mechadense has joined #openscad
<ndnihil>
+b *!*@38.54.116.*
<ndnihil>
that whole hosting provider is compromised
<ndnihil>
+b *!*CRAZYMF@*
<ndnihil>
might be a better catchall, it's consistent across all the IP blocks it's coming from so far
<ndnihil>
seen it on 6 /23 to /24 blocks so far, all allocated to kaopucloud.com
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
mechadense has quit [Quit: Client closed]
<lf94>
Is today the day I look at OpenSCAD + libfive?
<teepee>
yes, april 1st is perfect for that :)
<lf94>
openscad's deps growing so large :')
<teepee>
not all are mandatory
<lf94>
building
kintel has joined #openscad
<lf94>
ok. Would our new sdf() be considered a PrimitiveNode? I would think so.
<lf94>
(btw these docs/*.pdf are super damn useful. thank you whoever did them)
<lf94>
looks like sphere is actually an AbstractNode. I suppose I should be careful about the accuracy of these graphs
linext_ has quit [Read error: Connection reset by peer]
<lf94>
non-csg expressions are evaluated in Expression.cc?
<lf94>
This file is massive
<guso78[m]>
lf94, i have thought about a great concept, to do the reverese function: converting a polyset to sdf
<guso78[m]>
this could be then altered and converted back with an oracle
<lf94>
hehe, you're not the first, but it is hard :)
<lf94>
from what i understand
<guso78[m]>
for each new application,the code develops a program do split he room in halfspaces until its clear, which face it the correct one. then i jus need point-to-face distance
<lf94>
I wish InPhase was here. He had a particular vision for this...
<lf94>
Right now I'm thinking: sdf(function(x,y,z) ... )
<teepee>
lf94: not PrimitiveNode, but a new LeafNode I would suppose
<guso78[m]>
yep this is oracle aproach
<lf94>
Yeah, they wanted oracle, so trying oracle
<lf94>
I'm gonna need all the help I can get because I don't know C++ very well nor the code base and I don't have a ton of time but I have the motivation
<guso78[m]>
the frep algorithm will consult the oracle a tremendous amount of calls. so better make sure its super fast
<lf94>
I dropped off my partner so I'm alone for a week :)
<lf94>
Can functions have temporary variables in them?
<lf94>
I guess via let ...
<lf94>
> no let
<guso78[m]>
yep, leafnode is the node with the polyset ...
<lf94>
Ah no, there is let
<lf94>
function(x,y,z) let (other, variable, stuff) { ... }
<lf94>
I thought there was a way to start openscad without starting a window
<lf94>
i.e. evaluate the file
<teepee>
yes -o -
<teepee>
dump to stdout, eg for STL
<lf94>
> Either add a valid suffix or specify one using the --export-format option.
<lf94>
(Sorry, I'm moving at lightning speed here)
<teepee>
if you have none, it may not be needed at all
<InPhase>
lf94: I saved my code example from our last discussion: https://bpa.st/447H6
<lf94>
*phew* thank you!
<lf94>
I was looking for it
<lf94>
teepee: gotchya
<lf94>
For now: comment out
<lf94>
yeah ok, perfect
<guso78[m]>
suppose you will need some paramters later for bounding box and frep resolution
<lf94>
pretty much what I was expecting / said earlier InPhase
<lf94>
ah shit, yeah. bb...
<lf94>
oh right, yeah, no need to keep track. can just be specified
<InPhase>
Yes. sdf will definitely need bbox, but this can probably start out very large since it should be reasonably efficient to hack off outer parts.
<InPhase>
Hopefully the implementations handle that smartly.
<lf94>
For my own nodejs bindings and usage I've thought about this and it seems very difficult if not impossible to determine a bounding box for sdfs in general.
<lf94>
Only specific cases
<teepee>
for getting started, it could just be a parameter
<lf94>
yep
<InPhase>
lf94: Well for very far away the sdf function result should pretty much always be a large result that, even for deformations, approaches 0 in some sort of close to linear manner.
<InPhase>
You can measure the derivatives very trivially, and that can guide an approach toward the surfaces that skips nearly all of the large open space points.
<lf94>
InPhase: what about SDFs that create fractals and stuff
<lf94>
ok; SdfNode done. I guess I gotta find out where SurfaceNode is included next
<InPhase>
Sure, if the SDF is unbounded on its surfaces, then there is no intrinsic bounding box.
<lf94>
VisitorNode.h and CMakeLists
<InPhase>
But we can also have an auto-bbox for bounded shapes that always does the right thing.
<InPhase>
Or, like 99.999% of the time does the right thing. :)
<lf94>
It's magic: how the hell does C++ find SurfaceNode if it's not included anywhere
<lf94>
CMakeList magic?
<lf94>
I thought you had to #include still
<teepee>
no, you include the \*.h files
<teepee>
the *.cc are only mentioned in the build so CMakeLists
<lf94>
I dont see SurfaceNode.h anywhere
<lf94>
oh right
<lf94>
derrr
<lf94>
ok, building openscad fully now
<lf94>
So I should be able to do sdf() and see a cube
<teepee>
Builtins.cc cheats by declaring the function external itself
<teepee>
extern void register_builtin_surface();
<teepee>
for everything else, the LeafNode interface is enough
<lf94>
I'm just trying to copy the structure / usage of SurfaceNode
<lf94>
This is pretty cool, not gonna lie
<lf94>
That was not hard
<lf94>
So sdf() should only support function(x,y,z) specifically as a child node
<lf94>
or a function call which returns that
<lf94>
i think
<lf94>
the eager eval is messing with me
<teepee>
no child nodes I think, just 2 parameters, the distance function itself and the bounding box
<lf94>
(it'll be 3: the 3rd being resolution)
<lf94>
gotchya
<teepee>
we have $fX for resolution
<lf94>
I think it's a different kind of resolution?
<teepee>
just need some sort of translation
<lf94>
no idea
<lf94>
Do I need to specify convexity?
<lf94>
for polyset
* lf94
deletes p->setConvexity
<teepee>
likely, but that's for preview stuff, so could be ignored for a bit :)
<lf94>
Ok so next
<lf94>
I need Children explained to me
<lf94>
I think
* lf94
reads Children.h more
<teepee>
not needed for sdf()
<teepee>
it's for things like difference() { child1(); child2(); }
<lf94>
oh nice, ok
<teepee>
leaf nodes by definition have none
<lf94>
so then next question: arguments. I guess the argument will be an evaluated AST?
<lf94>
erm
<lf94>
not evaluated
<lf94>
AbstractNode that I have to traverse I guess
<teepee>
yep, just reactivate that parameters line and give it some names
<teepee>
no, I don't think so
<teepee>
for what?
<teepee>
in createGeometry you need to create that libfive oracle
<lf94>
Well I guess nothing if we're not doing function(r) function(x,y,z) stuff
<lf94>
that's a concern of mine atm
<teepee>
and the callback needs to call the function evaluation by creating a context giving x, y, z
<lf94>
but maybe, when this is done, someone can take over
<lf94>
yeah yeah
<InPhase>
lf94: function(r) does not appear to sdf.
<InPhase>
lf94: Only function(x,y,z) does.
<InPhase>
lf94: Notice the fsphere(r=4) which returns the function(x,y,z)
<InPhase>
Which is definitely going to require some instructions written out before going live. :)
banachtarski has quit [Quit: Leaving]
<lf94>
ok so fsphere is evaluated right away
<lf94>
nice
<InPhase>
Yep.
<lf94>
ok then... ok! this is great
<InPhase>
And thus it could be anything, taking any parameters, as long as it returns a function(x,y,z) with the right stuff inside for the desired effect.
<teepee>
ok, so who broke github?
<InPhase>
Microsoft.
ur5us has quit [Ping timeout: 260 seconds]
<teepee>
do they have a complain hotline?
<InPhase>
I think you're supposed to just scream into the ether.
<InPhase>
Oh. Excellent. So it was not a crazy idea.
<InPhase>
Apache is gplv3 integrateable but not gplv2 integrateable. But Doug is also a friendly, and would probably approve, if copying rather than a reference would help.
<lf94>
I mean cant really copy but yeah, use as a ref
<InPhase>
Our own code seems to be an awkward hodgepodge of gplv2 and gplv3. :) Mostly we've just ignored the formal ambiguity of this, and no one seems too concerned about the details of that.
<dTal>
so can I make a TiVo'd OpenSCAD or no
<InPhase>
dTal: You wouldn't download a car.
<teepee>
not really, core openscad code is GPL2+
<teepee>
but build result is GPL3+
<InPhase>
Oh, I guess we do have the "or (at your option) any later version" in the embedded GPLv2 license.
<lf94>
Would you guys even sue if someone didnt follow it
<lf94>
ERROR: Parser error: syntax error in file test.scad, line 3
<lf94>
There's literally just 'sdf()' in the file
<kintel>
missing semicolon?
<InPhase>
lf94: It would never amount to anything. If one contributer decided to raise a big enough fuss about license issues of any form, we could go back through the git logs and rewrite any of their contributions that are still in use.
<InPhase>
It'd probably be mostly a waste of time to do such a thing, but I'm sure that would be the end result if it was deemed something that actually needed to be addressed.
<InPhase>
As far as I know, such issues have only come up in a legal context in terms of large companies sabre-rattling against each other, or open source projects enforcing compliance against large companies.
<lf94>
hell yea!
<lf94>
ok, maybe I *can* finish this in one night
<InPhase>
lf94: It's a cube!
<lf94>
hell it's only been like what, an hour?
<InPhase>
Yeah, that was pretty fast.
<lf94>
seriously though i feel like im just being a medium here
<InPhase>
Your cube looks a bit open on one end. But it's a cube. :)
<lf94>
without you guys telling me where to look, quick explanations... i'd probably quit already
<lf94>
not because it's hard, but just the time
<lf94>
(i mean, it's hard too!)
<lf94>
ok so next: libfive side.
<teepee>
probably wrong winding order on one of the faces
<teepee>
hence the open look
<lf94>
yes
<lf94>
I literally put into chatgpt "Give me the coordinate pairs for 12 triangles of a cube"
<lf94>
so it did ok
<InPhase>
:)
<lf94>
chatgpt is just a useful autocomplete
<InPhase>
"Please read the OpenSCAD manual section on winding order and the right-hand rule, and then try again."
<joseph_>
kintel: Thank you for the code review on my 2022 GSoC PR. I will take some time to ponder possible ways to address the more involved suggestions: changing the Polygon definition and using separate VBO for marked faces. These are things I could probably accomplish before the summer, but I don't think it would be possible to do before the April 4 proposal submission deadline.
<kintel>
joseph_ Yeah, April 4 is too soon to fix stuff, I just thought I'd leave some high level comments as a start
ur5us has joined #openscad
<joseph_>
kintel: That makes sense, thank you. I will go ahead then and assemble the "detailed description" section of the proposal. For this, I can use the GitHub pull request search bar to find open PRs that may be relevant. If it's ok my inclination is to exclude WASM/GLES
<kintel>
Yeah, WASM is a tall order. There is a spec which describes how GLES and OpenGL core profiles of certain versions are compatible, so if we stick to those functions, we should get GLES compatibility for free.
<kintel>
..but you don't need to deal with GLES contexts, that's out of scope, and I hope to get that done independently
<kintel>
I think the main thing is to make sure shaders are GLES-compatible
<kintel>
InPhase The more I look at msys, the more convinced I am that "pip install" isn't going to work very well
<kintel>
msys2 ships with a lot of standard Python packages, probably because of this
<InPhase>
JordanBrown[m]: Happy weekend. Are you around?
<kintel>
..so if I just pacman install numpy and Pillow, followed by 'virtualenv --system-site-packages' , things seem to work
<InPhase>
JordanBrown[m]: We need another Windows dev to tell us if the new venv testing thing is working on their system.
<InPhase>
JordanBrown[m]: "new" from like January.
<InPhase>
guso78[m]: Wait, you also used msys2. Did you run the ctests?
fedorafan has quit [Ping timeout: 246 seconds]
<InPhase>
guso78[m]: We need another comparison point for the setups to sort out what's different between the Windows setups for testing.
fedorafan has joined #openscad
<lf94>
Ok, food has been deposited
<lf94>
time to continue this crazy journey
<lf94>
im hoping we'll having a working oracle in the next hour
<lf94>
So I take it back: seems we can copy most of what's been written. It's pretty minimal as it is
<lf94>
Ugh, it's going to be a pain understanding how to add libfive as a dependency to openscad.
<lf94>
I'm guessing I have to submodule and then do cmake magic
<lf94>
Can I just "stream << openscadValueType" ?
<kintel>
lf94: The old saying "building software is harder than writing software" strikes again : /
<lf94>
I've added the parameters: sdf, bounding_box, resolution - now it seems Parameters has a ::get that returns a Value but how can I tell what Value is?
<lf94>
kintel: it's why I avoid complex build systems like the plague
<lf94>
i really need to give ninja a try because i think it's the right solution to it all
<lf94>
When reading c++, should I only really look at .h files?
<lf94>
So far it's been the most useful vs reading .cpp files...
<kintel>
ninja just replaces Make; you still need a ninja generator, aka. CMake
<lf94>
Yes; I would promote using general programming languages to generate ninja rather than CMake and similar
<lf94>
Ok nice, so Value is pretty much any OpenSCAD value!
<lf94>
it's a build system but you use it with a language iirc
<lf94>
provides the building blocks
<lf94>
are values printable
<lf94>
how do I even tell if they are
<peeps[zen]>
yeah you should be able to use ostream operator<<
<lf94>
There's gotta be a way to go from Value -> native C++ type
<lf94>
maybe not...
<lf94>
number is probably some bignum thing
<peeps[zen]>
what are you trying to do exactly?
<lf94>
Getting libfive into openscad
<lf94>
Progress so far: sdf module is created and generating a hardcode cube
<peeps[zen]>
openscad's number type is just double
<lf94>
Ok nice - reason is I need to pass some of these values as native values to libfive
<lf94>
toDouble() seems like it
<peeps[zen]>
Look at Value.h, there is getDouble or something like that
<lf94>
yep, there, but the c++ is scary :D.
<lf94>
(honestly find it really, really dense)
<lf94>
I guess I have to do a type check before toDouble
<peeps[zen]>
since Value is a variant type, the double conversion can fail if you don't properly check the type beforehand
<lf94>
because I suck at C++ I wont check anything
<lf94>
just wanna get an MVP for the rest of you geniuses to clean up
<peeps[zen]>
lf94: toDouble expects you to know that it is a double, getDouble will do the type check and conditionally set a double param by reference, returning true if it was number type
<lf94>
ahhh, I was reading it wrong
<lf94>
I thought it takes in a double to turn into a value
<lf94>
(I know, wouldve been weird for the name)
<peeps[zen]>
to do the check yourself I think it would be: if (val.isDefinedAs(Value::Type::NUMBER))
<kintel>
lf94 Regarding build systems, everything has been tried. SCons tried to use Python as a build generator language. Every Scons config I saw was so incredibly dirty and hacky because people just wrote stream-of-consciousness Python code. CMake is still, despite its flaws, one of the better ones.
<peeps[zen]>
so when you specify cmake generator with `cmake -GNinja` , i guess that's saying "use cmake's builtin generator *for Ninja*", as opposed to saying "the generator is Ninja"?
<lf94>
yeah
<lf94>
would be ok for now for the bounding box to be [xmin,ymin,zmin,xmax,ymax,zmax] ?
<peeps[zen]>
not sure what you're asking. bounding box for what, in what context?
<lf94>
ignore the context, is the format ok you think for now
<lf94>
to specify one
<lf94>
or should it absolutely be [[],[]]
<peeps[zen]>
i think i would prefer the second
ur5us has quit [Ping timeout: 260 seconds]
<peeps[zen]>
lf94: but there are already types for representing bounding box
<lf94>
TIL you can do public: private: public: again lol.
<lf94>
Ive never seen this in any language
<lf94>
(maybe it's possible in other langs to do it, just never actually seen it done)
<lf94>
Ok, so VectorType I can just index into it...nice
<lf94>
vtmp = value.toVector(); x1 = vtmp[0]; ...
<lf94>
I know, it's not great.
<lf94>
Actually eh, I should try to get the underlying std::vector I think
<lf94>
And pass that to the oracle
<peeps[zen]>
i've worked a lot on the Value code so if anythings not clear I can try to help
<lf94>
How do I get the underlying std::vector
<lf94>
Is "using" an alias?
* lf94
asks chatgpt
<lf94>
ok, basically, yes
<peeps[zen]>
you probably don't want to access the vector directly. you would have to construct a fresh one especially if you need std::vector<double>.
<lf94>
...do I do value.toVector().ptr.vec ?
<lf94>
Yeah
<lf94>
hm
<lf94>
Why not?
<peeps[zen]>
you can use range-based-for to iterate over a VectorType
<lf94>
Seems like an unnecessary copy
<peeps[zen]>
there is also a couple convenience functions toVec3 and toVec2 iirc
<peeps[zen]>
because it is a vector of Value not doubles, and there is some added complication of embedded vector type, which allows for constant time concatenation
<lf94>
ah! ok
<lf94>
right, this makes a lot of sense..
<lf94>
Man I am _full_ of energy right now
<lf94>
Thank you a lot for the continued support here :)
<peeps[zen]>
line 203 below that: reference operator*() const { return *it; } so if you use derefgerence operator on VectorType iterator it returns type reference ( which is Value& )
<peeps[zen]>
sorry, const Value&
<peeps[zen]>
because Values are immutable
<lf94>
right
<lf94>
for(Value *val : bounding_box) { is what I wrote
<lf94>
I expect syntax errors everywhere after this
<lf94>
I'm guessing this should be for(cost Value&
<peeps[zen]>
just use auto
<lf94>
ah, yes
<lf94>
"Value::Value is private within this context"
<peeps[zen]>
289 | Value() : value(UndefType()) { } // Don't default construct empty Values. If "undefined" needed, use reference to Value::undefined, or call Value::undef() for return by value
<lf94>
> use of deleted function
<lf94>
Like what
<peeps[zen]>
lf94: Value is designed to be a move-only type, so it can't be copy-constructed
<peeps[zen]>
you likely need to add std::move, or if you really have to copy then you can call val.clone()
<lf94>
Ah! std::move
<lf94>
I thought just moving via a ref. like in rust would work
<lf94>
ok cool
<peeps[zen]>
copying is discouraged, but still technically allowed (via .clone() )
<lf94>
roger - for this, moving is sufficient I think
<lf94>
this should be the only "object" that "owns" these values
<peeps[zen]>
just be caareful not to "use after move"
<lf94>
i mean you should be able to use it after move, within the context you moved it to, no? lol
<lf94>
maybe im missing something
<lf94>
it's still saying it's deleted
<lf94>
std::move(params.get("thing"));
<peeps[zen]>
whats deleted is the copy constructor. what is params.get what type is params?
<lf94>
params is Parameters
<lf94>
and the parameter itself is a Value (right? sorry, feel like im saying the obvious)
<lf94>
cranking up the c++ heat pretty fast here guys
<peeps[zen]>
lf94: i feel like maybe you still aren't getting what the "deleted" message means. it is referring to the copy assignment operator being deleted: VectorType& operator=(const VectorType&) = delete; // never copy, move instead
<peeps[zen]>
the operator is deleted from the class interface. no Values themselves are getting deleted
<lf94>
peeps[zen]: I do; yea yea, exactly. my issue is looking over the type definitions having an effect on things :D. the types and usage are just not straight in my head.
<lf94>
I correct the other error just now, in the for iterator - it was the same issue
<lf94>
I appreciate the further explanation :D
<lf94>
And oh, I *didnt* realize it was the operator :o thank you
<lf94>
As a type declaration in a struct, am I just supposed to specify types or actual default values?
<lf94>
FunctionType sdf(a,b,c); are a, b and c types or values?
<lf94>
I dont know their values immediately
<lf94>
Is there no default initializer?
<lf94>
Maybe default Context, Expression...
<teepee>
depends on what you mean
<lf94>
Well I'm trying to do node->sdf = parameters["sdf"].toFunction(); , but the type Function sdf; (incorrectly) is declared as a class property
<lf94>
But how do I assign anything to sdf immediately if I don't know the values at all
<teepee>
you don't know the values at this point
<lf94>
I guess I assign toFunction to a temporary variable, and then initialize a new FunctionType
<teepee>
a const auto & should work I think
<lf94>
nah, complains about non-static data
<lf94>
error: non-static data member declared with placeholder ‘const auto’
<teepee>
for what code?
<lf94>
Lemme be alone with this for a bit
<lf94>
uh
<lf94>
const auto sdf&;
<lf94>
wrong order
<teepee>
yes, references always need to be initialized
<lf94>
ah, fixing the order, same error anyway lol
<lf94>
is null a valid initializer loool
* lf94
tries anyway
<teepee>
nope
<lf94>
It's not obvious how to construct a dummy context and expression
<teepee>
it's not a pointer
<lf94>
isnt there some new "nothing pointer" in c++
<teepee>
nullptr?
<teepee>
that's just a different way of writing things, I think
<lf94>
> nullptr: This is the recommended way to represent null in modern C++. It was introduced in C++11 and provides a type-safe way to represent null.
<lf94>
thanks chatgpt
<lf94>
invalid initialization of non-const reference of type ‘FunctionType&’ from an rvalue of type ‘std::nullptr_t’
<lf94>
well the error makes more sense now to me
<peeps[zen]>
its also roughly as efficient to ask cppreference.com
<lf94>
before it was like, "cant assign long int to Function&"
<peeps[zen]>
i'm haven't gone all in on the chatgpt train yet
ur5us has joined #openscad
<lf94>
for really surface level stuff, i find it's a great search engine
<teepee>
that might work for now, that's how the root context is created, not sure if that's the future proof way of doing things, but might work for now
<teepee>
ahh, redundancy department warning :)
<lf94>
Expression doesnt seem to need anything special to initialize
<lf94>
and last, argumentlist...
<teepee>
expression would be the function call
<lf94>
right ,but as a default, it'l lbe nothing
<teepee>
or to be precise I guess you need to instantiate a functioncall from the functiondefinition that should be in the AST
<lf94>
h FunctionType &sdf(Context::create<BuiltinContext>(&session), Expression(), {});
<lf94>
I'm just trying to define the property :')
<lf94>
"fparent wasnt declared in this scope"
<lf94>
gah
<lf94>
this context is actually a PITA
<lf94>
lemme see what else we got
<teepee>
yes, that's not an easy thing
<teepee>
the theory is simple but the implementation is very much complex, maybe even too much so
<lf94>
I'm gonna make a dummy Context constructor
<lf94>
for now
<teepee>
nah, just replace fparent with a fixed string
<lf94>
Is EvaluationSession session{}; a property also?
<lf94>
Why does C++ have 2 ways to construct objects? () and {}
teepee_ has joined #openscad
<teepee_>
legacy
<lf94>
ah
<lf94>
Ok the oracle... I should just keep it in this SdfNode.cc I think
<lf94>
It's going to be pretty small as we saw with curv+libfive
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
<lf94>
ok weird. I'm getting BuiltinContext missing now, after I stopped the compilation and restarted it (made a small change, forgot to be assigning bounding box values)
<lf94>
ah ok. just missing hedaer
<lf94>
gcc is saying "create<BuiltinContext>" is missing an identifier. I'm very confused
<lf94>
I see other invocations of this and they look identical
<teepee>
the ::create(.) is already a function call
<lf94>
=_= i dont follow
<lf94>
yes, it is a function call
<teepee>
it's a declaration of a member function called sdf
<teepee>
I don't think you can actually executing code at that point
<lf94>
I didnt think so x)
<lf94>
it's quite a problem
<lf94>
do I go back to the plan of "make a dummy Context constructor" ?
<teepee>
why? you only need that context when actually evaluating the function in the libfive context
<teepee>
no, just declare the built-in context as separate member object so it's created at that point
<lf94>
let me explain the problem from the beginning: I need to get the OpenSCAD Value of internal type FUNCTION into a variable to use inside create_geometry, which will then be passed to the oracle, to be evaluated
<lf94>
ok
<teepee>
yes, so you need that FunctionType sdf
<teepee>
but that stuff in (...) is in the wrong place / would be called at the wrong time
<lf94>
How the heck do I specify just a reference to the function? Earlier it said there are no valid initializers, so now I'm very very confused