<InPhase>
linext: OpenSCAD open uses the correspondence between the triangle count and the file size to detect if it's a binary file.
<InPhase>
If it fails that check, it tries ascii, and if it fails that, it reports it cannot read the stl.
<InPhase>
Which is in fact a logical thing to do, because there is nothing at else specified for the binary stl file that you can check. The header is completely arbitrary, and for the rest, the most you could do is check to see if they are non-nan floats and then check to see if it produces something manifold, but that's a pretty high level check which will fail on some stls anyway.
<InPhase>
Oh, and I guess check to see if the file size has the right multiples of those 14 or whatever bytes.
<InPhase>
But that's a much weaker check than the size check, which should rarely be right by coincidence.
<InPhase>
linext: Consequently, I set OpenSCAD to issue an error if the binary stl output triangle count exceeds 2^32-1. But... for good luck to the users, I also set it to complete the export, and store a modulo of 2^32 for the file size.
<InPhase>
I figure that's the best you can do, and in theory you could check for a modulo if we ever needed to support huge stl files and hadn't moved on to another file format.
<InPhase>
Currently OpenSCAD will not import files it exports in this scenario. I don't know if anything else would either, as that's outside of the specification.
<InPhase>
But, the error says "the stil file is not valid". *shrug*
<linext>
hmm...
<linext>
good info
<linext>
i had a problem with the web assembly version of openscad where it wouldn't allow importing any binary STL files
<linext>
not sure if it's a good idea to block a file if the triangle count doesn't match the body
<linext>
InPhase, i ended up writing a quick binary to ascii converter to get import() to work in web assembly
<linext>
i gave a presentation / demo at a new jersey makerspace on openscad web assembly and my web app
<linext>
went better than the zoom startup meetup where they didn't know what i needed, and neither did i
<linext>
old style javascript is kind of weird, with no thread-safety
<JordanBrown[m]>
I'm not sure about new-style JavaScript, but old-style JavaScript doesn't have thread safety because it doesn't have threads.
<linext>
await and async help in the new style javascript
<linext>
threads can be simulated by polling
<linext>
setInterrupt and setInterval
<linext>
setTimeout* and setInterval
LordOfBikes has quit [Ping timeout: 256 seconds]
<InPhase>
linext: Well you'll appreciate blocking the file when the triangle count doesn't match the body the next time you try to import a png as a binary stl, or something like that. :)
<InPhase>
Because the alternative is probably a polyhedral pandemonium of literal astronomical proportions. ;)
<linext>
yes, it would be interesting to import something like that
<linext>
i found that binary files import() just fine in OpenSCAD
<linext>
but fail in web assembly
<linext>
it's really hard to track down what causes a crash in web assembly
snaked has joined #openscad
LordOfBikes has joined #openscad
<JordanBrown[m]>
linext Indeed you can get thread-like behavior, but it's single-threaded between calls to async functions. (And you could do the same things in old-style JavaScript too... it was just harder.)
ndnihil is now known as nihil
nihil is now known as ndnihil
<InPhase>
linext: Is it ALL binary file types?
<InPhase>
linext: If so, then you definitely have something like an upstream line-ending conversion issue.
<InPhase>
The insertion of a single \r in a binary stl, such as after the "OpenSCAD Model\n" in the header, will break the whole thing catastrophically.
<InPhase>
You'd be able to tell if you inserted the right checks though, because the file size OpenSCAD sees would be greater than the starting file size.
<InPhase>
There are approximately only two places where \n\r is still used, one being the default for Windows, and the other being http.
<peepsalot>
CRLF = \r\n
<InPhase>
Right, that.
<InPhase>
I've been trying for years to block the abomination from my memory. Half successful I guess. :)
Junxter has joined #openscad
ur5us has quit [Ping timeout: 260 seconds]
J1A8481887091 has joined #openscad
J1A84818870 has quit [Ping timeout: 260 seconds]
guerd871 has joined #openscad
guerdy has quit [Read error: Connection reset by peer]
ur5us has joined #openscad
rogeliodh has quit [Quit: Ping timeout (120 seconds)]
peepsalot has quit [Quit: Connection reset by peep]
peepsalot has joined #openscad
ur5us has joined #openscad
ali1234 has quit [Remote host closed the connection]
ali1234 has joined #openscad
teepee has quit [Ping timeout: 255 seconds]
nobody666 has joined #openscad
teepee has joined #openscad
ur5us has quit [Ping timeout: 252 seconds]
guerd871 has quit [Read error: Connection reset by peer]
nobody666 has quit [Ping timeout: 268 seconds]
guerd87 has joined #openscad
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
J1A8481887091 has quit [Ping timeout: 260 seconds]
<fancsali[m]>
Good morning, fellow 3D nerds...
J1A84 has joined #openscad
<fancsali[m]>
Something just occurred to me, and I was wondering about what others think: is there such a thing, as parametric use of a module's children? Can on do a dependency injection in OpenSCAD?
<fancsali[m]>
So the `ring()` module would be a `hull()` with an empty `for`-loop, and then the actual contents of the or loop would be provided as the children in the code. Or perhaps as a module/function reference/pointer...
<fancsali[m]>
As an example: Let's say, we're trying to create a ring, that would be defined as several cross sections, that in turn would be generated by a piece of code.
<fancsali[m]>
In other words: is there a way to pass a module itself as a parameter instead of the output of said module...
<fancsali[m]>
s/.../?/
gwillen has quit [Ping timeout: 260 seconds]
gwillen has joined #openscad
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
guerd871 has joined #openscad
guerd87 has quit [Ping timeout: 256 seconds]
<InPhase>
fancsali[m]: Like this? module Twist(n) { for ($z=[0:n]) translate([0,0,$z]) children(); } Twist(18) { rotate([0,0,$z*10]) cube([10,2,1.01]); }
<InPhase>
fancsali[m]: The actual passing of module references as data is an area of active development work right now, and is not yet available. But you can still modify children in ways like this.
<InPhase>
fancsali[m]: Also with children(i) you can select or loop over syntactic children.
<InPhase>
fancsali[m]: Yeah, that's the thing that is under active development and thus not available. Here's tweaking it into the form I showed: https://bpa.st/DVEQ
<InPhase>
(Plus an added translate so it's actually a ring.)
<InPhase>
Being able to pass modules in as first-class objects will be an upgrade to this capability. But you can still make most of these things happen with the existing structure.
<fancsali[m]>
Okay, so basically a bit of trickery with scope and "globals" is the way to go...
<fancsali[m]>
Hm...
<InPhase>
Well there are no globals there.
<InPhase>
Those are what are called "special variables", and have dynamic scope.
<InPhase>
They specifically pass down the call chain.
<InPhase>
chilren() are then part of the call chain.
<J1A84>
fancsali[m] your example has no radius .. the hull would be created at origin
<J1A84>
else you would have two submodules one with i+1 in the hull
<fancsali[m]>
<J1A84> "else you would have two submodul..." <- Yeah, it was just a quick and dirty example off the top of my head...
<J1A84>
when i make these .. the child will be 2D and all hull stuff and rotation is done in the ring module
<InPhase>
J1A84: Interestingly, that fails on the last release.
<InPhase>
J1A84: I guess we had bugs causing the passed special variables to be parsed as children indices, which got fixed between the last release and the current master branch.
<InPhase>
It's a pretty result though on the master branch. :)
<J1A84>
special varibles should be "passable" to every module so also children or?
<J1A84>
else you would create a union scope around it
<InPhase>
Yes, it looks like it was just a bug someone found and fixed. And a union scope would be the workaround for it.
<J1A84>
some time ago i made these with profiles of equal diameter .. resulting in rings that roll without having a round surface
<J1A84>
it is not perfect as i used several sin wave to compensate for the center oscillation - later i found out that those object just doesn't have a wave form but abrupt ones
<J1A84>
hull()for(i=[0:359])rotate(i)translate([2*sin(i*3),0])square([50,.1],true); that should rotate with i sinus center oscilation
aiyion1 has quit [Remote host closed the connection]
aiyion1 has joined #openscad
califax has quit [Ping timeout: 255 seconds]
califax has joined #openscad
<linext>
the line ending could be an issue
<linext>
i emailed the creator of openscad.cloud/openscad who wrote the build instructions, maybe he can explain why it crashes
aiyion1 has quit [Ping timeout: 255 seconds]
aiyion1 has joined #openscad
aiyion1 has quit [Remote host closed the connection]
aiyion1 has joined #openscad
<InPhase>
linext: If you can trace where the data goes through from cold storage until it becomes an abstract file openscad.wasm is able to open, I'd put at least reasonable odds there's some function call there with an ascii/binary option that has been left at an ascii default.
<InPhase>
It shouldn't hurt to leave it as a binary default, and let OpenSCAD handle the file contents raw.
<InPhase>
(Regardless of type.)
use-value has quit [Remote host closed the connection]
use-value has joined #openscad
J1A84 has quit [Ping timeout: 260 seconds]
J1A84 has joined #openscad
<Friithian>
any of y'all have a nice ~10g test model to 3d print, I'm tired of benchy and makerbot's built in tests
<othx>
InPhase linked to "Ergonomic Hair Comb With Personalized Text by rcolyer" on thingiverse => 5 IRC mentions
<Friithian>
that could be interesting, although I may need a second or third model also because 10 of those is a bit overkill
<InPhase>
Friithian: PETG is recommended, PLA works but is just a little rougher on the head. It's fairly flat, and requires high bed adhesion and low stringing.
<Friithian>
well actually yeah, that'd only be able to be printed on the 4 that have printed beds
<Friithian>
heated beds wtf brain
<InPhase>
Printed beds would be a serious pain. :)
<InPhase>
You'd have to what, apply a layer of vaseline to reduce sticking? :)
<Friithian>
what's the flexible bed plastic called? I know you can theoretically print with it
<InPhase>
One of the things I've actually used a lot for test printing is thin wall prints. You setup your slicer to give you one-wall thick square prints, and let it go to town, like a cube in vase mode.
<InPhase>
That gives you tests of stability, layer alignment, and adhesion, while using almost no filament for each one.
<InPhase>
It basically tests almost everything except stringing.
<InPhase>
And you can go very nuanced on the details of those other properties, taking calipers to the walls and such.
<InPhase>
If things are good you get walls that don't peel apart even with one layer, and that match up very closely to your nozzle width when measured with good calipers.
<InPhase>
Also the walls are fairly uniform in appearance when things are right, and don't have horizontal waves of different thickness or appearance.
<InPhase>
Sometimes you get z-height dependent differences, or things that vary with time, and those will appear very clearly in a thin wall cube print.
<Friithian>
I just need a generic test print to make sure the printer is still mostly functioning
<InPhase>
I'll share my openscad file for thin wall test prints. Brace for a massive paste!
<InPhase>
cube([20, 20, 10]);
<InPhase>
Then I would set the rest in the slicer. :)
<Friithian>
lmao
<InPhase>
2g print, 5 cents at $25/kg
<InPhase>
Also 8 minutes at my settings.
<Friithian>
not my money being spent :D:D:D:D
<InPhase>
Oh wait, that's without vase mode. So less than that.
<InPhase>
How does vase mode even work in this Cura version...
<Friithian>
do note the only slicer I can use is shitterbot's
<InPhase>
Well, anything you can do to remove the top layer, remove the infill, and set one wall perimeter and one base layer should do it.
<InPhase>
This used to be one or two checkboxes. Now all the slicers seem to be more "featureful".
<InPhase>
I haven't done it in a long while after I stabilized my printer.
<peepsalot>
the last 1/4 of scripts/release-common.sh is specifically for packaging cross-built tests from MXE to run under windows environment. have we ever published these?
<Friithian>
I'm finally getting around to playing with setrlimit :D
<peepsalot>
i'm trying to see if that test packaging can be done entirely with cmake
<Friithian>
InPhase: problem in makerbot's slicer is uh, not a very good slicer
<InPhase>
Ah, there we go. I can still set this in Cura. I enabled "Thin walls" and wall count as 1, top layers 0, and bottom layers 1, and it gives the same old thin wall print.
<peepsalot>
teepee: do you know? about the MXE packaged test suite?
<Friithian>
oh no ls didn't instantly print all the files :D I think this folder is wrecked
<Friithian>
huh, 1048575 is only 20 bits, interesting max
<Friithian>
bash: /usr/bin/rm: Argument list too long
<Friithian>
the folder is 20MB :D
<peepsalot>
on meellion file descriptors *holds pinky up to mouth*
<Friithian>
actually I let ls finish real 0m7.368s
<peepsalot>
ok, i see. i thought you meant ls was truncating output or crashing or something. it just wasn't fast enough for you :P
<peepsalot>
what about "ls -1" ?
<InPhase>
Friithian: When I lay it out properly, I got ~1g, 4 minutes, 1 cent of filament per run. :)
<Friithian>
InPhase: ah but are you using makerbot's $40/kg filament :D
<Friithian>
peepsalot: one moment while I regen the files
<InPhase>
Friithian: No, but on that scale time is the only expense of significance whether you're paying for it or not. ;)
<Friithian>
true true, but my time is being paid for by someone else, and the filament too!
<InPhase>
They have fast turnaround so there's no waiting on prints. You barely have enough time to steep a tea. So it's mostly print, adjust, print, adjust, which is the target goal I had when picking this scale of test object.
<Friithian>
ls -1 is actually 2 seconds slower
<InPhase>
Friithian: And the only reason I went as large as 20mm is because you want to be able to comfortably stuff your thumb in there and yank on the layers to test adhesion.
<Friithian>
20mm? I'll need ot check the size of mythumb then :D
<InPhase>
At 10mm depth, my thumb is 18mm wide. You want to leave a little clearance! ;)
<Friithian>
I have a 20mm wide thumb :D
<Friithian>
wonder if I run this as sudo it'll be a higher number
<InPhase>
No, running things as root does not inflate your thumb, only your head.
<Friithian>
nah rlim_max
<InPhase>
Is this Linux?
<Friithian>
yea
<InPhase>
man 2 getrlimit, second paragraph
<Friithian>
the thing is what I expect to happen and what actually happens is mildly differnet, I tried to set it to RLRLIM_INFINITY
<Friithian>
and even as root it didn't like that, so I'm just setting it to rlim_max which is prob different as root
<Friithian>
well, what's the worst that can happen :D
<InPhase>
Well you have to raise the max if you want to raise the soft limit.
<Friithian>
the regular user soft limit was 1024 and hard limit was whatever 2^20-1 is
<Friithian>
rgh it is so annoying that clearing the dir takes 15 seconds
<InPhase>
I think there might also be a practical hard limit supported by the kernel.
<Friithian>
kernel wise it is set to the max value, hold on lemme find the commit
<InPhase>
One million is a really large number of files to be dangling as open.
<Friithian>
insanely large tbh
<Friithian>
I dont even remember why I am playing with this insanity
<InPhase>
I enjoy the sad comment about the binary search for the limit by checking for failure in that commit. :)
<InPhase>
I was about to ask what you are trying to do.
<Friithian>
at this point I'm just fucking with my system tbh
<Friithian>
huh, ran as sudo it has the same hard limit
<nobody666>
hi guys
<Friithian>
24MB folders with only empty files :D
<nobody666>
Wanted to try openscad but it gave a black box in render
<InPhase>
Friithian: Yeah, root seems unable to go above 2^20 on my system. But this is the same as the hard limit I have set for user processes, so both have the same capabilities.
<InPhase>
nobody666: I recall us concluding you were probably hitting some sort of opengl or graphics driver sort of issue.
<InPhase>
nobody666: Did you obtain new information?
<nobody666>
Nope
<nobody666>
Still the same
<nobody666>
I guess i will have to wait for a next update
<Friithian>
InPhase: there must be a way to up the limit, the question is: do I wan tto try
<InPhase>
nobody666: Or downgrade, or try a manual replacement of a critical part. Or try running some way other than the VM you are doing.
<InPhase>
nobody666: Or run it from the terminal and check for any error outputs coming to the terminal. In some way you need information or a replacement of one of these components.
<nobody666>
I doubt a vm should forbid me to use freecad or openscad
<InPhase>
Shouldn't, but something about the particular setup is messing up the opening of those opengl windows within a Qt window.
<nobody666>
I tried virtualbox, lol, it had issues
<Friithian>
it's the graphics part of the vm that may be causing issues
<InPhase>
And yeah, in theory then we could use the mesa software renderer to produce an unnavigable image in place of the black square nobody666 was reporting. But that would require us to actually have an error message to deal with. There's nothing the code could do if there's just a mysterious black square failure and no error message comes out of the libraries.
<InPhase>
Unless there is an error and it's being eaten somewhere and not reported.
<linext>
i'm really trying to keep the openscad wasm web app rendering on the client side, and f5 quick preview would make it complete
<teepee>
the best solution for that would be a web implementation of OpenCSG
use-value has quit [Remote host closed the connection]
fling has joined #openscad
use-value has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
epony has joined #openscad
castaway has quit [Ping timeout: 268 seconds]
<Friithian>
oh by the way: I forgot why I was doing the ``open as many files as possible'' but I can high recommend not doing it
<JordanBrown[m]>
It may or may not be relevant, but on my two-monitor two-video-device setup, I sometimes (haven't isolated the pattern) end up with a white primary window. When that happens, I move it to the other monitor and open a new window, and the new window is usually OK (and remains OK no matter which monitor it is on).
<Scopeuk>
The Mesa docs are wooly on where stuff is rendered as it does cascading fall back. It uses different blackened depending on what hardware the machine has. It can be coerced to CPU only though