<gbruno>
[github] kintel pushed 6 modifications (Don't #define _USE_MATH_DEFINES in *.cc files but as compile define. (#5328) Setting the #define in the compilation unit makes it dependent if
<gbruno>
[github] kintel pushed 85 modifications (In implementation compilation unit: move corresponding header to top. (#5327) Move header foo.h within implementation foo.cc to the top. That ensures
mtm has quit [Ping timeout: 264 seconds]
mtm has joined #openscad
ndnihil is now known as nihil
mtm has quit [Ping timeout: 272 seconds]
myosotis has quit [Remote host closed the connection]
pca006132 has quit [Remote host closed the connection]
pca006132 has joined #openscad
TylerTork has joined #openscad
<TylerTork>
suppose I import a 3D object -- could be any shape. I want to hollow it out with a constant wall thickness and have a reasonably smooth interior. Any thoughts how I could manage that? I know I can make it bigger with minkowski, but can I make it smaller to difference from the original? scale doesn't do it because for complex shapes the result is
<TylerTork>
very not a constant wall thickness.
<UltimateCodeWarr>
I remember in 2D image processing they had a "Skeletonization" function, I wonder if they have the 3D equivalent.
<UltimateCodeWarr>
It was a kind of Edge Detection Mechansim
J24k45 has joined #openscad
<UltimateCodeWarr>
I wonder if the slicer can do anything like that since it basically converts it all back to 2D anyhow
Non-BEAST is now known as Non-ICE
<TylerTork>
It does do that, of course, in the process of figuring out what to infill.
<UltimateCodeWarr>
I wonder if there is a way to specify a maximum model wall thickness
J24k92 has quit [Ping timeout: 256 seconds]
<UltimateCodeWarr>
Rather than using an infill
<pca006132>
you do minkowski sum on (bounding box - object)
<pca006132>
and do subtraction again
<UltimateCodeWarr>
If you a printing a chocolate statue of liberty and want to fill it caramel.
<TylerTork>
pca006132: interesting... I don't suppose you know a way to locate a point on the outside of the object to minsk from.
<TylerTork>
if I want to make it general.
<peepsalot>
TylerTork: it's not as simple as a bounding box, but i have a solution here which i've used for the same exact task https://bpa.st/77RDC
<TylerTork>
peepsalot: the tricky part though is figuring out where to put the spherical "minkowski bit" to cut to the right depth.
<peepsalot>
i guess it still relies on an assumed max coordinate variable for the extrusion heights
<peepsalot>
not sure what you mean, the sphere should be centered on the origin
<peepsalot>
i thought you mean an automated way to get a bounding shape to subtract from
<peepsalot>
s/automated/general/
<TylerTork>
peepsalot I do want that, but then what's the next step? Maybe we are thinking about this differently. Say I import my shape. Somehow I create a larger shape that will enclose it -- I have ideas about that. I subtract the shape from the container leaving a hole the shape of my import. Now I want to use minkowski to shrink the hole. Doesn't that
<TylerTork>
require me to have a point on the inside surface to position my sphere half-in, half-out of the object I want to add to?
<InPhase>
TylerTork: You'd center that sphere.
<TylerTork>
You're saying a point at the origin -- presumably in the middle of the hollow area -- would do the trick?
<peepsalot>
minkowski already does that work for you, i feel like you have a misunderstanding of the concept of how minkowski operates
<TylerTork>
Probably. The documentation wasn't super clear.
<TylerTork>
I'll try it and see what happens.
<InPhase>
TylerTork: Test this, and swap the commented bits to understand: https://bpa.st/Q4PPG
<InPhase>
TylerTork: Notice that it's equivalent to adding up all the rightmost points of the two shapes to get the rightmost point of the resulting shape. And likewise with adding up the leftmost points.
<InPhase>
TylerTork: And consequently, you center the sphere if you want things to move outward from wherever they are.
<peepsalot>
TylerTork: are you using a dev snapshot with manifold enabled?
<TylerTork>
yes to the first, I believe so to the second. There are a lot of nodes to this import though. Might should've started with something simpler
<peepsalot>
yeah minkowski is by far the most intensive operation, try very lower fn sphere at first and see if you can get that to complete in a reasonable time
<peepsalot>
if manifold is enabled the console should print "Rendering Polygon Mesh using Manifold..." when you F6
<peepsalot>
or just verify in preferences -> Features
<TylerTork>
I do see that in the output of a previous run but it hasn't gotten to the rendering phase yet it's still minsking. I will go to bed and let it run. I'll tell you though a 3d offset function would be really nice to have!
<Scopeuk>
BOSL is pretty good anyway so worth having in your library folder
misterfish has quit [Ping timeout: 252 seconds]
fling has joined #openscad
hyperair has quit [Ping timeout: 264 seconds]
fling has quit [Ping timeout: 260 seconds]
mmu_man has joined #openscad
mmu_man has quit [Ping timeout: 260 seconds]
<J24k45>
UltimateCodeWarr just use HexGrid(help=1)circle($r); from my library
ubuntourist has joined #openscad
ubuntourist has quit [Client Quit]
ubuntourist has joined #openscad
ubuntourist has quit [Client Quit]
ubuntourist has joined #openscad
ubuntourist has quit [Quit: Leaving]
mmu_man has joined #openscad
misterfish has joined #openscad
TylerTork has quit [Quit: Client closed]
misterfish has quit [Ping timeout: 264 seconds]
misterfish has joined #openscad
fling has joined #openscad
fling has quit [Ping timeout: 260 seconds]
fling has joined #openscad
myosotis has joined #openscad
fling has quit [Remote host closed the connection]
hyperair has joined #openscad
lostapathy has quit [Ping timeout: 252 seconds]
mtm has joined #openscad
TylerTork has joined #openscad
<TylerTork>
is there any talk of making an import function that returns a polygon description instead of creating the object?
TylerTork has quit [Client Quit]
mmu_man has quit [Ping timeout: 252 seconds]
<pca006132>
what do you mean by a polygon description?
TylerTork has joined #openscad
<TylerTork>
pca006132 I mean a list I could pass to polygon to create the object, after I mess with it some.
J24k45 has quit [Quit: Client closed]
J24k45 has joined #openscad
<pca006132>
I don't think anyone is working on that (at least not recent PRs)
<TylerTork>
Or a simplify function that makes a shape less complex by merging polygons?
<TylerTork>
minkowski just cannot handle some of the things I'm working with
<pca006132>
and I think converting an object into some internal data structure that users can work on is probably more interesting than a dedicated import function for this
<TylerTork>
converting object to data is an option I could also use.
<TylerTork>
how about a way of connecting two 2d shapes by creating polygons between their edges, without also filling in concavities in the shapes themselves?
mtm has quit [Ping timeout: 276 seconds]
<TylerTork>
no, huh?
krushia has quit [Read error: Connection reset by peer]
krushia has joined #openscad
<pca006132>
TylerTork: I don't think this is well-defined?
<pca006132>
there are many edges for the two 2d shapes
mmu_man has joined #openscad
<pca006132>
do you mean hull but without filling in the cavities?
UltimateCodeWarr has quit [Quit: Client closed]
mmu_man has quit [Ping timeout: 265 seconds]
crazy_imp has quit [Ping timeout: 245 seconds]
crazy_imp has joined #openscad
mmu_man has joined #openscad
red-snail has joined #openscad
mmu_man has quit [Ping timeout: 246 seconds]
ooxoo has quit [Read error: Connection reset by peer]
ooxoo has joined #openscad
ooxoo has quit [Remote host closed the connection]
<pca006132>
it is not hard, but idk how to do it within openscad
<pca006132>
you can just extract the internal holes from the polygons list, and subtract them after taking the hull of the outer contours
<teepee>
difference() { fill() polygon(); polygon(); } would give that?
<TylerTork>
pca006132: maybe that's not exactly what I mean. Like I give it two shapes, and the rotation and position in each axis are relevant. And I say, now make me a minimal polyhedron where these two ARE POLYGONS in the result -- don't mess with them
<pca006132>
teepee: ah, not aware that there is a fill function
<pca006132>
TylerTork: you mean something like loft?
misterfish has quit [Ping timeout: 260 seconds]
<teepee>
yeah, it's new-ish so not very well known. but it provides something impossible before, like making a filled base for text
<teepee>
meh, trying to add 3mf colors for V1 too, but "Export Error :-("
<InPhase>
TylerTork: Do you know any python?
<InPhase>
TylerTork: If this is a one-off problem, I'm pretty sure an ascii-stl to polygon source code generator would be super fast to write. So you could just import it in whatever form it is into openscad, save it out as ascii stl, and then run a python program that loads up all the triangles and saves out a list of points and faces for a polygon call.
<TylerTork>
pca006132: loft looks promising but in this case I don't have points to pass it. Hence the interest in a function to render an object into data,
<InPhase>
TylerTork: There was work on a data = render() PR, but this wasn't finalized.
<TylerTork>
InPhase: I'm really more interested in filling the holes in general capabilities of the program, so I'm messing around trying to find out what's impossible/difficult to do. Hence I'm not interested in solutions which begin with, "if you want to do this learn the following whole other programming language."
<InPhase>
TylerTork: Ah, well in that case, that functionality has been on the horizon and consideration for years, and progress was started but not finished.
fling has quit [Ping timeout: 260 seconds]
<TylerTork>
may I grumble some more? How hard would it be to let me import something with center=true?
<teepee>
impossible as there's no single definition of center for general geometry
<teepee>
hmm, so 3mf can define both material and color, but only attach one of those per triangle :(
<teepee>
and colors are actually shown in printables when showing the 3mf in the 3d viewer
<J24k45>
The viewer in printables (maybe three.js) can show colors and also textures .. metallic reflections doesn't work (when i tested them some time ago)
<teepee>
it ignores the base material display color though
<teepee>
so we need to add a texture to that material?
<J24k45>
did you define the color in the export dialog (i needed that step to make it work for BS)
<J24k45>
no textures should be optional and will overlay color
<teepee>
no, I'm working with the code in OpenSCAD itself
<teepee>
there's 3 models, first is openscad + basematerial (no color shown), second is from web-ochafik (no color shown, but works in slicer), 3rd is openscad + color which is shown in color on the website
<J24k45>
was already wondering what the difference was between them
<teepee>
that is very strange, it has some triangles assigned to color, others to the texture
<J24k45>
if that is from my example - this is made with 3D builder which works very weird it seems it doubles the object - if i import that into other software i get a second object with different size
<teepee>
but color may not be the way to get slicers working anyway. we may need an export flag saying if we want to use material or color
<J24k45>
teepee here you can see the scaled version - which is also missing parts .. the model consists of 7 Elements but 3D builder duplicated them for color and added this half scaled one too
<guso78k>
you found out, materials are not colorful either ?
<teepee>
still testing
<teepee>
right now I'm getting an error with lazy union
<guso78k>
actually a quite hard slicer task, as we define the object surface, but printers have to print the volume ...
<J24k45>
cura can save 3mf projects and with multi extruder - but those are probably just separated objects
<teepee>
that's the point with lazy union, it would create multiple objects with different materials
<teepee>
maybe slicers even don't care about the actual material, just that it's multiple objects
<J24k45>
you can have objects parts and different colors - all in one 3mf
<J24k45>
guess openSCAD separates colors into parts
<J24k45>
at least the WASM playground seems to do that
<J24k45>
which causes problems if an objects has multiple colors
<guso78k>
i just used lazy union with 2 overlapping objects and written 3mf in openscad. the overlapping volume is not cancelled from either object.
J24k45 has quit [Quit: Client closed]
J24k45 has joined #openscad
<J24k45>
if overlapping volumes are merged in slicer - the slicer should correct for that
<J24k45>
but the point of lazy union is to keep objects separated
<guso78k>
when importing such an 3mf file in cura, it imports 2 objects, which are correctly overlapped, but it keeps them at 0/0 way away from the center of the center of the printbed. when i try to center them to the printbed, i can only select one of them, so the relation is lost :(
<J24k45>
Cura changed the way of importing 3mf lately .. they need to import as parts not objects to keep relation
<J24k45>
try to select both and say "merge"
<guso78k>
yeahh! grouping also works
guso78k has quit [Quit: Client closed]
<teepee>
multiple objects work
guso78k has joined #openscad
<guso78k>
is ascii 3mf export yet another file ?
<teepee>
there's no ascii 3mf
<guso78k>
in my branch i checked in ./tests/regression/3mfexport/3mf-colorexport-expected.3mf
<J24k45>
3mf is text ( xml i think)
<guso78k>
and its an ascii file, it was created with TEST_GENERATG
<guso78k>
TEST_GENERATE=1
<teepee>
well, yes, but the ZIP is in the specification
<teepee>
the test case just uses the xml part inside for comparison
<guso78k>
when the color works in an external viewer, but the color is not in the xml, it aparently stored somewhere else
<teepee>
ok, so multi-object export works, even though the actual material definition is bogus
<guso78k>
so ctests cannot see color at the moment
<teepee>
it should, it's in the same xml file
<guso78k>
both v1 (in windows) and v2( in unix) can create colored 3mf files, i checked in an online viewer.
<guso78k>
but I cannot find the color in the 3mf file (and even marius is wondering if work on v2 is started)
<guso78k>
something is odd , hmmmm
<guso78k>
ok, can see the color in the file now
<guso78k>
i believe, that the ctest is executed without the color-3mf-export enabled. isn't manifold enabled ?
ooxoo has quit [Read error: Connection reset by peer]
ooxoo has joined #openscad
mtm_ has joined #openscad
mtm has quit [Read error: Connection reset by peer]