<ccox>
anyone feel like code reviewing C++ code? It's an old 3D testfile generator that I finally got around to cleaning up. https://gitlab.com/chriscox/3Dtestshapes
califax has quit [Ping timeout: 276 seconds]
califax- is now known as califax
lagash has quit [Remote host closed the connection]
LordOfBikes has quit [Ping timeout: 240 seconds]
lagash has joined #openscad
LordOfBikes has joined #openscad
arebil has joined #openscad
peepsalot has quit [Read error: Connection reset by peer]
stonkey has quit [Ping timeout: 256 seconds]
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
<JakeSays>
ccox: review for what?
<JakeSays>
ccox: i'm curious why you use typedef here: 'typedef struct point3D'
<ccox>
review for sanity
<JakeSays>
i am genuinely curious about the typedef. is it a style choice or are there tangible benefits?
<ccox>
somewhat a style holdover from previous work, and because I can use the struct as a type without saying "struct point3D" all the time.
<ccox>
struct because it isn't really a class
<JakeSays>
you don't need to use struct when instantiating the type
<JakeSays>
anyway i was just curious
<ccox>
I could use class, and that automatically gives it a typedef. But if you don't use the typedef, you will find many situations where you still have to use "struct point3D" to get the types to work correctly.
<JakeSays>
i've never had an issue with that in c++
<JakeSays>
i'm racking my brain and can't think of any
<ccox>
in this code it doesn't matter. In more complex code (especially templates) it can matter. (I keep hoping the next C++ standard will fix some of those issues, and they never quite make it)
<JakeSays>
well now i'm genuinely curious. do you have an example handy?
ferdna has quit [Quit: Leaving]
<ccox>
no, because I've already solved the problem in any code I've worked on.
arebil has joined #openscad
miique has quit [Ping timeout: 245 seconds]
arebil has quit [Read error: Connection reset by peer]
ccox has quit [Ping timeout: 256 seconds]
ccox has joined #openscad
noonien has quit [Ping timeout: 256 seconds]
noonien has joined #openscad
Jack228946372 has joined #openscad
Jack2289463 has quit [Ping timeout: 256 seconds]
Jack2289463721 has joined #openscad
Jack228946372 has quit [Ping timeout: 256 seconds]
walterwhip has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<Scopeuk>
hmm I wonder with the I want per project library paths thing if "you could launch via a script that sets your search path how you want" would be accepted or just spark rage, its not super neat but it is available as a feature right just now and solves the problem
<Scopeuk>
the only other solution I can think of is to define a "project file" that wraps one or more openscad files and sets search paths and similar
<Scopeuk>
which avoids the in file syntax recursive/redefine problem
<Scopeuk>
but introduces a whole extra filetype, I suppose it would give us somewhere to store a list of files for tabs.
<teepee>
yeah, some sort of project file would be fine, but directly in the script that would be a mess I think
<Scopeuk>
I think the main problem with it is already listed in a lot of those issue which is the question of how you deal with modifications to it in called files. I can see legitimate uses for a "project" setup of this refers to the following library locations. I suppose a bit like how most ide's deal with search path. which is not surprising given that
<Scopeuk>
openscad is essentially a compiler
<teepee>
yeah, and adding support along the lines of compilers like gcc, I can see useful
<teepee>
fiddeling with the path inside the scripts like perl is probably not a good idea
<Scopeuk>
perl is a linguists idea of what a programming language should be, any time you can self modify code using a regex which is running from the self modifying code madness is happening
<Scopeuk>
it does work and I know people love it but it does tend in my experience towards write only code
<Scopeuk>
I wonder if a "project file" could be done as a special scad file, some token that must be at the start to specify that it defines a project and a total ban on embedding functional scad within it, just allowing set include path (I guess some other settings eventually maybe) and a list of a files considered part of the project by relative paths.
<Scopeuk>
debateable if that's just creating noise/confusion though I guess compared to a sperate file type (maybe there is a suitable existing one)
stonkey has quit [Ping timeout: 250 seconds]
ochafik has joined #openscad
ochafik has quit [Remote host closed the connection]
ochafik has joined #openscad
fling has quit [Ping timeout: 240 seconds]
<t4nk_freenode>
btw... i was/am just facing the old imported stl files failing to render etc.. again
<t4nk_freenode>
tried fixing it in freecad
<t4nk_freenode>
but then I exported it through Cura
<t4nk_freenode>
didn't pay attention to the format, and it picked .3mf
<t4nk_freenode>
... heh, but that one does work in openscad
<t4nk_freenode>
never tried it before, that was a happy accident
<teepee>
I have my openscad now configured to default to 3MF export :)
<Jack2289463721>
the 3mf button or is there more?
<teepee>
just the button, what more would there be?
<t4nk_freenode>
hehe, yeah, Jack2289463721, I'm the panicy type of guy I guess ;)
<Jack2289463721>
teepee: just found .. there is also a octoprint 3mf option Ü
Jack2289463721 is now known as Jack22
<teepee>
if you have a slicer installed, yes, it should be possible to directly upload to octoprint and have it slice (and possibly load&print)
<Jack22>
would be cool if we get groups into the export
<teepee>
I hope at some point someone will bring the new cura engine into octoprint
<teepee>
groups?
<Jack22>
like 3 cubes are one object at the moment .. but can be 3 objects that are grouped (or 3 objects ungroup which is a mess in cura)
<teepee>
ah, yes, right 3mf supports that
<teepee>
it should be possible with annotations declaring the separate objects
<Jack22>
or if they are separate volumes
<teepee>
doing that automatically is a bit tricky
<Jack22>
cura has an addon (mesh tools) to sperate shells
<teepee>
I know
<teepee>
and I have seen it fail
<Jack22>
mesh tools always tell me that my objects are not watertight .. not sure why
<Jack22>
but i thought if CGAL knows that there are multiple volumes - it would be easy to export them as a group .. as always i am wrong with my assumptions
<teepee>
not sure, volumes in CGAL are a bit strange
<Jack22>
and always one number higher .. so 1 cube is 2 volumes
<Jack22>
teepee that looks nice but the new syntax would confuse people (me) union(ID=42); would be easier IMHO
<teepee>
but that does not work easily for custom modules
<teepee>
we probably should not steal the magic ID parameter
<teepee>
Nut(ID = "layer", h = 3);
<teepee>
would be even more confusing I think
<Jack22>
then a new module group(42){}
<teepee>
that's possible but only for module instantiations
<teepee>
I would like to have the feature for instantiations, declarations and variables
<teepee>
e.g. for the library info, the annotation is on the module definition, not where it's used
<Jack22>
so this is not just for exporting groups
<teepee>
I believe it could be a very general mechanism to support different use cases
<teepee>
like extrace BOM information
<teepee>
e.g. for screws you could have something like @BOM(id = "Screw", size = str("M", s), length = str(l, "mm")) module screw(s, l) { ... }
<teepee>
every use of the screw(); module would attach the information to the model so it could be collected and extracted
<Jack22>
or exported as meta in the 3mf
<teepee>
yes, exactly
<teepee>
old Slic3r had some slicing hints support for AMF, something similar should be possible with 3MF too
<Jack22>
at the moment you could echo the info .. so you copy the "console" for a BOM
<teepee>
yep, that's the current workaround
<teepee>
which is ok-ish for BOM I guess, but things like DXF layers are more difficult to handle after the fact
<Jack22>
sounds like this would also work for exporting colors
fling has quit [Ping timeout: 256 seconds]
ochafik has quit [Read error: Connection reset by peer]
ochafik_ has joined #openscad
<teepee>
yeah, it could allow some limited color export too, like one color for every volume
<teepee>
I suppose actual color support should probably stay with the existing color() module
<Jack22>
thought it might be easier to implement as using the color modules vertex/face color
ochafik has joined #openscad
ochafik_ has quit [Read error: Connection reset by peer]
SamantazFox has quit [Ping timeout: 256 seconds]
arebil has joined #openscad
ochafik_ has joined #openscad
ochafik has quit [Read error: Connection reset by peer]
ochafik_ has quit [Remote host closed the connection]
<t4nk_freenode>
*brr*, printing 2 collars I modified. as to workflows: you do Not want to know how I did it ;)
<t4nk_freenode>
I had some small collars without threading
ochafik has joined #openscad
<t4nk_freenode>
and some large nice ones with a tasty threadintg
<t4nk_freenode>
so I 'workflowed' the threads to the small ones ;)
<lf94>
2 collars?
<t4nk_freenode>
yeah, lock collars that go onto some acme threaded rods
<t4nk_freenode>
eh, leadscrews
<t4nk_freenode>
since they were such a nice fit, and I'm still hopeless at making my own threads
<t4nk_freenode>
not looking forward to taking my machine apart to fit them though
<lf94>
threading in openscad or using some machine
<t4nk_freenode>
hehe no, I'm not a cobbler
<t4nk_freenode>
so threading in OpenSCAD
<t4nk_freenode>
or whatever program
<t4nk_freenode>
ah, well, it's mostly a game of trial and error of course
<t4nk_freenode>
so if I have to, I'll try it, but it's not that I'm over-confident
<t4nk_freenode>
normal threads are mostly unnecessary when 3d printing, at least for me
<t4nk_freenode>
but this trapezoid thread still is a mystery to me
<lf94>
threads are easy if you don't need like ultra precision
ochafik has quit [Read error: Connection reset by peer]
ochafik has joined #openscad
<t4nk_freenode>
well, take these lock collars for example.. I had them on 8mm pitch thread, 8mm diameter leadscrews
<t4nk_freenode>
they were fine
<t4nk_freenode>
then I switched to 2mm pitch screws
<t4nk_freenode>
had to force them on, and it ruined them
<t4nk_freenode>
so there is definitely some need for 'precision'
<t4nk_freenode>
afterwards they were just too loose
ochafik has quit [Remote host closed the connection]
ochafik_ has joined #openscad
<Jack22>
t4nk_freenode: printer leadscrews are four threaded each with 8mm so 8/4 = 2mm distance
kyki has joined #openscad
<Jack22>
also when printing you need to add a bit padding or slice exclusive
kyki has quit [Client Quit]
stonkey has quit [Ping timeout: 250 seconds]
<peeps>
t4nk_freenode: are you talking about cutting threads into (printed/plastic) lock collars so they are no longer lock collars, but leadscrew nuts?
<t4nk_freenode>
yes peeps, well.. there's a nice tight fitting thread in there, but they're also split and have nuts through them to clamp 'em down
<othx>
t4nk_freenode linked to "Adjusting Ring / Shaft Collar 8mm, 10mm M3 by mathiaspl20" on thingiverse => 1 IRC mentions
<t4nk_freenode>
but they have no threads, and the opening for the m3 nuts is way too big so that they aren't held when screwing tight
<t4nk_freenode>
so I put the threads from the one into them
<t4nk_freenode>
and I also narrowed the nut opening
<t4nk_freenode>
ah, I didn't read carefully
<t4nk_freenode>
peeps.. that design looks a lot like the ones I was talking about
<t4nk_freenode>
I guess I got the ones from the person that stole it from yours ;)
<t4nk_freenode>
but if the collar has some threads, then you can put them in place, and then twist them tight, so you can 'preload' some tension in there
<t4nk_freenode>
helps with the backlash
<peeps>
mine are double split, so there should be more range of clamping. also they are parametric with openscad source so you can customize
<t4nk_freenode>
well, I can see why you chose to split them... it is like going through HELL each time you have to take them out or fit them back in
<peeps>
i still don't get are you really using them as leadscrew nuts, or lock collars? lock collars shouldn't need threading
<t4nk_freenode>
well, I tried to explain why; so yes, they are lock collars
fling has joined #openscad
<t4nk_freenode>
But... if they are also threaded.. you can put some tension in them before you tighten them
<t4nk_freenode>
so there is no backlash, at least not from the nuts
<t4nk_freenode>
see?
<t4nk_freenode>
so I have a nut on either end of my leadscrews
<peeps>
still clear as mud. lock collars don't have backlash, period.
<t4nk_freenode>
yeah.. they sit tight... so no backlash
<t4nk_freenode>
my teapot also hasn't got any
<t4nk_freenode>
:b
<t4nk_freenode>
anyhow, I think it's called 'preloading'
<buZz>
i had no troubles though , was just amusing to see :)
<t4nk_freenode>
peeps, "A popular shaft collar variation is the threaded bore collar . They are typically manufactured in one- and two-piece clamp styles because they do not permanently damage the shaft, can be repositioned, and are simpler to remove when compared to set screw collars. Threaded clamping shaft collars are particularly useful in applications with high axial loads and applications requiring fine location or preload adjustments.A popular shaft collar
<t4nk_freenode>
variation is the threaded bore collar . They are typically manufactured in one- and two-piece clamp styles because they do not permanently damage the shaft, can be repositioned, and are simpler to remove when compared to set screw collars. Threaded clamping shaft collars are particularly useful in applications with high axial loads and applications requiring fine location or preload adjustments."
<t4nk_freenode>
oops
<t4nk_freenode>
that was long, sorry
<t4nk_freenode>
mmmzz so the threaded ones come in completely split varieties too... darnit, should have thought of that
<t4nk_freenode>
mine just rolled off the printer
<peeps>
i feel like you shouldn't need the threads. do you have high axial loads on them?
<t4nk_freenode>
well, it's for a cnc machine so there's at least more load than a printer
arebil has quit [Quit: My keyboard has gone to sleep. ZZZzzz…]
<t4nk_freenode>
but in my opinion/experience just shoving them isn't enough to get rid of all the play
<t4nk_freenode>
but yeah.. I tighten the hell out of em just to be sure