fling has quit [Read error: Connection reset by peer]
sculptor has joined #openscad
<sculptor>
ah, right. hello. is this channel alive
fling_ is now known as fling
<sculptor>
i found out about openscad this morning. i want to design a room weather station enclosure (pressure, humidity, temperature, light intensity). i'm designing the pcb. was thinking to go with a leaf shaped enclosure with veins being vent holes for the sensors. a leaf facing downwards. 6x5x1.5cm or similar. two parts - flat part that goes to the wall, with raised edges, and embedded m2 nuts for the pcb, and F3x2mm magnets for the face. and face with
<sculptor>
vein slots and matching magnets. is that feasible in openscad, and what's the best way to start
<sculptor>
in tutorials i saw that i can import .dxf and i can extrude it, but can i round top side edges
<sculptor>
another ideas - waterdrop shape, hexagonal shape. sensor vent slots - in form of a maze, morse message, etc etc
<InPhase>
Sure, they're all possible.
<InPhase>
More elaborate shapes can be more involved work, but very fancy things are possible.
<InPhase>
I sense from your name that you are interested in elegance rather than just practicality on this?
<InPhase>
Importing a dxf is certainly possible for a 2D base of a shape. Although personally I never do this, and just design the shapes within OpenSCAD. One can flexibly shift between 2D and 3D patterns working within the language, and it also opens up possibilities to parameterize shapes and rapidly try variations.
<sculptor>
say a 2d leaf shape is extruded linearly. how to round the top surface edges
<InPhase>
But can I ask what your mathematical background looks like? Some of the best artistic "sculpting" is achieved through clever use of mathematics.
<InPhase>
For which I can point to some guides on methods.
<sculptor>
sure go ahead. if it's trigonometry, no problem for me
<InPhase>
Let me check a few more points. Have you ever seen a matrix multiplication?
<sculptor>
or just point me and i will look it up
<sculptor>
sure
<InPhase>
Ok.
<InPhase>
Then let me point you to some things.
<InPhase>
sculptor: So for the most recent calendar (if you want to see pretty pictures and animations, change 2024 all the way back to 2019), check out Day 10, which is 3 to the right, 4 down, the one making the candle: https://openscad.org/advent-calendar-2024/
<InPhase>
sculptor: This is a simple entry tutorial on how to use integrated OpenSCAD features, and just an intuitive iterative approach to working with equations to make a curvy candle and candle flame shape.
<sculptor>
sweet thanks
<InPhase>
sculptor: It teaches the method of "get close and rapidly tweak" which is really powerful.
<InPhase>
sculptor: And if you can handle thinking about the math, this is the library I made for an extremely flexible and general generation of artistic sculpted shapes that venture outside of combinations of primitives: https://github.com/rcolyer/closepoints
<InPhase>
sculptor: The idea of closepoints is taking ANY 3D shape that you can define the outline for as layers of coordinates, and rendering it.
<InPhase>
sculptor: There's a simplified version of closepoints that acts like a 3D function plotter: https://github.com/rcolyer/plot-function Sometimes that's handy and easier to reason about.
<InPhase>
It supports several coordinate choices.
<InPhase>
sculptor: And direct to your question, "rounding" the top is not trivial to do efficiently. There's an inefficient and messy method involving a minkowski operation with a sphere, which expands a shape outward. But applying this to a complicated shape can sometimes be somewhat slow. It's one of the last operations that is not super optimized with the new Manifold system that you'll find in the nightly
<InPhase>
snapshots (as opposed to the last stable release), which otherwise run extremely fast (50x to 100x times faster) compared to the last stable release.
<InPhase>
The exact performance difference differs by design. But many of them are just astonishingly faster.
<InPhase>
sculptor: There's one trick that IS efficient, where you can bevel a top with a combination of roof() and intersection with a cube to crop off the top of the roof. This roof() call is only available as an experimental feature in the nightly snapshots.
<InPhase>
That produces an angled bevel.
<InPhase>
Generally though, if you want rounded or curvy thing in 3D, the best OpenSCAD approach is not to make a 2D and then try to modify it to be smooth and curvy. Instead, one should start from the curves desired from the beginning, and integrate this into choices made in the initial design plan.
<sculptor>
thank you very much for all this info. it's way over the top for me atm. and this is exactly what i need to learn something useful
<InPhase>
Curving an edge is not an afterthought in OpenSCAD.
<sculptor>
understood
<InPhase>
sculptor: Like if you look at these simple reference implementations for smooth primitives, it's not "make a cylinder and smooth it", but instead, consider the smooth thing from the beginning. Glancing over a few of these examples can highlight that philosophy. https://github.com/rcolyer/smooth-prim
<sculptor>
can't wait to dig into
<InPhase>
And that's probably enough starter info to dump on you unless you have a more specific follow-up question queued up. ;)
<sculptor>
sure i will have a question or two, but not now. once i dig a bit into all this stuff. i learnt about openscad this morning
<sculptor>
i got a 3d printer, and wanted to learn 3d designing, and they suggested me freecad. but i think that openscad is a better choice for me
<InPhase>
sculptor: And, while I am not as familiar with his API, one of the great sculptors of all time (so far) with OpenSCAD was JustinSDK. You can just scroll down and see his examples on his library page: https://github.com/JustinSDK/dotSCAD
<sculptor>
amazing
<sculptor>
this is gold
<sculptor>
once again, InPhase, thanks
<InPhase>
Sure. Good luck on your adventures. :) Feel free to stick around for more discussion. Lots of people idle here and wait for interesting openscad discussions to pop up.
<sculptor>
sure
<sculptor>
added to autojoin list
howiemnt has quit [Ping timeout: 252 seconds]
TheAssassin has quit [Ping timeout: 264 seconds]
TheAssass1n has joined #openscad
J25k15 has quit [Quit: Client closed]
J25k15 has joined #openscad
bozo16 has quit [Ping timeout: 244 seconds]
mmu_man has quit [Ping timeout: 260 seconds]
mmu_man has joined #openscad
bozo16 has joined #openscad
J25k15 has quit [Quit: Client closed]
J25k15 has joined #openscad
sculptor has quit [Ping timeout: 272 seconds]
mmu_man has quit [Ping timeout: 276 seconds]
mmu_man has joined #openscad
Guest13 has joined #openscad
Guest13 has quit [Client Quit]
sculptor has joined #openscad
stealth_ has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 264 seconds]
teepee_ is now known as teepee
HumanG331 has quit [Ping timeout: 245 seconds]
snaked has joined #openscad
<stealth_>
is there a way to make object be displayed with random color?
<teepee>
is that a trick question?
<teepee>
use rands() and color()?
<stealth_>
i been using color(), what does rands do?
<stealth_>
in blender i think there is a option you can set where every time you create an object it give it random color, i am thinking something like that.
<nomike>
I'm experimenting with the python mode and want to import am SVG. As `import` is a reserved keyword in python it can not be used by OpenSCAD. I haven´t found any documentation for Python in OpenSCAD, so there probably is none yet. What I have found is documentation for PythonSCAD, which says to use "osimport". But that python method does not exist.
<nomike>
Anyone has an idea of how this worls?
<nomike>
Anyone has an idea of how this works?
<teepee>
it does not exist in upstream openscad yet, I suppose
<teepee>
in my (maybe very subjective) view the next python steps should be
<stealth_>
it might be a good idea to have openscad use python's `with open('*.svg") as file: ...` to open svg vs using import() since that might cause conflict.
<teepee>
1) support venv so it's possible to use external python packages
<teepee>
2) get more builds to support python, likely macos last, in case someone will take that on
<teepee>
I don't see how open() can work for that
<teepee>
also it does not need "with" as the return is geometry not a file descriptor
<stealth_>
i c
HumanG331 has joined #openscad
<teepee>
can you have a function named import() on a class?
<teepee>
or is it a keyword?
<stealth_>
teepee, "rands" isn't added to python yet :p
<stealth_>
its keyword in python
<teepee>
yeah, keyword it seems, so no way adding it with that name
<teepee>
why would you need openscad rands() in python, use random.next
<teepee>
or whatever it's called
<stealth_>
well maybe it can be `stuff = SVG('file')`
<teepee>
random.random() :)
<stealth_>
something tells me.. wont it be random color very time i render it?
<stealth_>
or preview it? that might be a pain as well.
<teepee>
if you seed the first one, it's stable
Jerr has quit [Ping timeout: 245 seconds]
<teepee>
if you want to be 100% safe, create a single seeded random array and use incremental parts of that
<stealth_>
doesn't look like `osimport()` has been implemented
<stealth_>
teepee, its pain to do that random thing in python, i am going to play around with later.
<InPhase>
teepee: Change 3 to 4 in your random color cube example, set 30fps... ;)
<teepee>
:)
<nomike>
stealth_, as far as I understood, some folks have froked OpenSCAD, added Python support and named it "PythonSCAD" and now, this python support has been merged back to OpenSCAD. But that doesn't seem to have been the case, does it?
<teepee>
it's partially merged
<teepee>
but the fork (as far as I can tell) requires you to have exactly the same python version installed on your local system to use additional packages
<teepee>
in my personal view that's not acceptable
<teepee>
especially on linux where you don't have too much control over the exact python version
<teepee>
and if I have to do this alone it will take a long time
<nomike>
Is there a plan to merge additional things? Like without an import method it is pretty much useless. And some of the methods like `.up()` or `.rotatex()` are quite convenient.
<nomike>
teepee, well, you not having any control about the Python version is mainly a shortcoming of most linux distributions. But yes, if PythoNSCAD has this requirement, that's quite bad.
<nomike>
I'm trying to build it for guix right now, where this problem will not exist.
<teepee>
hence my prio for supporting venv
<teepee>
it's not perfect, but it works with AppImage and Flatpak so far, Snap is *really* annoying
<nomike>
Yeah, Snap should not exist...
<nomike>
like at all.
<teepee>
guix solves that how?
<nomike>
Guix has reproducible builds. So you define a package, which has a name, a source (could be a git repo, a .tar.gz, etc.) and various other parameters. All those parameters including the package definitions of all dependencies are used to calculate a unique hash for the package and that's it's internal name.
<nomike>
Guix then builds the packge and links it to the dependencies. So it installes python and uses exactly the same version of python for PythonSCAD. You could define an additoonal package for a different version of python and use that for another package. If you changeOpenSCAd to use that other python package, it will of course rebuild it.
<nomike>
Another benefit of guix is that the whole system (including source-code for the OS itself, all the package definitions, and all the documentation) is contained within a single git repository. And builds are reproducible. So if you build OpenSCAD on your computer and build it on mine, the compiled binaries are guaranteed to be identical. Completely getting rid of the "Well, it works on my machine" problem.
<nomike>
And you can use it standalone as a system install, or just install it on top of your current linux (I'm using it on Ubuntu, but I want to migrate to native guix at some point). In Ubuntu it's as easy as "suao apt install guix".
<nomike>
At least to get started.
<nomike>
There is some learning curve as it's not like Ubuntu-Installer click "Next" 4 times and it's don.
<teepee>
right, debian repo based build is also reproducible. I have not checked if they auto-rebuild on dependency changes
<teepee>
but even with system python, debian very much encurages usage of venv
<teepee>
not have some global root owned python library mess
<nomike>
I'm not so sure about Debian (unless they added something quite recently) but AFAIK the binary you get when building a source debian package depends on your system configuration.
<teepee>
debian reproducible is like 10 years old or something