<Brittany>
Hey all. :) Just wondering - does anybody have a link to a project that they feel demonstrates a well-managed, large-scale OpenSCAD project? Primarily I just want to see modularity principles in action.
<nb-ben>
my point is I'd like it to execute it, read from stdout, and then use that output lol
<J25K49>
well write it to file and use command line options to execute
<nb-ben>
rather than have me execute the program, save to a file, and then import that file
<J25K49>
you can automatize that.
<nb-ben>
I want rendering to do that, so whenever it renders it'll run my generation program
<J25K49>
so your other program need to be started first then call openSCAD
<nb-ben>
is there a way to write a C plugin to add that?
<J25K49>
you can call a program like for the 3D print or POV render
<J25K49>
the source is there so sure you can write add ons - but there is no offical add on
<nb-ben>
ok, so no plugin system
<nb-ben>
have to recompile openscad entirely for that LOL
<J25K49>
what is your workflow exactly what should scad do?
<nb-ben>
hmm, maybe I can use pyopenscad
<J25K49>
normally scad is just the last step to call for image/3d generation
<nb-ben>
J25K49: I'm generating mechanical parts from a kicad pcb project
<J25K49>
also 123build seems to be nice (but not scad)
<nb-ben>
J25K49: so I generate a lot of stuff, load it to an openscad file which has some final manual customizations, and create a 3d model from that. All of this is also done in CI
<nb-ben>
I just want to be able to open the generation target openscad file, and work on it just like any other openscad project, without having to manually generate the assets from the kicad project...
<nb-ben>
anyway doesn't seem like this goes anywhere LOL
<J25K49>
you can work with CSG files
<nb-ben>
yes, that's true I can do that lol
<J25K49>
and what is the "generation target openscad file"
<nb-ben>
the file that imports all of the generated stuff, that is used to then export the part
<J25K49>
You can auto generate SCAD scripts if the command line parameter not enough for you - but i have seen quite elaborate powershell scripts working with openSCAD
<nb-ben>
you're totally missing my point here.
<J25K49>
obviously
<nb-ben>
The current workflow is: Edit PCB in KiCad -> Run script to generate mechanical assets -> OpenSCAD render
<nb-ben>
I want "OpenSCAD render" to itself run that script and instead of loading files, load the output from stdout
<J25K49>
so the script automatic starts scad and generate the render output
<nb-ben>
J25K49: say I'm making a heatsink
<J25K49>
you want scad to not me the modeler but to be some controller
<nb-ben>
J25K49: I'll have heatsink.scad, that will import the generated stuff, and also provide the opportunity to customize the generated things after generation
<nb-ben>
heatsink.scad is not itself generated
<J25K49>
i can't see how this would make sense - if you start in KiCad - this is where everything needs to be handled
<nb-ben>
instead of heatsink.scad importing generated files, I want heatsink.scad to import/include/use the output of another program
<J25K49>
how would that improve anything?
<nb-ben>
ok well, I am asking about a specific technical solution -- import/include/use from stdout of another program. I don't need help with organizing my development workflow and CI builds and organizational scheme and how I live my life..
<nb-ben>
yeah that's what you'd do if you didn't really think about decoupling things
<nb-ben>
there's literally no benefit to doing it this way over simply generating assets that can then be used by whatever openscad script across your project
<nb-ben>
but a lot to gain by generating assets that are then used as a resource dependency for things
<nb-ben>
this project I'm doing has multiple PCBs in an assembly, a couple dozen parts, the price for jank is high here
<nb-ben>
also why would I write stl to stdout, that's not the issue for me LOL
<nb-ben>
anyway, thank you for trying to help dude, sorry if I come off as rude here I appreciate your efforts
<J25K49>
yeah still don't understand what would improve only by making something different
<J25K49>
Kintel might be better to discuss such things
<J25K49>
nb-ben you can use python with kicad and scad
Brittany has quit [Quit: Client closed]
_whitelogger has joined #openscad
JordanBrown has joined #openscad
Guest58 has joined #openscad
<Guest58>
/ Straight hollow lumen as a solid cylinder (fluid domain)
<Guest58>
/ Diameter 25 mm, length 40 mm, centered along X axis
<Guest58>
diameter = 25;
<Guest58>
length = 40;
<Guest58>
translate([-length/2, 0, 0])
<Guest58>
rotate([0,90,0]) // make cylinder along X
<Guest58>
cylinder(h = length, r = diameter/2, $fn=200);
Guest58 has quit [Client Quit]
<JordanBrown>
nb-ben: there is no capability in OpenSCAD to have an OpenSCAD program run an external program, and it is likely that there never will be.
<JordanBrown>
Why not? Because of security concerns. You should be able to download an OpenSCAD program and run it, without fear that it will do anything to your system other than perhaps go into an infinite loop and chew up all of memory.
<JordanBrown>
I think that Guest58 is actually a spy, sending secret messages encoded as OpenSCAD programs.
<JordanBrown>
AdrianH isn't here, but... I did some syntax experiments, and indeed "lambda_function = function traditional_function; is syntactically viable.
<JordanBrown>
That is, having "function <name>" with no body as a function literal could be used, syntactically, to translate a traditional function into a function reference.
stealth_ has joined #openscad
<JordanBrown>
I did not *implement* that capability, just tweaked the parser to recognize it to see if there were any syntactic conflicts.
<J25K49>
JordanBrown the 3D-print button can make an external call - in the nightly that feature has a lot settings.
<JordanBrown>
Not under the program's control.
<J25K49>
however it is user interaction
<J25K49>
.. yep you are right just noticed
<JordanBrown>
Right, very very different.
<JordanBrown>
I don't remember... are you Hans?
<J25K49>
UB
<JordanBrown>
Ah.
<JordanBrown>
I wanted to tell Hans that he was correct, that github edits do not generate e-mail notifications, but I don't have any contact info for him and don't want to add github noise.
othx has quit [Read error: Connection reset by peer]
othx has joined #openscad
<J25K49>
afaik peeps[zen] is reading
<peeps[zen]>
hello
peeps[zen] is now known as peepsalot
<J25K49>
Jordan wanted to tell you were correct ..
<peepsalot>
i see, thx for confirming
<JordanBrown>
I should more precisely say that I didn't *remember* contact information; having been reminded now I remember.
<JordanBrown>
What I do in that sort of edit case is to make the edit, then add a comment saying I made the edit, then delete the comment.
howiemnt4 has joined #openscad
<JordanBrown>
That way people following the e-mail chain get the whole story (and can go back and look at the edited text if they like) but the comment chain remains clean.
<peepsalot>
ok, good idea. deleted
<JordanBrown>
Similarly for if I make a comment that I later decide was just wrong.
<JordanBrown>
It is of course a judgement call when retaining the entire history in the comment chain is appropriate.
howiemnt1 has quit [Ping timeout: 256 seconds]
<JordanBrown>
hiding comments is another option.
JordanBrown1 has joined #openscad
JordanBrown has quit [Ping timeout: 245 seconds]
howiemnt4 has quit [Remote host closed the connection]
howiemnt4 has joined #openscad
UltraGreen has joined #openscad
howiemnt has joined #openscad
howiemnt4 has quit [Ping timeout: 260 seconds]
JordanBrown1 is now known as JordanBrown
<JordanBrown>
tail call elimination means that stack traces can be incomplete. I guess that's sort of intrinsic to tail call elimination, but still :-(
<UltraGreen>
Hii
<UltraGreen>
I'd like to 3D print tactile signs for accessibility (latin text not braille in this case!)
<UltraGreen>
Making extruded text is very easy in OpenSCAD. But I'd like to addiotionally make the text pointy or wedge shaped. Is there an easy way to do this?
<UltraGreen>
In more detail: The text has to be wide at the base for good visual readability and be pointy at the top for good tactile clarity. I could probably define every letter myself, point by point. But I was hoping there was a simpler way to achieve this.
<JordanBrown>
When you say "the base" and "the top" you mean in Z, the extrusion direction, right?
<UltraGreen>
In the extrusion direction, yes
<JordanBrown>
The only way that I know of is to extrude the text N times, with larger and larger offset() applied to each.
<JordanBrown>
that is, something like linear_extrude(height=3) text("Hello"); linear_extrude(height=2) offset(2) text("Hello"); linear_extrude(height=1) offset(3) text("Hello");
<JordanBrown>
(Probably in a loop, quite possibly with the height and/or offset being a function to produce the desired profile.
<JordanBrown>
)
<JordanBrown>
You might think that linear_extrude with scale would help, but you don't want the tops of the glyphs all migrating toward the origin.
<UltraGreen>
Thanks for the tip, I'll test if that produces the result I'm looking for :)
<JordanBrown>
It can definitely produce good results, but is unsatisfying because you have to pick a number of steps and because you end up generating N times as many shapes and N times as many faces as you really need.
<UltraGreen>
I tried linear_extrude with scale and that does not lead to what I want, yeah. Same for applying it to single letters
<JordanBrown>
(Actually, hmm. Maybe not N times as many faces.)
<JordanBrown>
Right, you want something that shrinks or grows the letter around the center of each stroke, not around some other point.
<JordanBrown>
And that's offset().
<JordanBrown>
Unfortunately, we don't have a way to offset while extruding.
<UltraGreen>
I plan to print it. So as long as the slicer does not get confused I don't worry about too many faces or similar
<JordanBrown>
(It's a lot trickier than scaling or twisting, because offset can increase or decrease the number of points.
<JordanBrown>
)
<JordanBrown>
I said "unsatisfying", not "doesn't work" :-)
<UltraGreen>
Fair ^^
<UltraGreen>
Thanks for the help!
<JordanBrown>
I don't offhand know whether BOSL2 has something. I don't think it can really do what I would want, because it doesn't have access to the glyph geometry.
<JordanBrown>
But it may have a module that does the appropriate extrude/offset stacking for a desired profile.
<JordanBrown>
Another tip: you might think that you could start out with the original glyph at the base, and shrink as you move up.
<JordanBrown>
That doesn't work well, because some strokes are wider than others, and the narrower strokes will just disappear.
<JordanBrown>
I wasn't able to get satisfactory results from shrinking.
<JordanBrown>
I got good results from starting with the glyph at the top, and making it bigger at the bottom.
<JordanBrown>
Anyhow, good luck!
<UltraGreen>
Maybe I can set the offset=0 text in the middle. Because too much offset seems to make it an unreadable blob ^^
<UltraGreen>
And yes I saw that negative offset seems to remove lines if it's too high
<UltraGreen>
J25K49 I don't know about roof. I looked at the cheatsheet and tried searching for stuff
<J25K49>
using the snapshot you need to activate that experimental feature
<UltraGreen>
Thanks for the link. It looks like what I need indeed. I'll try it out :)
<J25K49>
however with scale([1,1,x])roof()text("hi") ; this does what you want
teepee has quit [Ping timeout: 272 seconds]
<JordanBrown>
Only sort of.
<JordanBrown>
It has the same troubling behavior that a narrowing offset does.
<JordanBrown>
Look at the result from the side, and observe that the top is not level.
<J25K49>
depends what method you use
<J25K49>
But for best results a font like "Bahnschrift" is useful - having a constant width
teepee has joined #openscad
<JordanBrown>
I'm playing with Liberation Sans, and for either "straight" or "voronoi" if I look from -Y in orthogonal view the tops are not at the same level.
<UltraGreen>
I probably want to use the font Frutiger for clarity
<UltraGreen>
I got roof to work, thanks :) I'll try out both options for sure and see what works best
<JordanBrown>
By all means experiment with roof(), because it's a lot simpler if it works for you.
<JordanBrown>
Look at it from OpenSCAD in orthogonal mode from -Y. In your slicer, make sure to look at it layer by layer.
<JordanBrown>
"Bahnschrift" does produce better results than LS, but it's still not perfect.
<JordanBrown>
"Frutiger", by this metric, produces relatively poor results. Look at the crossbar on "e".
<UltraGreen>
roof seems to work very well for simple letters like 'U' but produces some strange shapes for example for 'R'
<UltraGreen>
I'm using all capital letters
<J25K49>
to have the same level either cut the top (not all will be pointi) but using a font with equal width helps (font "bahnschrift")
<JordanBrown>
teepee like, do we need to pay attention to supporting them?
<JordanBrown>
Or at least do we need to pay attention to supporting them when there are non-ASCII characters in play?
<teepee>
taking about scripts, I would say no
<JordanBrown>
More like if you say "openscad á.scad" in a non-UTF-8 locale, does it need to work?
<teepee>
that's a filename, not a script
<JordanBrown>
Right... clarifying my question.
<teepee>
probably the most straight forward solution is using utf-8 internally only and converting when reaching out to the file system
<JordanBrown>
Agree. The question is whether we even need to do that.
<JordanBrown>
And how much we need to test it.
<JordanBrown>
It looks like a bunch of the problems with non-ASCII file names involve converting them at the wrong points.
<teepee>
I'm not sure it's possible to ignore
<JordanBrown>
So you believe that there are people using non-UTF-8 locales, with non-ASCII characters in their file names or directory names?
<teepee>
well, I guess the only way for sort-of-ignore is declaring those do not work
<teepee>
probably, yes
sculptor has quit [Ping timeout: 258 seconds]
<JordanBrown>
BTW, it appears that the MSYS2 build is simply incapable of handling non-ASCII file names on the command line (well, without pretty major surgery). It appears that the command line comes from Windows as UTF-16, and that by the time it gets to main() it's been corrupted by chopping off the leading 00 for U+0080 through U+00FF, and turning anything >U+00FF into '?'
<JordanBrown>
Thus U+00e1, á, is turned into simple 0xe1 in argv.
<JordanBrown>
Which is of course not valid UTF-8. I suspect it might be valid ISO 8859-1.
<JordanBrown>
but it would take specialty handling to translate it to UTF-8, and no translation can save something > U+00FF.
<JordanBrown>
We could get the UTF-16 characters from Windows, but they we would be stuck doing our own shell-ish command line parsing, and I don't think we want to go there. Or I think there's a "be wide" option that calls a wmain() that takes wchar_t*, also somewhere I suspect we don't want to go.
<JordanBrown>
I do *not* find an MSYS2/MINGW64 option to translate the incoming UTF-16 into UTF-8.
<teepee>
release going through MXE might even behave differently
<dalias>
jordanbrown, that should be fixable by replacing the junk entry point stub code that does the conversion wrongly, with one that converts to utf-8
<JordanBrown>
... which is something I don't think we want to do. It's not trivial, and it's way outside our wheelhouse.
<JordanBrown>
I couldn't even find that function. It might be off in a MS DLL.
<dalias>
it's a drop-in in the build setup
<dalias>
also you just described the way to do it without poking at the bad internals
<JordanBrown>
what did I say that said that?
<dalias>
you use the option for wmain and you write a wmain that just does the conversion (a few lines of code) and passes off execution to the real main
<JordanBrown>
Yeah, that's probably the most plausible answer.
<JordanBrown>
But I want to see whether MXE has the same issue.
<dalias>
i would expect it does, but not sure. it might already do what i suggested
<JordanBrown>
I don't fully understand how MSYS2/MINGW64 fit together, and know zero about how MXE fits together.
<JordanBrown>
But at least for the MSYS2 build I had some success fixing issues with non-ASCII characters in the GUI.
NoGodDamnIdea has quit [Ping timeout: 245 seconds]
TheAssass1n has quit [Remote host closed the connection]
<gbruno>
[github] kintel pushed 1 modifications (Fix: Prevent auto-preview on startup when auto-reload is disabled This commit fixes an issue where OpenSCAD would automatically preview a .scad file on startup, even if the 'Automatic Reload and Preview' setting was disabled. The fix checks if auto-reload is enabled before triggering a preview when a new editor is opened.) https://github.com/openscad/openscad/commit/322f08db75f079471748416e7bbe1b1cc36edacd