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
snaked has joined #openscad
<InPhase> Yay, ice skater live. And the slightly wider video aspect ratio worked out okay.
<teepee> icy colored ice skater :)
<InPhase> :)
<InPhase> Makes sense, since his feet are blades...
<teepee> good thing he's not from here, or he would be a water colored puddle on the floor ;-)
<InPhase> There was a math defect on the slowing and starting. I fixed it up for the slowing down bit today, but then decided to keep it on the starting portion. It gives him a sort of faster jolt which I think looks right for pushing off rapidly.
<InPhase> Happy little accidents.
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
TheAssassin has quit [Remote host closed the connection]
LordOfBikes has quit [Ping timeout: 245 seconds]
LordOfBikes has joined #openscad
arebil has quit [Quit: arebil]
TheAssassin has joined #openscad
<pca006132> storing the number as typed in the AST should not be hard
<pca006132> probably not now as I am busy with other parts, it should be easy to change later, will add a TODO
J23k59 has joined #openscad
J23k28 has quit [Ping timeout: 250 seconds]
mmu_man has quit [Ping timeout: 252 seconds]
kintel has joined #openscad
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kintel has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 240 seconds]
teepee_ is now known as teepee
<pca006132> found that https://github.com/rsheldiii/KeyV2 really stresses the renderer hard
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pca006132> in particular, the preview for examples/sa_ergo.scad has really low FPS for preview regardless of whether VBO is enabled or not
<pca006132> the preview is maybe 1s faster than manifold render (5s vs 6s), but the FPS with a mesh is much better (with lower GPU utilization)
<pca006132> just found a really nice property for openscad: there is no way of dropping or copying geometries, copying is just a potential optimization
<pca006132> so I don't have to think about how to let the library user pass in a destructor for geometries
guso78k has quit [Quit: Client closed]
drfff has joined #openscad
J23k59 has quit [Quit: Client closed]
J23k59 has joined #openscad
guso78k has joined #openscad
<JordanBrown> InPhase skater looks great!
<guso78k> Yeahh i like it too!
<gbruno> [github] gsohler synchronize pull request #4841 (Squashed commit of python_pr3) https://github.com/openscad/openscad/pull/4841
<guso78k> JordanBrown, i am still hoping beeing able to fix my cube issue without having the clone the tree. somewhere the code transforms the one  cube while it is used in 2 places
<JordanBrown> I didn't try to track down why that "index" field needed to be unique... only that it did. I agree that it seems like you should be able to splice together a DAG and it should work.
<guso78k> i tried to give the cloned node handle an unique index, but there was no effect, I really believe its for debugging purposes only and  i actually use it in the python __repr__ function
<JordanBrown> I think every element in the subtree needs a unique index, so when you place a subtree into the main tree twice you need two copies of each node with different indexes.
<guso78k> JordanBrown, that makes sense, but i am absolutely stumbled about the fact, that it does correct  with F6. In Preview mode there are "*too*" many optimizations  and i could not yet find the place
<JordanBrown> Don't know. Remember that the two use entirely different algorithms, top to bottom (excluding render() of course). Maybe F5's algorithms need it and F6's don't.
<guso78k> i would immediately resuse the clone code. but i am still hesitant to use the cloneOne functions each for all the derivates.  c++ does not provide something more clever(like virtual, pure, abstract method)  ?
<JordanBrown> Or maybe that was just a red herring and something else that I did in cloning the subtree was what really made it work.
<JordanBrown> I don't immediately remember why I felt the need for so many instances of cloneOne.
<JordanBrown> Note also that although I have tons of experience with C, I'm really a C++ newbie.
<JordanBrown> I see that in my PR notes on outstanding internal issues I wrote:
<JordanBrown> XXXNode::cloneOne() is tedious and repetitive; I bet that it could be done better, perhaps with templates.
<guso78k> this  cloneOne definitely pushes your number of changed files above 100 ...  which makes it somehow unattractive ... '=D
<guso78k> i would prefer  to see it coded in a more intelilgent way(each new node also has to do the clone too) but i am absolutely not an expert with andvanced c++)
<JordanBrown> (Having refreshed my memory...) the reason that there needs to be a per-class cloneOne() is that it needs to make a new object of *that* class. Maybe there is a way to say "make a new one of whatever I am", but if there is then I have no clue what it is.
<pca006132> iirc no, there is no simple way of doing that without crazy metaprogramming
<pca006132> that is why rust provides things like automatic clone, debug repr implementations that allows you to use for objects...
<guso78k> JordanBrown yes,  this is what i thought too, maybe its possible with somehow virtual functions, using the morphing ability of derived classes ?
<JordanBrown> Are classes first-class in C++? Can you put some kind of reference to a class into a variable, and then use that reference to construct a new object of that class? You can do that with JavaScript...
<pca006132> no
<pca006132> well you can do something simple if you just need to construct a new object
<JordanBrown> ?
<guso78k> yes, that the new object would have the same parameters and childs like the original object
<pca006132> what is the type? are you wrapping them inside a pointer or something?
<guso78k> maybe we could do it in a smart way just by using a preprocessor #define in a smart location ?
<pca006132> you can do stuff like a virtual copy function that returns a std::shared_ptr<BaseClass>, implement it for every class
<JordanBrown> Yes, one could certainly have a macro that expanded to a definition of cloneOne.
<JordanBrown> pca006132 you just described cloneOne() :-)
<guso78k> all the objects derive the AbstraceNode and almost all derivations look similar
<pca006132> oh, there is no simpler way in c++, unfortunately
<pca006132> you need code generator or cursed preprocessor hack
<pca006132> there is class reflection that allows you to get field names and such, but it is c++20
<pca006132> and I am not even sure if you can implement cloneOne with that...
<guso78k> maybe the hack could look like "CLASS polyNode"  instead of "class polyNode"  :')
<JordanBrown> cursed and clever are almost the same word. They both start with "c" and have six letters. And have c, e, and r.
<JordanBrown> Nah, it'd be something like
<pca006132> no, you are underestimating the amount of hack you need
<pca006132> it will probably be something like c++ template + macro
<JordanBrown> #define DECLARE_CLONEONE(t) std::shared_ptr<AbstractNode>t::cloneOne() const { return std::make_shared<t>(*this); }
<guso78k> (y)
<JordanBrown> Or a little different if you intend it to go into the header file instead of into the cc file.
<guso78k> yes, and you just need to put this in a smart way, so its automatically applied when deriving from AbstractNode
<JordanBrown> While that might be possible, it exceeds my C++ knowledge. The one I gave reduces it to one line and two symbols per class, and I'm reasonably happy with that.
<guso78k> iirc reflect was something in Android where you can do nasty things to internals. apparently it exists in c++ world, too
<JordanBrown> I was scared by Java RMI as a child and so am automatically averse to any kind of automated serialization / deserialization.
<JordanBrown> (I think I was a child of 35 or so :-)
<JordanBrown> I asked the team using it whether a v2 client could talk to a v1 server (or vice versa) and their answer was "oh, of course not, the method signatures and data structures have all changed".
<pca006132> I think the one in c++ is compile-time reflection
<pca006132> java RMI is runtime
<pca006132> if I remember correctly
<JordanBrown> I am sure that it is possible to use such a thing safely, but I suspect that it requires serious care.
<pca006132> compile-time reflection is generally safer
<JordanBrown> For this purpose I don't think it mattered.
<pca006132> true
<JordanBrown> What you would want is a construct like "new (classOf(this))(this)".
<guso78k> in python this is just var.__class__()
<guso78k> just used it yesterday
<JordanBrown> In JavaScript it would be something like "new (this.constructor)(this)"
<guso78k> or just do new AbstractNode() and update VTABLES after
<guso78k> sorry, just kidding '=(
<JordanBrown> Anyhow, it's past my bedtime.
<guso78k> JordanBrown am sure you get a brilliant idea during night-time
<JordanBrown> G'nite.
arebil has joined #openscad
misterfish has joined #openscad
lastrodamo has joined #openscad
TheAssassin has quit [Quit: No Ping reply in 180 seconds.]
TheAssassin has joined #openscad
cart_ has joined #openscad
<guso78k> it just does not display correct, if one tree is a matching subtree of the other. the subtree will show incorrectly in preview mode
cart_ has quit [Ping timeout: 245 seconds]
misterfish has quit [Ping timeout: 252 seconds]
misterfish has joined #openscad
foul_owl has quit [Ping timeout: 255 seconds]
cart_ has joined #openscad
erectus has quit [Ping timeout: 240 seconds]
erectus has joined #openscad
pah is now known as pa
mmu_man has joined #openscad
erectus has quit [Ping timeout: 240 seconds]
erectus has joined #openscad
mmu_man has quit [Ping timeout: 255 seconds]
mmu_man has joined #openscad
guso78k has quit [Quit: Client closed]
misterfish has quit [Ping timeout: 252 seconds]
mmu_man has quit [Ping timeout: 264 seconds]
guso78k has joined #openscad
kintel has joined #openscad
<kintel> Re. https://github.com/openscad/openscad/issues/4897 does anyone have a good idea how i18n works, and could have a look? Might be an easy fix
mmu_man has joined #openscad
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arebil has quit [Quit: arebil]
kintel has joined #openscad
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
little_blossom has quit [Quit: little_blossom]
snaked has quit [Quit: Leaving]
JakeSays has joined #openscad
<teepee> uh, that old macos bug again :(
<teepee> IIRC translations marked as fuzzy are not going to be compiled into the binary files that are used at runtime, so those are only visible to the translator not the application user
cart_ has quit [Ping timeout: 264 seconds]
SamantazFox has quit [Quit: Bye]
misterfish has joined #openscad
fling_ has joined #openscad
fling has quit [Ping timeout: 240 seconds]
fling_ is now known as fling
teepee_ has joined #openscad
teepee has quit [Ping timeout: 240 seconds]
teepee_ is now known as teepee
kintel has joined #openscad
<kintel> teepee It kind of feels like it falls back to the next translation the user's list of preferred languages
<kintel> I remember there was some old stuff related to that, but forgot the details
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kintel has joined #openscad
<kintel> guso78 Node indexes being unique per tree is kind of a hard limitation. In Python it looks like you'd like to reuse the same ModuleInstantiation multiple times, which is going to be kind of tricky..
<kintel> Otoh, OpenSCAD _could_ probably employ common subexpression elimination by decoupling the node instances from ModuleInstantiation, and cache the actual node instances instead. That's a bit of a deep refactoring, but doing smth. like that could make the python stuff a bit more convenient to implement..
<kintel> I guess deep-cloning nodes should work too, but the easiest may be to create a visitor for it and re-build nodes based on the existing moduleinstantiation, to make the index auto-increment.
arebil has joined #openscad
<pca006132> why do we have unique node indices?
<pca006132> is it a key for cache?
guso78k62 has joined #openscad
<kintel> pca006132 Yeah, but that's probably easy to rewrite
mmu_man has quit [Ping timeout: 276 seconds]
<pca006132> I think we want something like hash consing, not this unique index...
<kintel> It's also used in object picking by converting indexes into a unique color, which allows us to map from rendered pixel to node
<guso78k62> so going for the visitor or for deep-copy ?
<pca006132> oh
<kintel> ..the picking could be rewritten as a CSG tree traverser though, but the current implementation is image-based
<kintel> guso78 Ideally, refactor away the index stuff, but that's easily a multi-month effort
<kintel> Visitor might be the least intrusive solution for now.
<guso78k62> doubt that anybody here has a concept, how to implement deep-copy without changing 100+ files ?
<kintel> yeah, with a visitor, you'd put all of that in a single class
<kintel> ..but I'm uncertain if the node API is good enough
<guso78k62> kintel, i have seen visitor a lot in the code, but i don't understand at all. could  anybody explain that with easy words to a dummy ?
<pca006132> it means that your visitor function will be called in every single node
<pca006132> and you can do a long list of dynamic cast to figure out which kind of node you are in...
kintel has quit [Quit: Textual IRC Client: www.textualapp.com]
kintel has joined #openscad
<guso78k62> abstract node defines visitor, visitor is derived in each class and has correct "type"for copying then ?
<pca006132> I don't think you can derive the visitor in each class... let me check
<kintel> The technique used is called "double dispatch". C++ doesn't implement this, but that's what the visitor stuff does
<guso78k62> but i understand now: you can maintain the long list in one place, but you have to touch it each time, when you add a new node
<guso78k62> will watch later, kids are crying
<pca006132> yes, it just means that you moved the pain from one part to another part :)
<pca006132> but at least they are not scattered around
<kintel> ..plus we hide the huge switch statement from user code :)
<kintel> Anyway, look for stuff inheriting from NodeVisitor
kintel has quit [Quit: Textual IRC Client: www.textualapp.com]
mmu_man has joined #openscad
teepee has quit [Quit: bye...]
teepee has joined #openscad
kintel has joined #openscad
<kintel> pca006132 I'll take a look at KeyV2 performance. I'm very close to having some scripted benchmarks going..
mmu_man has quit [Ping timeout: 268 seconds]
<kintel> pca006132 "preview for examples/sa_ergo.scad has really low FPS" - what is "really low" in this case?
<kintel> I get around 10 FPS if I enable the three main VBO settings
<kintel> (vertex-object-renderers, vertex-object-renderers-direct, vertex-object-renderers-prealloc)
<pca006132> is there a good way to show FPS?
<kintel> You should really always enable those 3, as using just one of them will make some GL drivers struggle
<kintel> No, I just estimate
<kintel> In my benchmarks, I patch OpenSCAD to render a number of frames to get a better idea
<pca006132> my tracy pr has this but I need to compile it again
<pca006132> give me a few minutes
<kintel> In terms of F5 vs. F6 - once manifold performance starts closing in on preview performance, we're left with colors being the main differentiator. I wonder how we can implement colorful previews mixed with manifold rendering.
<pca006132> you need vertex properties
<kintel> I was thinking about doing opportunistic geometry evaluation, and only perform the remaining unions/intersections once we want a single geometry. ..unless we can get manifold to track and maintain surface attributes..
<pca006132> manifold does track that
<pca006132> well not general surface attributes, just vertex ones iirc
<kintel> really? that would be so cool to implement in OpenSCAD
epony has quit [Remote host closed the connection]
<kintel> I need to dig myself out of the VBO project soon, so I can play with that!
<pca006132> and manifold provides OpenGL friendly output format
<pca006132> a flattened array
J23k59 is now known as J24k
<J24k> happy solstice
<pca006132> I think you can look at the manifoldcad source code and try to figure them out, or ask in the discussion part of manifold
<pca006132> I think there are still some issues with vertex properties, https://github.com/elalish/manifold/issues/536
<pca006132> frame time with VBO on: ~140ms
<pca006132> I just enabled everything with VBO in the name
<kintel> that's probably in the same ballpark as for me.
<kintel> With VBO off, it's more like 5 seconds per frame
<kintel> No good way around that, as it's a complex CSG tree; each key explodes into 7 CSG products
<pca006132> true
<pca006132> but I guess it is something good for benchmark, idk
<pca006132> I probably need to sleep now, I am getting a bit sick looking at things with low FPS
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
mmu_man has joined #openscad
teepee has quit [Ping timeout: 240 seconds]
teepee has joined #openscad
<pca006132> and I added async stop function to the bytecode vm, so users can stop it from another thread. there is virtually no overhead from that relaxed atomic boolean load (in part due to good branch prediction because it is basically never triggered)
<guso78k62> pca006132 not trying the double dispatching now.
<guso78k62> not->now
xtore is now known as extor
teepee has quit [Ping timeout: 240 seconds]
teepee has joined #openscad
<guso78k62> dynamic_pointer_cast<CubeNode> not declared ?!?
mmu_man has quit [Ping timeout: 260 seconds]
<kintel> guso78k62 In what context? CubeNode is just a regular class..
<guso78k62> kintel found the solution,  dynamic_pointer_cast only works for smart pointers ...
<guso78k62> progressing slowly
<kintel> only shared pointers I think
mmu_man has joined #openscad
<guso78k62> something like this, but i am not yet happy
<guso78k62> -> wondering, if cube has no copy constructor
<guso78k62> -> want to combine const Cube *cube with if in one line(make assignment inside it) but it does not work
<t4nk_fn> teepee, the reason I started messing around with freecad.. was to be able to quickly add a few fillets and chamfers here and there
<teepee> sure, why not. use the tools you got, especially if they are open source
<t4nk_fn> I feel much more comfortable working with openscad if I 'design' something
<teepee> I sure hope we can get some easier fillets/chamfers with Manifold at some point
<teepee> I did not have the time to have a look in any shape or form, but my understanding is that it's possible to find out where 2 shapes meet
<t4nk_fn> been looking around for possibilities (again) in the past few days, but it's complicated to say the least
<teepee> so that could be used as dedicated chamfering point not just the unwieldy minkowski() even though that's still very useful :)
<teepee> well, the easiest way is likely BOSL2 :)
<teepee> I tend to use 2D a lot where offset() can do the chamfers
<t4nk_fn> heh, I only discovered BOSL yesterday or so
<teepee> e.g. for that https://imgur.com/a/dDX8zLF
<teepee> old version used a library (round-anything) but turns out that's not even needed :)
<t4nk_fn> yeah, I saw that.. was hoping you had printed the switches too though :b
<t4nk_fn> but uh, that rendering time is a huge factor too, still, though
<t4nk_fn> I'll get things wrong more often than not, so at that point most of the time is spent waiting
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<t4nk_fn> I guess it would help if you knew the entire design in advance so one could take it into account and there would be no need
<t4nk_fn> but the problem is that you're always left with things you need to add afterwards
<teepee> with the latest version, I don't have much cases where it actually needs a waiting time
<teepee> but then most of my models are not hugely complicated
foul_owl has joined #openscad
foul_owl has quit [Ping timeout: 245 seconds]
<gbruno> [github] thehans closed issue #4897 (little bug with french version on version 2023.12.11 (git 3d094bf87)) https://github.com/openscad/openscad/issues/4897
foul_owl has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 240 seconds]
teepee_ is now known as teepee
JakeSays has quit [Ping timeout: 256 seconds]
misterfish has quit [Ping timeout: 264 seconds]
JakeSays has joined #openscad
lastrodamo has quit [Quit: Leaving]
<guso78k62> clone is working, will be quite some effort to do it for all Nodes ;)
JakeSays_ has joined #openscad
JakeSays has quit [Ping timeout: 252 seconds]
mmu_man has quit [Ping timeout: 268 seconds]
little_blossom has joined #openscad
mmu_man has joined #openscad
Guest43 has joined #openscad
Guest43 has quit [Client Quit]
luigiamorfini has joined #openscad
luigiamorfini has quit [Client Quit]
luigi-amorfini has joined #openscad
epony has joined #openscad
luigi-amorfini has quit [Quit: Client closed]
<gbruno> [github] gsohler synchronize pull request #4841 (Squashed commit of python_pr3) https://github.com/openscad/openscad/pull/4841
<gbruno> [github] gsohler synchronize pull request #4841 (Squashed commit of python_pr3) https://github.com/openscad/openscad/pull/4841
<gbruno> [github] gsohler synchronize pull request #4841 (Squashed commit of python_pr3) https://github.com/openscad/openscad/pull/4841
guso78k62 has quit [Ping timeout: 250 seconds]
guso78k has quit [Ping timeout: 250 seconds]
arebil has quit [Quit: arebil]
snaked has joined #openscad