<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 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>
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>
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.]
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>
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 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 ...