snaked has quit [Read error: Connection reset by peer]
<church__>
Just tried (openscad 2025.01.16) using text function to render some unicode symbol glyphs. First it seems that very few fonts include wide variety of those (found only Segoe UI Symbol:style=Regular) one, so wonder if there shouldn't be included among fonts that openscad ships with some free font with many of those symbols included. And then found out that font browser (btw, thanks for implementing that, eased finding font "that works") accepts only
<church__>
direct symbols for Sample text
<church__>
-maybe worth adding ability to input in "openscad syntax" \u0123 \U012345 to font dialog sample text input box too, if it's possible to use that way in code?
SamantazFox has quit [Killed (NickServ (GHOST command used by SamantazFox_))]
SamantazFox_ has joined #openscad
kintel has joined #openscad
<kintel>
church__ One trick you can use in code is this: text("\u2668", font=":charset=2668");
<kintel>
-> it will limit the matching fonts to the one supporting the requested symbols
<kintel>
Would be nice with better font browsing for things like that too
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
califax has quit [Remote host closed the connection]
califax has joined #openscad
<church__>
kintel: love various tricks. thanks :)
<church__>
kintel: btw, is it possible in text() switch fonts throughout, or separate text() usages for that needed?
<church__>
(thinking of maybe changing font just for those few symbols, leaving "normal" text in different font)
Guest1 has joined #openscad
Guest1 has quit [Quit: Client closed]
Guest1 has joined #openscad
<Guest1>
are you guys in for gsoc 2025?
<Guest1>
which repo should i contribute to?
<Guest1>
are all BRL-CAD, OpenSCAD, IfcOpenShell, KiCad, Appleseed, Manifold open for contributions?
<church__>
kintel: hack of autoselection of font containing special unicode char works wonderful. i'd even suggest to have it mentioned in text()'s online description/manual :)
<church__>
J25k18: just as i try to not use external libs, i'd prefer to use ones i have by default (in eg. windows / mac or shipped with openscad). Makes model less specific and all that
<J25k18>
church__ these are fonts not libraries - if you want to use emoji/symbols you need the font that support these
<J25k18>
your OS will replace fonts to find a fitting character - openSCAD does not
<J25k18>
using any font is always specific, It happens that a windows update overwrote an opensource font with their version that was missing some symbols - after reinstalling the font it was working again
<J25k18>
So even using "DejaVuSans" doesn't mean it is working on every system
<church__>
Most OSes have "Sans" or "Seriff" aliases though. May differ to what exactly font they point though. Special symbol glyphs aside, at least GUI of most common OSes usually is unicode-ified these days & shipped with at least basic fonts with multi-language support
<church__>
In this case i wished to use unicode glyphs for simple reason to avoid dealing with aligning & spacing text with figure if created as geometric shape
<J25k18>
fonts are a can of worms, and openscad uses a wrong size. But textmetrics can help.
<J25k18>
maybe you haven't noticed this but emoji look different depending on what OS you are using them
<J25k18>
because they use different fonts to display/replace them
<church__>
"openscad uses a wrong size" noticed that. But technically it eases text use in it, as it seems not "font size in other apps in pt" but closer to actual measurements, which eases aligning it relative to other model bits. At first started googling on how to maybe convert "font sizes as specced elsewhere", but seems that not needed
<church__>
teepee: aye, that font dialog widget was where i noticed sample entering box and how i found font that included geometrical shapes aswell. Thanks to kintel, that with his trick it's simpler to auto-set font that "includes unicode letter with code X" though, gonna reuse it in future :)
mmu_man has joined #openscad
<J25k18>
church_ no pt is a unit but if you place text with 10pt it is not the size of 10pt you need to multiply with 0.72 someone made an error for the resolution
<J25k18>
use textmetrics ( feature) to get the size you want
<church__>
isn't in typography about fonts that pt size is 1/72 of Inch, not cm? like LPI/lines per inch?
<J25k18>
as the true size of a glyph is only defined by the font not by the size which only define the lead size
<church__>
and then from among googled bits, that in fonts on average lowercase letters are 75-80% of large ones. and then there is total max typeface height/width
<J25k18>
but with digital fonts you can make an A that is 20cm when size is 12pt
<church__>
i ended up just specifying size with number, which coincedentally was relatively close to size in mm, +aligning text horizontally to side on which part to align at, and left at it
<J25k18>
so 10pt is 3.528mm but if you make an A in openSCAD with size 3.52 the A is not the size a 10pt A should have
<J25k18>
As said to get true size for proper matching you have to use textmetrics .. or use resize()
<church__>
i'll need to analyze how resize() works. as in if it won't happen that i need to somehow measure also width, so that ratio/shape of text of different length doesn't get wrong proportions
<church__>
but that sounds too much time to spent on minor design bit. hence left at setting aproximate size that seemed ok, + aligned text to right
<J25k18>
resize() with only one dimension will scale the other to keep ratio
<church__>
but how to specify "just one dimension" with telling if it's height, or if it's width, or if it's depth?
<J25k18>
but there is nothing that can make iiiii the size of MMMMM - you can use the spacing parameter of text though
<church__>
just one quick extra question then - resize probably works on "larger size" of object it works on? so if eg. one changes text from lowercase only, to one with both cases, it may mess up in this case?
<J25k18>
resize calculates the true size and then apply a scale factor to match the size you want
<J25k18>
if you would use resize for every letter and not the whole text - each letter would get a different scaling
<church__>
ahha, that's what i suspected
<church__>
sometimes i'm thinking, that it would be nice to have in openscad some size(children) function to return those true sizes of objects. in sometimes also to measure angle. In code, not UI (noticed those measurement additions in UI of new versions)
<church__>
for example this scenario - if i'd use such hypothetical size() or truesize() on single letter, i'd be able to scale/resize all to same "measured" ratio
<church__>
or another possible use case seems - use such size() on imported stl, to able in automated way to align it to other parts
<church__>
of course, using resize to known size may kind of work, as it can measure truesize .. but ability to just measure sounds better
<church__>
at very least i'll start using now resize (to one dimension) from where i manually measured aproximated dimensions of autogenerated via inkscape openscad plugin from SVG vector logo, that i scaled then to needed dimensions with scale() previously according to ratio of manual measurements vs needed size
guerd has quit [Read error: Connection reset by peer]
<church__>
hmm, regarding fonts, stumbled upon another bit. font size still matters, as it affects segment size. big font size resized to same dimension will have much more segments, then small font resized to same size. and as i minkowski that text to emboss or deboss with chamfering, segment count matters
<church__>
oh, it's because i had preset $fs model-wide, and unset $fs or $fn in text(); still, it seems then to set resize()-ed text font size closer to used one
<J25k18>
for font this is what textmetrics does
<J25k18>
the segments for fonts are not very exact. Also you can use roof() for chamfer text
<J25k18>
text only uses $fn as indicator for subdivision
<church__>
"text only uses $fn as indicator for subdivision" - are you sure on that? to me it seems in similar way as almost everywhere else, "if $fn=0,$fa=0.01, then only $fs matters"
<J25k18>
change $fs and see how text changes
<church__>
at least i have $fn & $fa set this way, not set $fn within text(), and (with customizer slider) changing $fs properly increases/decreases segment count for text(), even if "$fs stays same"
<church__>
erm, typo, should be even if "$fn stays same"
<J25k18>
seems $fa and $fs is now also used in the dev version, nice .. someone™ should update the wiki
<J25k18>
$fa and $fs only work if $fn is 0 or undef
<church__>
oh. i haven't tried in stable version. not that long ago started using dev snap, got hooked to manifold performance, and haven't used stable one ever since :D
<J25k18>
$fs 1 in text doesn't mean you get 1mm (unit) segments
<church__>
but that if $fn=0 & $fa=.01 trick i used all the time even back then in stable, to have predictable similar mesh segment sizes everywhere throughout in model, linear & rotate extrudes, cylinders, spheres
<church__>
if one also uses $fs as step size in per-segment via cycle adjustable or generated objects, then it's consistent throughout
<J25k18>
$fs=3 ≙ 1mm segments when using fonts
<J25k18>
calculating segments in bezier curves is possible but not trivial - but strange that we have factor 3 here
<church__>
isn't it same in fonts as with rotate extrudes? with fixed $fs it counts one transformated object side. So if your have for font letter rounded line, compare size of inner and outer
<J25k18>
well using a character like "S" show that the segments are not equal ..
<J25k18>
$fs is a calculation based on a circle .. fonts are curves not circles
<church__>
openscad generates fonts using what? some own code, or some external renderer?
<church__>
(err, "text", not "fonts")
<J25k18>
fonts are curves Bézier curves
<J25k18>
so to convert any curve into a polygon you need some calculation.
<J25k18>
Same is when importing svg
<J25k18>
And to make a true $fs you need to put some more effort into the calculation
<church__>
for simple svg-s (like logos) i'm used to inkscape openscad plugin, to have copy&paste-able code when i wish to reuse that logo in other model
<J25k18>
you converting curves into polygon and paste them in scad - but scad can import svg directly
<church__>
that plugin generated of many points to make openscad-ish logo object
<J25k18>
no need to do that since you can import svg and even select layer or objects to import
<church__>
can import, but that means i have to keep file around, whereas it seems to me preferable to have no external dependancy, and i just paste in module of that logo generated once, and just scale/place it where needed
<J25k18>
And you can change the svg without issues
<J25k18>
you can do that with text too - convert into polygon. This was used in openSCAD before text() existed
<J25k18>
iirc MDAC has some fonts
<J25k18>
yes fonts.scad
<church__>
also svg importing - for example, will it work on websites with customizer UI? but pasteable generated once poligon as just another module in code - should
<J25k18>
websites interpret code as they want - nothing is sure
<J25k18>
makerworld uses some way to upload your svg for importing it so it can be used
<J25k18>
but how the customizer is used is up to the website - so results can vary
<J25k18>
but same issue with fonts, as the font need to be on the server even if WASM rendering happens in your browser
J25k18 has quit [Quit: Client closed]
J25k18 has joined #openscad
mtm has quit [Ping timeout: 252 seconds]
mtm has joined #openscad
L29Ah has left #openscad [#openscad]
<church__>
J25k18: do you know by chance what version of openscad MW uses? old stable, or uptodate dev? Or prehistoric like thingiverse? :)
castawayc has quit [Remote host closed the connection]
castawayc has joined #openscad
J25k18 has quit [Quit: Client closed]
J25k18 has joined #openscad
mmu_man has quit [Ping timeout: 252 seconds]
J25k18 has quit [Quit: Client closed]
J25k18 has joined #openscad
<J25k18>
church__ makerworld uses some 2024 version via WASM but with some custom addon so color export into bambu projects work
<J25k18>
they also have some fonts integrated and roof and textmetrics is active
mmu_man has joined #openscad
<church__>
J25k18: .. but not manifold? :)
<church__>
also i wonder if MW's can use multiple scad files so eg. external libs like BOSL and such can be used
<J25k18>
i think that version had manifold as feature and should be active
<kintel>
teepee Any ideas for GSoC this year? As usual, I'm out for a large chunk of the summer (most of July I think), so we'd have to mentor in pairs.
<teepee>
fwiw also notifications via #openscad-ci ;-)
<Murr>
looking promising so far
<teepee>
yep, although it's still in the apt setup for arm
<teepee>
ah, cmake now...
<teepee>
kintel: no crash, qt5.15.15
snaked has joined #openscad
L29Ah has left #openscad [#openscad]
<teepee>
question... who wrote that: "OpenSCAD is a software for creating solid 3D models. It uses the deformation of polygons (like Lego blocks) to create geometric shapes and objects. The primary programming language used in OpenSCAD is called "G-code," which is based on the Scheme dialect of Lisp, but with some modifications and extensions. "
mmu_man has joined #openscad
lastrodamo has quit [Quit: Leaving]
L29Ah has joined #openscad
mmu_man has quit [Ping timeout: 265 seconds]
<ali1234>
teepee: chatgpt?
<teepee>
yep, well, deepseek-code specifically, supposed to know about coding :)
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ali1234>
earlier today, google tried to tell me that 1/1.5MHz is equal to "exactly half of 1.5MHz"
<teepee>
yeah, there is so much nonsense going around, it's frightening
<teepee>
hmm, I hope that arm64 compilation picks up speed once through the main cgal stuff. 25% at 1h30