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
teepee_ has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
fedorafan has quit [Ping timeout: 248 seconds]
fedorafan has joined #openscad
Bocaneri has joined #openscad
Sauvin has quit [Ping timeout: 276 seconds]
Bocaneri is now known as Guest6661
rumgzy has joined #openscad
Guest6661 has quit [Ping timeout: 250 seconds]
rumgzy is now known as Sauvin
fedorafan has quit [Ping timeout: 248 seconds]
fedorafan has joined #openscad
Guest34 has joined #openscad
Guest34 has quit [Client Quit]
<linext> in some cases, manifold is so good that it can draw what the preview cannot
Guest34 has joined #openscad
Guest34 has quit [Client Quit]
Xeha has quit [Ping timeout: 255 seconds]
teepee has quit [Quit: bye...]
teepee has joined #openscad
kintel has joined #openscad
Xeha has joined #openscad
<kintel> Our Docker Hub Open Source team subscription was approved
L29Ah has quit [Read error: Connection reset by peer]
<lf94> nice!
<peeps[zen]> what does that do?
<InPhase> kintel: Really? I thought they weren't approving anybody's. That's good progress I guess.
LordOfBikes has quit [Ping timeout: 255 seconds]
LordOfBikes has joined #openscad
<kintel> It gives us free container builds. Earlier, they planned to discontinue free accounts, but they reverted that decision.
J2361 has joined #openscad
J23 has quit [Ping timeout: 260 seconds]
fedorafan has quit [Ping timeout: 248 seconds]
<gbruno> [github] kintel synchronize pull request #4576 (Refactor offscreen context management) https://github.com/openscad/openscad/pull/4576
<gbruno> [github] kintel pushed 1 modifications (Factory for NULLGL, use new namespace) https://github.com/openscad/openscad/commit/87bacd471ae3b1add5027713c76bd6ee69a5320f
<gbruno> [github] kintel pushed 10 additions 2 modifications (New offscreen classes) https://github.com/openscad/openscad/commit/b4d09b3f800d68613bf2549d8a18ac992402e943
<gbruno> [github] kintel synchronize pull request #4582 (Add new, more capable, offscreen classes) https://github.com/openscad/openscad/pull/4582
fedorafan has joined #openscad
fedorafan has quit [Client Quit]
<kintel> InPhase Re. Python for tests on msys2: I looked into it and found this in the logs:
<kintel> Found Python3: C:/hostedtoolcache/windows/Python/3.11.2/x86/python3.exe
<kintel> ..followed by
<kintel> Collecting numpy
<kintel> Downloading numpy-1.24.2-cp311-cp311-win32.whl (12.4 MB)
<kintel> Downloading Pillow-9.4.0-cp311-cp311-win32.whl (2.2 MB)
<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> ..so it looks like it's trying to build numpy from source
<InPhase> Maybe that should be in the msys2 dependencies?
<InPhase> We wouldn't need the uninstall on a clean build, so if that's the fix, just having it in dependencies should be sufficient.
linext_ has joined #openscad
linext has quit [Ping timeout: 255 seconds]
admin__ has joined #openscad
<kintel> # ./venv/bin/python3 -m pip uninstall setuptools
<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
<kintel> venv/bin/python.exe -m pip --verbose install numpy --only-binary=numpy
<kintel> ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
<kintel> Using pip 22.3.1 from C:/msys64/ucrt64/lib/python3.10/site-packages/pip (python 3.10)
<kintel> ERROR: No matching distribution found for numpy
<kintel> s/any/none
<kintel> Anyway, bedtime. Next step may be to read pip source code : /
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gknux has quit [Quit: ....and i am outta here....]
gknux has joined #openscad
TheAssass1n has joined #openscad
TheAssassin has quit [Ping timeout: 255 seconds]
LordOfBikes has quit [Remote host closed the connection]
LordOfBikes has joined #openscad
TheAssass1n has quit [Remote host closed the connection]
TheAssassin has joined #openscad
redlizard_ has quit [Remote host closed the connection]
L29Ah has joined #openscad
L29Ah has left #openscad [#openscad]
lostapathy has quit [Ping timeout: 248 seconds]
fedorafan has quit [Ping timeout: 248 seconds]
fedorafan has joined #openscad
snaked has quit [Quit: Leaving]
<J2361> hope this "libera pivoting to a discord server" is an aprils fool
<Scopeuk> Pretty sure it is, the denizens of #reprap clicked the link and seamed to be saying, yup is April fools
<Scopeuk> Also libre really exists because of a pushback against that direction on freenode :p
fling has quit [Remote host closed the connection]
fling has joined #openscad
<InPhase> kintel: Weird. It's like somehow your pip does not know its own platform?
L29Ah has joined #openscad
kintel has joined #openscad
castaway has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
<gbruno> [github] kintel opened pull request #4585 (Test using msys2 python for tests) https://github.com/openscad/openscad/pull/4585
<gbruno> [github] kintel pushed 1 modifications (Test using msys2 python for tests) https://github.com/openscad/openscad/commit/aec046e8fa68ebe69c8a09feb9e0a47716cedb54
<gbruno> [github] kintel edited pull request #4585 (Test using msys2 python for tests) https://github.com/openscad/openscad/pull/4585
<kintel> InPhase I noticed that we're using both FindPythonInterp and FindPython3, and they seem to find different Python installations.
<kintel> Trying to harmonize in https://github.com/openscad/openscad/pull/4585 to see if I discover anything
<InPhase> kintel: Hmm.
lostapathy has joined #openscad
<gbruno> [github] kintel pushed 1 modifications (mingw fix) https://github.com/openscad/openscad/commit/bf2f361d70dd0b275b5aa8dfebbb85faf94739a5
<gbruno> [github] kintel synchronize pull request #4585 (Test using msys2 python for tests) https://github.com/openscad/openscad/pull/4585
fedorafan has quit [Ping timeout: 252 seconds]
fedorafan has joined #openscad
Guest7068 has joined #openscad
<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
<teepee> or Makefile like the image generation for the website - https://github.com/openscad/image-generator/blob/main/Makefile
<teepee> Guest7068: we can help setting something up if you share some details
<teepee> InPhase: I wonder if that could be an issue with a bounty, documenting that for the 3 main platforms with a couple of examples
<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> teepee: +b *!*@38.54.93.*
<kintel> Python/msys2: In my test PR, I'm using FindPythonInterp everywhere: https://github.com/openscad/openscad/pull/4585
<peeps[zen]> "Visual C++ 6.0 (commonly known as VC6), which included MFC 6.0, was released in 1998"
<kintel> ..and the CI now behaves the same as for my local build
<kintel> -> so the difference was really between finding msys2 python vs. a natively installed Windows Python
<teepee> ndnihil: why? who?
<ndnihil> chimpout bot, spamming a bunch of shit
<teepee> oh, in other channels?
<ndnihil> other channels, other networks
<peeps[zen]> I can't remember does MSYS2 use a CMAKE_TOOLCHAIN_FILE ?
<ndnihil> but it's here on libera as well
<ndnihil> making its rounds
<InPhase> kintel: Sounds great! But I have some bad news for you. https://cmake.org/cmake/help/latest/module/FindPythonInterp.html
<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> $ openscad -o - examples/Functions/functions.scad
<lf94> I must be missing something
<teepee> yes export format echo
<lf94> A --headless option would be nice
<lf94> or something similar
<lf94> function f(x) = 0.5 * x + 1;
<lf94> f(4);
<lf94> It thinks f is a module?
<lf94> > WARNING: Ignoring unknown module 'f' in file functions.scad, line 2
<teepee> yes, statements are module calls only
<teepee> for producing geometry
<lf94> ah. must surround in echo()
<teepee> functions can only appear in assignments or as parameter
<teepee> well expressions
<lf94> gotchya
<teepee> which include function calls
<lf94> sdf() needs to pass source code to libfive oracle, which is going to call the openscad evaluator...
<lf94> are functions always pure?
teepee_ has joined #openscad
<lf94> i.e. cant have a variable defined outside them
<guso78[m]> is source code still available at this stage after parse, or would you need to encapsulate into strings ?
<lf94> I guess if a function depends on variables, I need to pull in those variables also to send to the oracle
<lf94> Ah true, yeah, most likely it's some AST
<teepee_> no, functions capture the context and they are in the AST
<lf94> ok perfect
<teepee_> the sdf() AST node has references to the paramters which would be of type function
<guso78[m]> teepee, did you by chance find your intended sdf page with the rabbit ?
teepee has quit [Ping timeout: 255 seconds]
teepee_ is now known as teepee
ur5us has joined #openscad
<lf94> Gonna read echo() module as a place to start learning how modules are coded
<lf94> src/core/control.cc:256: Builtins::init("echo", new BuiltinModule(builtin_echo),
<lf94> src/core/parser.y:318: | TOK_ECHO { $$ = strdup("echo"); }
<lf94> Guess I gotta add sdf to parser.y
<lf94> Is this a yacc file or something
<teepee> guso78[m]: I'm like 50% convinced it's the one I posted, I did not find anything else yet
<lf94> What are other module identifiers?
<lf94> Why is for, let, echo, each special
<guso78[m]> great info, thanks! the one is actually (more than full) of valuable information :)
<teepee> because of their chaining syntax
<teepee> maybe look at SurfaceNode and ignore all the file handling stuff
fedorafan has quit [Ping timeout: 252 seconds]
<lf94> I don't get how this helps
<teepee> it's much more similar to what sdf() would be
<lf94> Dont have to add new parser machinery?
<teepee> a LeafNode
<lf94> Ah
<teepee> something generating geometry from external sources
<lf94> Guess I'm calling this SdfNode
<teepee> no, no need for parser changes, just something like register_builtin_surface() at the end of SurfaceNode.cc
<teepee> that registers the name "surface" calling the function for creating the AST node
<lf94> this is perfect
<lf94> So this should allow exactly one specific module as a child: function
<teepee> so maybe just start with a copy of SurfaceNode and remove all the image stuff and create just a cube geometry in the createGeometry()
<lf94> My god C++ is impossible to read
<lf94> Yeah doing exactly this :)
<lf94> way ahead
<teepee> go on then :)
fedorafan has joined #openscad
<lf94> > PolySet(3) < but appends 4?
<guso78[m]> 3 is 3 dimenional
<lf94> PolySet::PolySet(unsigned int dim, boost::tribool convex)
<lf94> Is convex defaulted somewhere?
<lf94> C++ is confusing as hell
<guso78[m]> there are also 2d shapes also
<lf94> So you push a poly, then add the vertices
<lf94> ok, this PolySet class is pretty nice / easy to work with
<lf94> almost done the cube
<lf94> Parameters parameters = Parameters::parse(std::move(arguments), inst->location(), {}, {});
<lf94> For something with no parameters right
<lf94> (no required or optional)
<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
<lf94> Ah, missed the builtin
<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.
<teepee> 2023-04-01T21:00:45.000+02:00 openscad 2552404 pending "openscad","openscad.github.com","openscad-documentation"
<guso78[m]> whats broken with github ?
<teepee> asked for backup an hour ago, still "pending"
<lf94> i bet the rsa key change broke so many things
<teepee> yeah, but that's a rest api, so no impact on that one
<lf94> I can use curv as a base for this
<lf94> since curv did libfive oracle
<teepee> oh, nice
<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> whelp guess this failed
<lf94> $ ./openscad --export-format echo -o - test.scad
<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.
<lf94> ok cool, so that worked at least
<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.
<gbruno> [github] kintel synchronize pull request #4585 (Test using msys2 python for tests) https://github.com/openscad/openscad/pull/4585
<gbruno> [github] kintel pushed 4 modifications (Use FindPython3, pacman install python deps) https://github.com/openscad/openscad/commit/47cd3f74fe5cc41916f69d6198f93badc2117f02
<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> undefined, bool, number, string, vector, embedded_vector, range, function, object
<peeps[zen]> i thought ninja *was* the generator
<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> gotchya
<lf94> it's for the sdf module - i.e. sdf([x1,y1,z1,x2,y2,z2], 1.0, function(x,y,z) ...)
<lf94> gonna keep it this way for now
<peeps[zen]> is that shader code?
<lf94> it's openscad code :D
<peeps[zen]> ok, gotcha
<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 :)
castaway has quit [Ping timeout: 265 seconds]
<lf94> does the iterator return Value or &Value
<lf94> or whatever
<lf94> you get what i mean
<lf94> i'd expect a ref
<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"
<lf94> my god these errors are huge
<peeps[zen]> see some of the vector multiplication functions for examples of dealing with vectors of numbers https://github.com/openscad/openscad/blob/master/src/core/Value.cc#L917-L925
snaked has joined #openscad
<peeps[zen]> ^ that's vector * scalar another example, vector dot product: https://github.com/openscad/openscad/blob/master/src/core/Value.cc#L980-L990
<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> Value& operator=(const Value& v) = delete; // never copy, move instead
<lf94> Interesting
<lf94> Cool way to enforce :)
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
<lf94> going to break this into two lines, maybe that'll help
<lf94> nope, it *always* says its deleted. doesnt .get always delete it then?
<lf94> from the code it looks like it always calls delete
<lf94> lemme see what other modules do...
<lf94> they immediately cast...
<peeps[zen]> what type is sdf supposed to be
<lf94> Function
<lf94> OpenSCAD Function type
<lf94> so a Value of internal type FUNCTION
<lf94> (sorry, trying to be specific)
<lf94> I then need to pass this to the libfive Oracle, which will run the OpenSCAD evaluator
<lf94> Potential oversight in the design of Value move semantics?
<peeps[zen]> Yeah, so probably should declare it as: Value::FunctionType sdf;
<teepee> why would you need to pass it?
<teepee> the callback would have a reference to the sdf AST node, no?
<teepee> so whenever it's called it can call something like node->expr->evaluate()
<lf94> haha, i get what you're saying
<lf94> that's a good idea
<peeps[zen]> so you could then do: node->sdf = parameters.get("sdf").toFunction();
<lf94> wait no
<lf94> teepee: cant just eval like that i think. libfive passes in x,y,z points
<peeps[zen]> because FunctionType's copy assignment function is *not* deleted i think
<lf94> peeps[zen]: exactly what i need!
<lf94> perfect
<teepee> yes, you need an evaluationcontext which will have the calling parameters
snakedGT has joined #openscad
<lf94> /home/lee/other/openscad/src/core/SdfNode.cc:61:10: error: ‘FunctionType’ in ‘class Value’ does not name a type
<lf94> Ah
<lf94> It's elsewhere I think
<lf94> Yeah
<lf94> It's its own thing
<peeps[zen]> ah, yeah its just class FunctionType, not under Value namespace, i think that was a recent change
<guso78[m]> src/core/Value.h:class FunctionType ...
snaked has quit [Ping timeout: 250 seconds]
<lf94> guso78[m]: old code i think
<lf94> as peeps said
<lf94> ok getting the delete function for toVector() also
<guso78[m]> lf94, not sure, i regularly merge master
<lf94> auto bounding_box_tmp = parameters["bounding_box"].toVector();
<lf94> guso78[m]: what line? :)
<guso78[m]> here its line 260
<peeps[zen]> const auto &bounding_box_tmp = ...
<guso78[m]> but here there might be other items merged in(not sure)
<lf94> 260 is "class ObjectType" for me
<lf94> (actually it's a blank line then that)
<peeps[zen]> guso78[m]: FunctionType was moved into its own source file in current master. https://github.com/openscad/openscad/blob/master/src/core/FunctionType.h
<lf94> peeps[zen]: ho ya :D all riiight
<lf94> ok last error! wahooo
<lf94> error: no matching function for call to ‘FunctionType::FunctionType()’
<lf94> I dont get it because I dont call it
<lf94> I assume it's talking about toFunction()'s use of it
<InPhase> FunctionType foo(context, expr, parameters)
<lf94> ohhhh
<lf94> I have to specify some type parameters
<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
<gbruno> [github] kintel pushed 1 modifications (More Python3 adjustments) https://github.com/openscad/openscad/commit/19ae7c66e7e359e6b7201df00f7a2b7d1c91f982
<gbruno> [github] kintel synchronize pull request #4585 (Test using msys2 python for tests) https://github.com/openscad/openscad/pull/4585
<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
<lf94> well i feel stuck now
<lf94> the breaks are on
<teepee> ContextHandle<Context> let_context{Context::create<Context>(context)};
<teepee> something like that
<peeps[zen]> *brakes :P
<lf94> ok, nice
<lf94> ill be taking breaks now too if i cant keep the steam going B)
<teepee> we may need some new way of constructing a new context
<teepee> as normally the top level one is a FileContext
<lf94> something something clone and assign to non-const value
<lf94> ‘const class FunctionType’ has no member named ‘clone’
<lf94> blah
<lf94> gotta be some more direct way to get at the function type.
<lf94> ok no. you're right. we have to just find the easiest ways to initialize these arguments.
<teepee> EvaluationSession session{fparent.string()};
<teepee> ContextHandle<BuiltinContext> builtin_context{Context::create<BuiltinContext>(&session)};
ur5us has quit [Ping timeout: 250 seconds]
<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> rather: will it be one
<teepee> it's the folder name
<lf94> holy shit it worked
<lf94> hahaaa
<lf94> EvaluationSession session{"openscad-is-cool"};
<lf94> FunctionType &sdf(Context::create<BuiltinContext>(&session), Expression(), {});
<teepee> yes, member of the orcale class :)
<lf94> So this isnt too bad in the end
<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
<lf94> src/gui/MainWindow.cc:1232: ContextHandle<BuiltinContext> builtin_context{Context::create<BuiltinContext>(&session)};
<teepee> you included BuiltinContext.h?
<lf94> Yeah
<lf94> lemme send the file over.
<lf94> slap it into src/core/
<lf94> maybe it's time to create a fork
<teepee> oh, that's in the declaration?
<lf94> yeah...
<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
<lf94> (no valid inits for FunctionType)
<teepee> maybe add to the SdfNode constructor