teepee changed the topic of #openscad to: OpenSCAD - The Programmers Solid 3D CAD Modeller | This channel is logged! | https://openscad.org/advent-calendar-2021/ | Website: http://www.openscad.org/ | FAQ: https://goo.gl/pcT7y3 | Request features / report bugs: https://goo.gl/lj0JRI | Tutorial: https://bit.ly/37P6z0B | Books: https://bit.ly/3xlLcQq | FOSDEM 2020: https://bit.ly/35xZGy6 | Logs: https://bit.ly/32MfbH5
<M6piz7wk[m]> howddya ehh "mirror" the holes on the board all over it?
<M6piz7wk[m]> ehh
* M6piz7wk[m] goes to get an example image
<M6piz7wk[m]> trying to make a peg board ^
<M6piz7wk[m]> just without the holes at the edges and waiting for FreeCAD to calculate changes for 15 min
<M6piz7wk[m]> \>.>
<M6piz7wk[m]> ehh about the holes i want to have 5mm distance from the edge of the board
<M6piz7wk[m]> ... and preferably the holes offset from each other
<M6piz7wk[m]> |_|O|_|
<M6piz7wk[m]> |O|_|O|
<EkpyroticFrood> If I was doing a peg board I would use this: https://github.com/ringerc/openscad-pegboard-peggrid
<M6piz7wk[m]> oh
<M6piz7wk[m]> and you are giving me this now after i spent 14 h developing it in freecad? aaaaaa
<M6piz7wk[m]> works perfectly.. thanks x.x
<M6piz7wk[m]> i will contrib mounting solution that i've developed though
<EkpyroticFrood> I usually start with a web search, just to make sure I'm not reinventing the wheel.
<M6piz7wk[m]> damned searxfu betrayed me!
<EkpyroticFrood> it happens
<M6piz7wk[m]> i've been printing the FreeCAD design for 6 hours man
<gbruno> [github] t-paul pushed 1 modifications (Add spdx.org links.). https://github.com/openscad/openscad.github.com/commit/34745db2c71532e7bd36d66a6a1450bd25a8bb19
<JakeSays> teepee: it's like docker - it installs layers, and it's slooow.
<teepee> yes, it's a container with "runtimes" to share some of the files
<teepee> where appimage is really just a glorified zip file (in a good way) similar to how MacOS does those "Bundles"
<JakeSays> i like the single file of appimage
ur5us has joined #openscad
<JakeSays> flatpak is too snap'ish
<teepee> both have their pros and cons
<teepee> in theory flatpak/snap could be better if the interation issues were solved
<teepee> appimage has the problem that it needs to build on the oldest supported platform, which can introduce really hard to solve issues
<JakeSays> i'm sure they're great for servers or something, but (especially snap) i do not like them for my workstation
<teepee> on server I'd really prefer the classic packages
<JakeSays> me too
<teepee> the container logic could bring some extra security by isolating the apps and only giving access to what's needed
<teepee> but that's not an easy thing to solve
<JakeSays> for things like kicad and other interactive apps i don't want any restrictions.
<JakeSays> i tried the kicad flatpak and none of the directories off of / that i use on a regular basis were available
<teepee> I think you can connect those, which is not a bad idea in general
ur5us has quit [Ping timeout: 240 seconds]
<JakeSays> i can, but i don't want to have to
<teepee> sure, it would be nice to have all the options easily available
<teepee> I do like the idea to not have any application having access to just everying on disk
<JakeSays> it doesn't bother me. things that shouldn't be written to are not writable
<teepee> it's not just writing, being able to read all of /etc is not needed for most apps either
<JakeSays> i have a non-standard directory layout
<teepee> now I don't see a huge problem with kicad
<teepee> but things like appimages people use from services like Telegram, Discord, Teams, Spotify, ....
<JakeSays> i dont think i'm using appimages for any of those
<teepee> e.g. I need Teamviewer installed and it would be nice to have a simple way to restrict that
<JakeSays> although i don't use teams on linux
<JakeSays> i don't use my home directory for much of anything
<teepee> that's the good part, having options :)
<JakeSays> yup
<JakeSays> i use zfs datasets for most everything
<teepee> on linux or bsd?
<JakeSays> linux
<teepee> so openzfs works well?
ur5us has joined #openscad
<JakeSays> well, this is zfs for linux. i'm not exactly sure what its relationship is with openzfs
<JakeSays> but zfs4linux works amazingly well
<JakeSays> i recall reading once that zfs4l was going to be moved under openzfs, but not sure if that happened
<JakeSays> heh. kicad is working surprisingly well
<JakeSays> or i'm working well with kicad
<teepee> ah,ok, I thought any linux zfs is openzfs nowadays, but I did not really have a closer look
<teepee> I mean to try it at some point, but maybe btrfs first as that might be the one my company is going with in the future
<JakeSays> i've never heard anything good about btrfs
<teepee> kicad really has come a long way, it's really impressive on the move to more features and being easier to use
<JakeSays> i think i've gone about as far as i can w/o doing some reading
<JakeSays> doesn't kicad have an auto router?
J2261 has joined #openscad
J22 has quit [Ping timeout: 256 seconds]
<teepee> not sure, I think there's only external ones that can be called, but I never tried that
<JakeSays> hmm. the docs haven't caught up to version 6
splud has quit [Ping timeout: 260 seconds]
<linext> i need some good project to work on
ur5us has quit [Ping timeout: 240 seconds]
<M6piz7wk[m]> is there a less stupid way to declare a wedge in openscad?
<M6piz7wk[m]> module `p_board_mount();`
califax- has joined #openscad
califax has quit [Ping timeout: 276 seconds]
califax- is now known as califax
qeed has quit [Quit: qeed]
qeed has joined #openscad
<JakeSays> M6piz7wk[m]: you can pass functions
<M6piz7wk[m]> <JakeSays> "6piz7wk: you can pass functions" <- pass meaning?
<JakeSays> they're first-class citizens, so you can pass them to modules/other functions
<M6piz7wk[m]> that's the idea i want to implement them in the p_board module, but i don't like the declaration as it's hack using cylinder with $fn = 1 and lot of transforming and rotating
<JakeSays> hack for what
<M6piz7wk[m]> to create the wedge shape
<M6piz7wk[m]> eh? that seems way more complicated
<JakeSays> it works
<JakeSays> not sure what yours is trying to do
<M6piz7wk[m]> add a mounting solution to the peg board so that it can connect two boards together bcs i am limited by the 3D printer on 235x235x60 dimensions and need 4000x2000 board
<M6piz7wk[m]> so i want to use a wedges and then connect them with a clip
<M6piz7wk[m]> yellow representing the overscaled wedge shape (it's 20x30mm in real scale)
<M6piz7wk[m]> green representing the mounting solution
<M6piz7wk[m]> red representing the peg board
<M6piz7wk[m]> it was using a non-wedge before, but that is hard to fabricate on a 3D printer without supports so wedge is better design
<M6piz7wk[m]> ... also the mounting solution is expected to have a wall mounting solution but i ain't at that phase left
<M6piz7wk[m]> *phase yet
<M6piz7wk[m]> correction: the wedge shape is more like this
<M6piz7wk[m]> as there has to be at least 10mm of material for the wedge to not rip off from the peg board on load
<M6piz7wk[m]> So more like this actually.. where i am trying to do the yellow shape
<JakeSays> yeah that's not a wedge at all
<InPhase> M6piz7wk[m]: I did one of those. One moment.
<InPhase> M6piz7wk[m]: This mounts very snugly on the wall with a slide-down wedge like mount. https://www.thingiverse.com/thing:3024698
<othx> InPhase linked to "Toothbrush / Toothpaste Holder, Philips Sonicare and More by rcolyer" on thingiverse => 3 IRC mentions
<InPhase> That was robust enough to survive abuse by the destructive children who used it for at least a year until I sold the house.
foul_owl has quit [Ping timeout: 250 seconds]
<M6piz7wk[m]> InPhase: That seems to be defining a complex polygon.. i don't think i have that option assuming that the design is scalable and is expected to be double mirrored
<M6piz7wk[m]> .. at least it would need a lot of complex calculations for the coordinates
<JakeSays> M6piz7wk[m]: why couldn't you define your own polygon?
<JakeSays> you only need to define the polygon once
<InPhase> M6piz7wk[m]: Well I didn't imagine you would copy/paste it for a completely different type of design. :) But sometimes a reference example which previously worked helps.
<JakeSays> M6piz7wk[m]: your polygons are pretty straight forward
<InPhase> If I did it over again, I'd probably angle the top of the wall-mounted wedge piece inward a little for easier insertion.
foul_owl has joined #openscad
<InPhase> I recall the handful of times I slid it off to clean it, there was a little bit of wiggling involved with reinserting it. This wasn't a big deal because it doesn't need done often, but it's always nice to have a thing slide together with ease.
<M6piz7wk[m]> <JakeSays> "6piz7wk: why couldn't you define..." <- because then you have to do a calculations for the coordinates?
<M6piz7wk[m]> and the design scales with size.. so that seems like a nightmare to do
foul_owl has quit [Ping timeout: 256 seconds]
<JakeSays> M6piz7wk[m]: you define the polygon and then you translate/rotate it
<JakeSays> M6piz7wk[m]: in what sense does it scale with size? (also, scaling is easy)
<M6piz7wk[m]> JakeSays: projected to scale after 400x400 by 0.5% per 50x50
<M6piz7wk[m]> trying the polygon now
<JakeSays> so the whole thing scales in 3 dimensions?
<M6piz7wk[m]> projected to yes, but currently not important to handle
<M6piz7wk[m]> also it will be double mirrored so that the shape is on all 4 corners.. so polygon a bad idea?
<JakeSays> not at all
foul_owl has joined #openscad
<M6piz7wk[m]> i have no idea how to define the polygon and i am about to throw my 3D printer through the monitor
<JakeSays> lol
<JakeSays> InPhase: so is there an issue with subtracting a polyhedron from a cube?
<InPhase> Only if it's a malformed polyhedron, which is easy to do.
<JakeSays> it doesn't render correctly in preview mode, but the render is fine
<InPhase> Do View Thrown Together on the polyhedron and look for the purple faces that indicate a bad winding order.
<InPhase> Hmm. Usually it's render that messes up and preview that is fine. Although a particularly complicated design will sometimes have a convexity issue in preview mode.
<JakeSays> lol every side is purple
<InPhase> Okay, well fix those. ;)
<JakeSays> i took the faces directly from function render()
<M6piz7wk[m]> like it keeps doing this oxen.io logos
<M6piz7wk[m]> instead of my shape
<JakeSays> M6piz7wk[m]: try these points: [[0, 0],[10, 0],[20, 30],[0, 30]];
<InPhase> M6piz7wk[m]: Because it goes in the order you specified, which traces out a z-shape.
<InPhase> M6piz7wk[m]: Instead, order them to trace the perimeter.
<M6piz7wk[m]> oh
<JakeSays> M6piz7wk[m]: it's a lot easier to draw a 2d polygon and then extrude it
<M6piz7wk[m]> > [0,-0],
<M6piz7wk[m]> is that -0 important?
<JakeSays> no
<M6piz7wk[m]> so now just extrude it and position it?
<JakeSays> yes
<JakeSays> extrude then rotate 90 on the x axis
<M6piz7wk[m]> `linear_extrude` ?
<JakeSays> yes
<M6piz7wk[m]> Seems to work perfectly now thanks
<M6piz7wk[m]> ^-^
<M6piz7wk[m]> oh cool thanks!
<M6piz7wk[m]> can i do `mirror()` from inside a module that defines the shape or does it have to be outside?
<JakeSays> i've never used mirror
PovilasCNC has joined #openscad
<M6piz7wk[m]> apparently it has to be outside https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#mirror or like is there a better way to place the shape on all 4 corners?
<M6piz7wk[m]> ... with the other 3 shapes dependent on the first one
<JakeSays> just rotate/transform it
<JakeSays> M6piz7wk[m]: i updated that gist
<JakeSays> M6piz7wk[m]: remember that a module only operates on it's children()
<M6piz7wk[m]> oh i see
<M6piz7wk[m]> thanks ^-^
splud has joined #openscad
GNUmoon has quit [Remote host closed the connection]
GNUmoon has joined #openscad
<M6piz7wk[m]> Oh i can generate polyhedron and polygon from FreeCAD.. that seems less painful in comparison O.o
nanoflite has joined #openscad
ur5us has joined #openscad
ickk has joined #openscad
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
J2261 has quit [Ping timeout: 256 seconds]
<Scopeuk> for that sort of shape if using the polygon tools I would probably work in 2d and then linear extrude https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#polygon using just the points argument is much more intuitive to me
<Scopeuk> which it turns out is what you did
* Scopeuk apparently skipped some important bits
ur5us has quit [Ping timeout: 240 seconds]
<M6piz7wk[m]> heh
ccox_ has quit [Ping timeout: 240 seconds]
siege has quit [Ping timeout: 268 seconds]
siege has joined #openscad
tcurdt- has joined #openscad
tcurdt has quit [Ping timeout: 268 seconds]
<M6piz7wk[m]> figured out that writting the shape down on a paper to figure out the coordinates makes the polygon definition painless
niyawe_ has quit [Ping timeout: 268 seconds]
niyawe has joined #openscad
<Scopeuk> that's fair, probably even easier on squared papper
<M6piz7wk[m]> good idea
ickk has quit [Ping timeout: 260 seconds]
ickk has joined #openscad
voxpelli has quit [Ping timeout: 250 seconds]
voxpelli has joined #openscad
raboof has quit [Ping timeout: 252 seconds]
Joel has quit [Ping timeout: 250 seconds]
raboof has joined #openscad
fling has joined #openscad
Joel has joined #openscad
J22 has joined #openscad
<J22> you can make a  module that is naming and showing coordinates for each point
lastrodamo has joined #openscad
ccox has joined #openscad
nanoflite has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ochafik has joined #openscad
ochafik has quit [Remote host closed the connection]
ochafik has joined #openscad
ochafik has quit []
ickk has quit [Ping timeout: 260 seconds]
nanoflite has joined #openscad
snaked_bruh has quit [Ping timeout: 256 seconds]
snaked_bruh has joined #openscad
TheAssass1n has quit [Remote host closed the connection]
TheAssassin has joined #openscad
JakeSays has quit [Ping timeout: 250 seconds]
JakeSays_ has joined #openscad
snaked_bruh has quit [Ping timeout: 240 seconds]
snaked_bruh has joined #openscad
snaked_bruh has quit [Ping timeout: 256 seconds]
<lf94> I am such in a bind. I don't know what to do. All the Code CAD have weaknesses.
<lf94> OpenSCAD can't do really funky stuff like generate complex lattice, without heavy computation
<lf94> But it can do everything else
<lf94> CADQuery is the same, but can't really do CSG, which is huge for me.
<lf94> Curv is horribly inefficient, and so can only generate certain models which don't output massive GLSL files.
<lf94> And finally my solution Epifaneia is just so much work on my own.
<lf94> But solves all the above.
<lf94> And I don't want to use multiple languages. One language is enough.
* teepee looks at the channel topic
<teepee> well, I guess the answer you'll get *here* is pretty clear
<teepee> although I have said in other place that I'd like for people considering dev work to at least consider joining an existing effort
* teepee points at one of the earlier FOSDEMs
<teepee> 10:00 "how I created a new PCB CAD tool to fix the kicad library handling"
<teepee> 14:30 "how I designed a new project because kicad libraries are not fixable"
<teepee> 16:00 kicad: how our new library handling solves commonly reported issues
<teepee> * slightly paraphrased ;-)
snaked_bruh has joined #openscad
<lf94> Yes teepee, this is the core of my problem.
<lf94> I am now divided as to where to put my efforts.
<lf94> I am considering things like: what would it take to offset some computation to GPU for OpenSCAD?
<lf94> With my new found WebGPU knowledge, I should be able to do this, if I choose to
<lf94> My other issue with OpenSCAD is "legacy cruft", but, this is not really a problem at the end of the day.
<lf94> I'm so stuck x_x
<Scopeuk> lf94 I guess i would suggest accepting multiple languages as the compromise, no tool is perfect for all circumstances and having the approiate tools in the kit is as important as having any one of those be the best of its kind
<Scopeuk> I enjoy working with c and knowing every register twiddle etc on a micro but sometimes the right tool is to cludge together a handful of libraries from the arduino ecosystem
<lf94> Not true though. There can be a single language tool that can satisfy it all.
<Scopeuk> But would it be three languages in a trench coat?
<lf94> No, it would be JS and WGSL
<lf94> One for high level, and one for low level
<lf94> This is openscad's biggest weakness
<lf94> You can't deconstruct sphere
<lf94> But it's futile to work on a separate project. It really is.
<Scopeuk> There is an effort that moves the underlying geometry into userland using point clouds, i forget which of the regulars created it. It allows that flexibility. I doubt its quite the freedom you are looking for. As with many of these things anything is a tradeoff. Usually with power/flexibility comes complexity and a higher barrier to entry. It also
<Scopeuk> tends to lead to a situation where a simple option is skipped over because a more complex solution to achieve the end is implimeted
<lf94> I might use openscad for the core modeling, and blender for fancy stuff, like surface texturing.
<lf94> Curv is nice, but it's export story is terrible.
<Scopeuk> I would argue a collection of tools that achieves the ends is a good compromise
<Scopeuk> It is a compromise and imperfect but its better than spending forever hunting perfect
<lf94> Yeah.
<lf94> I want to create things. Not be stuck.
<teepee> that's the beauty of joining an established project, if you can get your self unstuck, that may do the same for a number of other people too
<teepee> now sharing source code on github is great, but not everyone can build and run that, and maintaining this is quite some work
<teepee> moving the CSG stuff into GPU would be awesome, potentially as library that compiles to WASM too, so it would even open up more flexibility
<teepee> I've been looking at this "realtime CSG rendering" stuff but I'm not clear how it works yet. but even OpenCSG on GPU would be cool
<InPhase> lf94: Implement a built-in for OpenSCAD which turns function literal based SDFs into mesh geometries.
<lf94> I have no idea how I'd do that :/
<InPhase> Steal.
<lf94> teepee: real time CSG is different because openscad is mesh based, but SDFs are ... pixel based?
<lf94> CSG is just super cheap
<teepee> yes, and having both would be nice too
<teepee> you said offloading stuff from openscad to GPU
<lf94> InPhase: don't we already have functions in openscad that can create polygons?
<lf94> ah, yea
<teepee> which *at this point* would be mes
<lf94> As in, compute shader
<teepee> mesh
<InPhase> It seems apache 2.0 code, which curv is under, can be shoved into GPL projects.
<lf94> InPhase: well I could shove my project in too, but it involves Rust and JS.
<InPhase> I don't know if there are sdf processing pieces that are useful there or not. Maybe libfive alone is enough.
<lf94> Yes, libfive is probably enough
<InPhase> But I think going in that direction opens up the pathway to solve those hard problems in OpenSCAD while still riding on the back of the good computational geometry tools, export tools, and other aspects.
<InPhase> Plus it would really put those nice function literals to solid use.
<InPhase> The best practical solutions are not pure, because pure solutions tend to not fit the diversity of real world problems. Multi-paradigm languages dominate the programming world for a reason.
<InPhase> So it seems reasonable to go with multi-paradigm CAD.
<lf94> So to make sure I understand: you propose we translate OpenSCAD functions to say, libfive functions?
<lf94> This sounds actually very feasible.
<lf94> Like, "I can do this in a week" feasible
<lf94> (On top of you know, regular work)
<InPhase> sdf_mesh(myfunction_that_calls_many_other_functions); // Magic things happen
<InPhase> Or something like that.
<teepee> alternative, tag a subtree with something like @SDF
<InPhase> With a specification for the expected parameters of the top-level functions that get passed to the sdf_mesh (or by another name).
<InPhase> teepee: Well function literals are the perfect thing for this. Modules don't return values, so it's a different sort of syntax than our usual geometry creation. But passing one into something works with normal language flow.
<InPhase> Then it's like a polyhedron call, except potentially a lot more useful.
<teepee> true, this would give even more flexibility
<teepee> but even rounded union might like implictcad would be an incredible useful step
<InPhase> And library support for such a built-in could get quite intensive. And then we can decide what library features to bundle in later if it turns out to be high value.
<lf94> You guys would be ok with vendoring libfive?
<teepee> if that brings useful features and builds on all platforms, why not
<InPhase> I think we mark it experimental, but it seems very sensible to me.
<teepee> well, and we don't do lisp :P
<InPhase> The core of libfive appears to be all C++.
<InPhase> But I assume we'd treat it like a library and not try to merge it.
<InPhase> There's already an active team working on libfive.
<InPhase> Development on it seems to have picked up massively last year.
<teepee> oh, yes, "using as library" is pretty much the only option
<InPhase> If it works well, this could potentially be high on the list of top major changes to OpenSCAD in terms of really changing what can be done.
<InPhase> Function literals were important, and basically setup for this. I'm still very excited about that massive speed boost PR, data = render() is potentially big introducing reflection, and bundling in sdf support opens a flexibility flood gate for smoothness.
<lf94> Well it's essentially interfacing with libfive via openscad, right?
<lf94> I'm really coming full circle.
<lf94> openscad -> cadquery -> curv -> my own solution -> openscad
<lf94> I can port this to openscad also: https://github.com/curv3d/svg2curv, but turning it all into sdf functions.
<lf94> Also, port my sketching api.
<lf94> csg + sketching is so immensely powerful. That's why I really loved Curv.
<lf94> (because it could do csg super well, and also newer than openscad)
<lf94> But Doug has disappeared. I'm actually worried he might have died.
<lf94> I've been looking around at obituaries but none. I know where he lives and his name, but yeah, nothing.
<teepee> lets hope he has not, one of those messages per month is really enough :/
TheAssassin has quit [Ping timeout: 276 seconds]
TheAssassin has joined #openscad
JakeSays_ has quit [Ping timeout: 256 seconds]
<lf94> Maybe I should just do JS bindings to libfive.
<lf94> Gah, there are way too many paths to take.
<teepee> your time, your decision
<teepee> I personally don't see much use in that
<teepee> but if you want to have it, go for it
<teepee> otherwise, I agree with InPhase the overall opportunities with openscad are much bigger ;-)
<lf94> Minkowski and hull really are the two features which would not be possible in libfive.
JakeSays has joined #openscad
<lf94> or anything
<lf94> Also: I cannot get over the precision of 3D printers. My printer is printing at 0.2mm diameter, and 0.18mm height. It's incredible to see the lines.
<teepee> yeah, that's a restriction we may get when trying to export STEP too
<lf94> You guys are trying to export to step?
<lf94> interesting
<lf94> With my sketch api, I am thinking of keeping edge data along with operations
<lf94> So you can traverse it and do stuff with them
<lf94> like fillet
<lf94> no more annoying manual fillets
<teepee> there's no code that's anywhere near usable, but there's some sort of demo PR for an external tool and the disucssion comes up always
<lf94> I've been developing a sketch api that is CSG agnostic, as long as it supports an operation to create closed shapes.
<lf94> So, I could easily bring this to openscad also. It started in Curv.
<lf94> I'm currently stuck on implementing all the arc sketch operations. The math is hard for me :-
<lf94> :\
Matt76 has joined #openscad
<lf94> For me the most interesting aspect of the sdf function will be: surface textures, and smooth union.
<lf94> That will cover _everything_ I ever want from a code cad tool.
<lf94> engineering, csg, organic.
<lf94> It can be done. But the man power needs to exist.
<M6piz7wk[m]> do you find this understandable?
<teepee> indeed, you that only happens by growing very very slowly, or by some magic event (which is pretty rare)
* M6piz7wk[m] is trying to optimize his code so that it's readable by 3rd party
<teepee> wie did discuss a sketching api, I even looked at metafont which has some neat ideas
<teepee> *we
<teepee> one of the possibilities would be to have polygon() allow child modules instead of the parameters
<teepee> like polygon() { point([0, 10]); line_to([10, 10]); }
<teepee> so at transition to that polygon it would need to ensure it's closed
<lf94> teepee: I've copied the sketching api that cadquery has, because a lot of people like it.
<teepee> similar like that old PR about having sort-of 2.5D entities combined by extrude() { square(); translate([10, 20, 30]) circle(); }
nanoflite has quit [Ping timeout: 268 seconds]
<lf94> teepee: this is something I can _easily_ port from my system over to openscad. or libfive. or anything really.
<M6piz7wk[m]> probably more like this so that it's aligned
<teepee> M6piz7wk[m]: I think I understand pretty clearly what it's trying to show
ur5us has joined #openscad
* M6piz7wk[m] added the example to https://en.wikibooks.org/w/index.php?title=OpenSCAD_User_Manual/2D_Primitives&stable=0#polygon on request
<teepee> lf94: do you have some example how the sketching would look like in openscad?
<lf94> I do! Because Curv code is very similar to that of Openscad.
<teepee> one of the ideas for the sketching would be also to have the ability to convert text and svg to openscad 2d sketching code
<teepee> at least for text that should not need too much features, basically just lines and 2nd/3rd order beziers
<gbruno> [github] Kreyren opened issue #4075 (Implement sketcher to make prototyping more efficient). https://github.com/openscad/openscad/issues/4075
<gbruno> [github] Kreyren edited issue #4075 (Implement sketcher to make prototyping more efficient). https://github.com/openscad/openscad/issues/4075
<JakeSays> teepee: what is sketching code?
<gbruno> [github] Kreyren edited issue #4075 (Proposal: Implement sketcher to make prototyping more efficient). https://github.com/openscad/openscad/issues/4075
<InPhase> lf94: 95% of the usages of minkowski in OpenSCAD are trying to do things sdf would have done better. This is where the power of a merged solution kicks in where we can do sdf components in OpenSCAD.
<M6piz7wk[m]> ooops sorry didn't know it spams the chat
<JakeSays> lf94: speaking of curv, what does '<<' mean?
<JakeSays> or is it >>
<teepee> JakeSays: a slightly different style of defining 2D shapes using constraints
<InPhase> lf94: I wish I knew the actual userbase size of OpenSCAD, but I don't know how to measure it. One thing I'm pretty sure of is that it is extremely massive. I often talk to random people with no project affiliation and they've already used it.
<InPhase> lf94: So the impact is guaranteed to be large.
<teepee> M6piz7wk[m]: how it could look like, lf94 might show in a minute or two ;-)
<M6piz7wk[m]> eh?
<teepee> not sure if you followed the discussion, but we are just talking about the sketching code lf94 worked on (which I think is currently based on curv?) but might be possible to add to openscad too
<teepee> if it's similar to what cadquery does, their documentation might give an indication too
<JakeSays> teepee: i thin it's kind of ugly
<teepee> what is? the cadquery style of 2d sketching?
<JakeSays> curv's '>>'
<lf94> > also to have the ability to convert text ...
<teepee> ahh, yeah
<lf94> teepee: exactly. I have done this basically too.
<lf94> svg2curv was planned to do this.
<lf94> Sorry, I'm quite busy atm, will get that code for you
<teepee> well, we have the reading part of the code already :)
<teepee> just right now it's generating the 2d polygons directly
<InPhase> JakeSays: Well we don't need the curv syntax.
<JakeSays> InPhase: good. lol
<InPhase> JakeSays: I think the OpenSCAD syntax is pretty accessible to new designers, and is reasonably self-consistent. What we'd want is the core sdf features integrated smoothly.
<M6piz7wk[m]> teepee: oh i didn't know you were talking about it O.o
<lf94> teepee: that's what mine is doing too.
<JakeSays> i'm going to have to read about this sdf thing
<teepee> JakeSays: for interesting overview, maybe check the iq pages
* teepee goes finding the link
<InPhase> JakeSays: I have three words for you. Inigo Quilez youtube
<InPhase> I mean, then you have to read about it to understand, but that's the motivating example. :)
<InPhase> The libfive site also has a few select examples which are compelling.
<M6piz7wk[m]> FWIW i was thinking something like making a line:... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/3b9b5f814b00afde3e5a6d4a77011dd7876e40ca)
<teepee> actually the article from colah (original implicitcad author) is also a good introduction IIRC
<M6piz7wk[m]> yep libfive has interactive editor so that you can drag on shape to change it's dimensions
<JakeSays> ok he needs to start his article with "SDF stands for..."
<teepee> not sure that blog post is still online :(
<teepee> M6piz7wk[m]: hm? converting ascii drawings into code? that seems a bit strange
<lf94> This is an example using both "builder" and "sketch" api
<lf94> builder allows you to use a relative coordinate system.
<lf94> I could easily bring this over to openscad.
<lf94> I forget openscad's semantics, it's been awhile.
<teepee> I guess the first question is how to solve ordering as openscad logic is basically calculating from inside to top level
epony has quit [Quit: QUIT]
<lf94> Ah. Curv it's just functional programming
<lf94> >> just passes the output to the argument of the next
<lf94> otherwise it'd be paren city
<teepee> I know, that's not the question
<lf94> Surely there's a way to write sequential code in openscad?
<teepee> putting it into openscad it should not feel like a 2nd language inside
<teepee> yes, single statements :)
<lf94> It shouldn't? Why shouldn't it
<lf94> Sketching is that...a 2D language
<teepee> well, not strictly true, I suppose when being very strict, there's nothing sequential in openscad except let()
<teepee> ahm, no actually variable assignments are sequential too
<lf94> I find Curv is so close to a lisp/scheme, that it makes me wonder if working directly in libfive is just the best thing to do
<lf94> I dunno, I need some guidance, and OpenSCAD being the grandfather here, that's why I'm talking here. XD
<lf94> I agree with InPhase, the community is massive
<teepee> if you just want something *now* it's certainly faster going with one of the existing language bindings
<teepee> which this channel gives a thubs up for, as it's nice open source stuff :)
<teepee> but it's off-topic :D
<teepee> (also a thumbs up too)
<teepee> or whatever the correct spelling is
<teepee> the plus side of getting this into openscad would be to be able to use it in a much easier way later for multiple projects
<teepee> as I very much with InPhase that one of the bonus points of openscad is the easy to use language without huge boiler plate
<teepee> yes, it's not a well designed language, it's a tool to get stuff done
<teepee> that's history and not changable without inventing a time machine ;-)
<lf94> What's the boilerplate for libfive?
<lf94> or other code cad
<teepee> it's a coding library so the "boiler plate" in a wider sense is writing a program in c++ in the first place
<teepee> or use a language binding and the boiler plate in there, e.g. for python the import stuff and maybe the generation
<teepee> well, basically anything other than "cube();" :)
<teepee> that's easy to teach
<teepee> "import this library, then use those functions to create the cube geometry and then call that to export as STL" is slightly more to teach
<lf94> ah. yeah, not great
<lf94> default import everything is much better ux.
<lf94> (in this case)
<teepee> if you have a very complex design and someone who knows some programming it might not matter a huge amount
<teepee> giving it into the hands of a new owner of a 3d printer to print some simple stuff, this can make a huge difference
<lf94> I was thinking making a DSL in my Epifaneia project even, because JS supports something like that using named templated.
<lf94> templates
<lf94> code`stuff goes here`
<lf94> Where "code" is a function
<lf94> that takes the text and does parsing and stuff
<lf94> You guys don't want to join me on my journey eh? :ppp
<lf94> Rust + JS, can now union 100,000 spheres
<lf94> foveated rendering will make it possible to union 1,000,000 spheres
<lf94> in almost real time
<lf94> in terms of "help", I just need people to use it, give feedback, and hopefully use it until death. :D
<lf94> If I took a year to develop it I could probably start a small following
<teepee> interested in theory, yes. joining, no
<lf94> Turns out Doug is ok. Just dealing with things.
<lf94> He replied to my email
<teepee> very good news
<JakeSays> this sketching thing sounds like logo
<JakeSays> sounds/feels
<JakeSays> gimme mah turtle!
<JakeSays> bosl2 has a turtle. it's actually kind of handy
<M6piz7wk[m]> I should do this for everything.. it makes it so much easier to script the object
<M6piz7wk[m]> (making change and then putting in `H` to know where i am and what needs to be calculated)
<teepee> yeah, it's simple for a number of cases
<teepee> constraint sketching is a bit more flexible
<JakeSays> M6piz7wk[m]: you could use a turtle
<M6piz7wk[m]> <teepee> "6piz7wk: hm? converting ascii..." <- ehh not ascii drawing i just use those as a helper
<M6piz7wk[m]> JakeSays: eh?
<JakeSays> M6piz7wk[m]: a logo turtle. it makes defining polygons easier
<JakeSays> instead of building point arrays, you use commands to move the turtle, like movex(50),left(10), etc
snaked_bruh has quit [Ping timeout: 256 seconds]
snaked_bruh has joined #openscad
<M6piz7wk[m]> is that a thing in openscad or is that a 3rd party lib?
* M6piz7wk[m] can't find it in the book
<JakeSays> third party lib
<M6piz7wk[m]> i see, is that any different from what i am doing though?
<JakeSays> it just makes defining polygons easier is all.
<lf94> JakeSays: basically.
<JakeSays> especially when it comes to angles, etc
<M6piz7wk[m]> oh i see
<lf94> teepee: https://github.com/lf94/Epifaneia/blob/main/template.wgsl.js#L128 this is basically where openscad needs to go.
<M6piz7wk[m]> so instead of coordinates you do like "turn left and go 5mm" then "turn left 45 degrees and go 10mm" ?
<lf94> M6piz7wk[m]:yes
<M6piz7wk[m]> cool
<lf94> it's a standard way to do it in regular cad tools
* M6piz7wk[m] is not aware of that in FreeCAD
<lf94> teepee: maybe the ultimate is writing a meta language that compiles to openscad and libfive. lol
<JakeSays> lf94: what is that js code doing?
<lf94> basically it's creating a scene of a sphere, and outputting the shader code
<lf94> to be rendered by my rust code
<teepee> nope, it's not
<lf94> I defined a bunch of primitives above it
<JakeSays> why are you using js and rust?
<lf94> because Curv can't do it
<lf94> no it isn't
<lf94> I just don't know C++ good enough
<JakeSays> teepee: best xkcd ever
<lf94> compare my code to Curv or openscad - it's magnitudes simpler
<teepee> hehe, I have about 100 of "the best xkcd" :)
<lf94> a really experienced person couldve done this in a night
<lf94> Unfortunately I'm not experienced in this field
<teepee> classic https://xkcd.com/221/
<JakeSays> teepee: LOL that's another excellent one
<lf94> I also can't really improve Curv right now because Doug is working on it
<lf94> It'll step on his feet
<lf94> So I'm doing this to learn WebGPU
<lf94> Which I've done, successfully
<JakeSays> lf94: wait so that js code is generating rust code?
<lf94> no, that js is generating WGSL
<lf94> JS -> WGSL, then WGSL is fed into Rust :)
<teepee> I do love the geek-and-poke ones, but I suspect there's no new ones https://geekandpoke.typepad.com/geekandpoke/2012/04/simply-explained-gv.html
<lf94> You could also feed the WGSL into the web browser.
<lf94> The biggest issue I have right now is export then.
<lf94> I have no idea how to do cube marching or any of that
<JakeSays> so what part of this do you think openscad should support?
<teepee> you could watch the floppine videos, although that's for display, not for data export
<JakeSays> lf94: so you wrote a wsgl interpreter in rust?
<lf94> No, I'm using wgpu to run it
<JakeSays> you like rust?
<lf94> JakeSays: OpenSCAD needs to support being able to create new primitives from a lower level language
<lf94> Yeah, Rust is nice for things
<lf94> Just as JS is :)
<JakeSays> js is not nice for anything. it's a necessary evil.
<lf94> Also, OpenSCAD has no GPU acceleration
<lf94> ...
<lf94> we wont get into that here X)
<JakeSays> js's only redeeming quality is that it's better than python. lol
<JakeSays> actually modern js is getting better
<teepee> "no" gpu acceleration is wrong
<JakeSays> lf94: adding a lower level language to openscad jeopardizes its ease of use, which is a HUGE factor.
<JakeSays> oscad's barrier to entry is extremely low.
<teepee> yep, lets keep it that way while making it more powerful for people who want to use that :)
Matt76 has quit [Ping timeout: 256 seconds]
default__ has quit [Ping timeout: 250 seconds]
<lf94> teepee: sorry, you're right
<JakeSays> teepee: but i do think there could be value in having a lower level language that openscad can use to build new primitives. such a language wouldn't be available to the end user.
<teepee> JakeSays: right now that's limited to c++, integrating something else would be possible but at this point very likely not maintainable
ferdna has joined #openscad
<JakeSays> why wouldn't it be maintainable?
<teepee> at this point kintel is luckily doing MacOS stuff, all other builds are pretty much on me (except linux distro packaging)
<teepee> and while I would like to have a 30h day, that's not granted so far
<JakeSays> i'm not sure i follow.
<teepee> each dependency can and will change at any point in time, OS versions, libraries with new versions, compilers with new versions
<teepee> e.g. there's just a new CGAL version out, which we probably want to use
<teepee> so going round updating all the builds, while partially automated is still quite some work
<JakeSays> i wasn't talking about requiring new compilers, etc. this would be a part of openscad
<teepee> and updates on platforms tend to break builds also
snaked_bruh has quit [Ping timeout: 268 seconds]
<teepee> I did play with a python("<write some python code which will generated data>") and that's not trivial and also would break anything we have as plus in regard to security on server side
<JakeSays> yeah i'm not sure we're talking about the same thing
<teepee> possible
<JakeSays> i'm talking about a DSL implemented in c++ inside oscad
<teepee> so what would that lower level language do as a specific example
<teepee> a DSL inside a DSL?
<JakeSays> i dont think so, no.
<JakeSays> i dont see it being based on openscad code
<teepee> then I'm lost what it means
<JakeSays> "implemented in c++ inside oscad" - oscad == the binary, not the scad language
<teepee> yes, I understand that part, but the user level side of openscad scripting is already a DSL
<JakeSays> correct
<teepee> so it would be like use current script or use a completely other script but not mix?
<JakeSays> this would be a "system dsl" so to speak
<JakeSays> the latter
<JakeSays> a microcode so to speak
<teepee> not being able to mix scripts would be like 2 applications in one?
<JakeSays> no
<JakeSays> primitives of scad are implemented in.. fooscript
lastrodamo has quit [Quit: Leaving]
<JakeSays> so for example new_super_cube() would be implemented with a bunch of fooscript instructions instead of c++
<teepee> what would it have over using either scad (user level library) or c++
<JakeSays> easier to implement
<JakeSays> assume that feature X is complicated. doing so in c++ would require a lot of work and it's not feasible to do it in scad
<JakeSays> teepee: actually, i think it's very similar to what the csg product dump view shows
<JakeSays> although i'm not sure lisp would be my choice. lol
<JakeSays> or maybe the csg tree
<JakeSays> so perhaps new_super_cube() is written in "csgscript", etc
<teepee> csg tree actually *is* scad code, just simplified without modules and functions
<teepee> (minus some glitches with NAN and INF)
<JakeSays> will it compile as scad code?
<teepee> yes
<JakeSays> oh cool
<teepee> not that lisp style product stuff, that's the tree for preview
<teepee> what you can export as *.csg files
<JakeSays> i didn't even know group() existed
<teepee> yeah, another of those glitches, it's probably not supposed to be public but it leaks via CSG
<teepee> and it's valid code too
<JakeSays> very interesting
<teepee> I believe that was meant to be transfer to slicers which would be able to slice that directly
<JakeSays> so as an end user are there things i can do in csg that i can't do in "public" scad?
<teepee> but I'm not sure that ever existed
<teepee> no, I don't think so
<teepee> I think it's essentially a subset of scad. ignoring the glitches it's a strict subset
<JakeSays> i just looked at the csg for one of my designs. very interesting
<JakeSays> lol sure enough. i pasted it in to a new scad document and it worked
<JakeSays> would be an interesting way to obfuscate code
<teepee> if you put in some 1/0 it probably fails as it exports something like "a = inf;" which would then not parse
<JakeSays> well, probably the only way my fooscript concept would be useful is if it was maybe a higher level shader language or something.
<M6piz7wk[m]> Is there any default path that is used by OpenSCAD for 3rd party libs?
<teepee> yes, it's shown in help->library info
<M6piz7wk[m]> thanku
<teepee> or file->open library folder
<M6piz7wk[m]> found `/home/kreyren/.local/share/OpenSCAD/libraries` it doesn't exist by default?
<teepee> it might be created when using the file->open lib folder menu entry. not sure
<M6piz7wk[m]> ehh what does it expect ? just lot of foo.scad files?
<M6piz7wk[m]> or can it use invidual directories e.g. ../libraries/something ?
<teepee> nothing, whatever you do
<teepee> you can add more folders using OPENSCADPATH variable
<teepee> I usually just git clone stuff into that folder, in most cases it's possible to use that way
<M6piz7wk[m]> so it's just looking for .scad files and then lets it to be called using `use <pegboard.scad>` ?
<teepee> yes, it will just go though the PATH as operating systems do for binaries
* M6piz7wk[m] wants to do the alternative to FreeCAD models directory which is just one huge git repository with lots of submodules that are all browsable from the editor
<M6piz7wk[m]> i see O.o cool
<teepee> with snapshot version it will even do autocomplete for those
<M6piz7wk[m]> hmm is there a way in open-scad to execute a command when the library is called ?
<M6piz7wk[m]> *openscad
<M6piz7wk[m]> like `use <pegboard.sccad>` to invoke git to pull submodule and make that lib available
<teepee> nope, but I really want to have some sort of minimal library fetcher at some point soon-ish