teepee changed the topic of #openscad to: OpenSCAD - The Programmers Solid 3D CAD Modeller | This channel is logged! | 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
kintel has joined #openscad
<kintel> greyltc At the moment, I would extrude my 2D object my a minuscule amount using linear_extrude()
<kintel> guso78 Not sure if you're still up, but I think the typical answer is to project your polygons into 2D space by projecting onto its own plane, then use 2D polygon-in-polygon
<greyltc> kintel: extruding the source objects leaves artifacts in the geometry
<greyltc> is it a bug in the hull() function that doesn't work correctly on 2d children?
<kintel> Not a bug: You cannot apply a 3D transformation to a 2D object, since the object lives in 2D space, and we don't yet support "2D in 3D" geometries
<kintel> ..but there are libraries out there which achieve something similar, e.g. "skin()": https://github.com/openscad/list-comprehension-demos?tab=readme-ov-file#extrusionscad
<greyltc> kintel: are you sure skin.scad works?
<greyltc> ah, sorry it works. I just missed some functions
<greyltc> actually skin is very strange
<greyltc> it only works on circles defined with r= not on ones defined with d=
<greyltc> but
<greyltc> skin([transform(translation([+5,0,-10]), circle(r=5)), transform(translation([-5,0,+10]), circle(r=7.5))]);
<greyltc> generates exactly the geometry that I expected my hull() example above to
<greyltc> how can there be code that runs when a circle is defined with r=, but not d=?
<greyltc> that's nuts!
<greyltc> I can't imagine trying to debug that...
<greyltc> thank you for pointing me to skin() btw!
<greyltc> it seems to work great with circles, which is all I need it for. I expect it's gonna have some issues with lofting through shapes other than circles though
<kintel> greyltc It's because the "circle()" used in that example isn't OpenSCAD's circle() module
<kintel> ..it's a user-defined circle() _function_ returning coordinates describing a circle
<kintel> OpenSCAD has an ..interesting feature: modules and functions have different namespaces and it's always clear from the context if we're going to look up a function vs. module
J24k37 has joined #openscad
J24k has quit [Ping timeout: 250 seconds]
LordOfBikes has quit [Ping timeout: 268 seconds]
LordOfBikes has joined #openscad
omegatron has quit [Quit: Power is a curious thing. It can be contained, hidden, locked away, and yet it always breaks free.]
arebil has quit [Quit: arebil]
epony has quit [Remote host closed the connection]
hyperair has quit [Ping timeout: 240 seconds]
mmu_man has quit [Ping timeout: 256 seconds]
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arebil has joined #openscad
stefanct has quit [Read error: Connection reset by peer]
stefanct has joined #openscad
aiyion2 has quit [Ping timeout: 240 seconds]
aiyion2 has joined #openscad
hyperair has joined #openscad
aiyion2 has quit [Ping timeout: 240 seconds]
epony has joined #openscad
aiyion2 has joined #openscad
aiyion2 has quit [Remote host closed the connection]
aiyion2 has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
aiyion2 has quit [Remote host closed the connection]
aiyion2 has joined #openscad
cart_ has joined #openscad
cart_ has quit [Ping timeout: 268 seconds]
teepee has quit [Remote host closed the connection]
teepee has joined #openscad
guso78k has joined #openscad
<guso78k> kintel: I have also considered projecting the 3D polygons into 2D space, but its not as simple as OpenSCAD project function to simple drop the Z coordinate, because the polygons  could be oriented  normal to XY plane , so its might be an time expensive operation.
<guso78k> I;d like to be very effective because I have to apply this op many times. Do you have any links how to project a 3D polygon into 2D space ? its not unique because there is still a rotary freedom involved.
<guso78k> But yes  once I have them fast in 2D space,  shown 2D algorithms might be very interesting
qeed has quit [Quit: qeed]
qeed has joined #openscad
teepee_ has joined #openscad
teepee has quit [Ping timeout: 240 seconds]
teepee_ is now known as teepee
cart_ has joined #openscad
<knielsen> guso78k: just curious, if a polygon is normal to the XY plane, how do you want it to be projected to 2D? Just remove it or what?
<guso78k> if  my polygons are normal to XY plane i would need to rotate them in a way (by 90 deg) so their area is unchanged ...
<knielsen> aha, right, so you need to somehow find the right plane to project to, makes sense
<guso78k> i think they could be rotated by  make a cross product with a special 3d vector. i just dont know yet exactly where it needs to point at ...
<knielsen> I think it's something like: take two perpendicular unit vectors in the plane of the polygon, along with their cross-product, and build a 3x3 matrix from those 3 vectors. And then multiply with the inverse of that matrix to rotate into the XY plane
<guso78k> without understanding, whats going on and why, it sounds like a quite concrete strategy. suppose the 3 vectors beeing vertically itself , have to be aligned horizontally next to each other. what's their order ?
<guso78k> can it happen, that matrix inversion is not possible due to 0-determinant ? suppose this is when the polygon is parallel to XY already
epony has quit [Remote host closed the connection]
ccox has joined #openscad
ccox_ has quit [Ping timeout: 260 seconds]
adigitoleo has joined #openscad
<guso78k> ahh  now i understand, the order is xvec-yvec-zvec wherease zvec is xvec x yvec and you basically just "undo"  the transformation into the orientation  where the polygon is  right at the start
califax has quit [Ping timeout: 240 seconds]
califax has joined #openscad
fling has quit [Ping timeout: 240 seconds]
fling has joined #openscad
<knielsen> yes
fling has quit [Remote host closed the connection]
fling has joined #openscad
othx has quit [Ping timeout: 264 seconds]
othx has joined #openscad
mmu_man has joined #openscad
guso78k67 has joined #openscad
<gbruno> [github] gsohler synchronize pull request #4516 (offset for 3D objects) https://github.com/openscad/openscad/pull/4516
othx has quit [Ping timeout: 245 seconds]
othx has joined #openscad
cart_ has quit [Quit: Konversation terminated!]
<guso78k67> kintel i will try this:  https://bpa.st/E5MQ
cart_ has joined #openscad
guso78k67 has quit [Quit: Client closed]
snaked has quit [Quit: Leaving]
guso78k has quit [Quit: Client closed]
J24k37 has quit [Quit: Client closed]
J24k37 has joined #openscad
epony has joined #openscad
kintel has joined #openscad
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teepee_ has joined #openscad
mmu_man has quit [Ping timeout: 246 seconds]
teepee has quit [Ping timeout: 240 seconds]
teepee_ is now known as teepee
mmu_man has joined #openscad
ferdna has joined #openscad
foul_owl has quit [Ping timeout: 240 seconds]
foul_owl has joined #openscad
kintel has joined #openscad
ferdna has quit [Quit: Leaving]
cbmuser has quit [Ping timeout: 268 seconds]
Pringle has joined #openscad
<Pringle> Hello, Im working on my first 3D modeling project since college and really liked the idea of scripting as a modeler. I was hoping to get someones expertise on a small idea for my first print in my new printer.
cbmuser has joined #openscad
<Scopeuk> Pringle if your trying to get started with open scad the tutorial is pretty good, otherwise giving it a go and asking specific questions is probably the way to go
<Scopeuk> people will happily talk about designs or models here if you would like to
<Pringle> Awesome thanks for the responses. Mainly wanted to check to see if this chat was active. Once I get going ill see what questions arise. Thank you!
<Scopeuk> it is active here but it can be quiet, it usually picks up evenings for European time zones, the amount of traffic varies but people are lurking
<Pringle> (y)
Guest61 has joined #openscad
Guest61 has quit [Client Quit]
aiyion2 has quit [Read error: Connection reset by peer]
aiyion2 has joined #openscad
cart_ has quit [Ping timeout: 256 seconds]
mmu_man has quit [Ping timeout: 264 seconds]
<InPhase> Pringle: A common event is, "I was trying to find a good way to express this in OpenSCAD: *shows code and example of desired result*" Then a hoard of people race to compete for the best way to express that. ;)
<Pringle> ```test```
<Pringle> Is there a wait to format the code in chat?
<peepsalot> pastebin
<Pringle> sry not sure what that means
<Pringle> Well here goes nothin - Im trying to make a truncated octohedron with some faces solid and some open. At this point it doesnt matter which faces are which. To make this shape Ive boiled it down to the intersection of two common shapes; a octahedron, and a cube. This is a two parter question. First, how do I rotate the cube 45*? Second, when I put
<Pringle> the two shape objects through the intersection function I only get the top half, what happened to the bottom? Thanks!!!
<Pringle> /intersection() {
<Pringle>     polyhedron(
<Pringle>         points=[ //Pts: 0, 1, 2, 3, 4, 5
<Pringle>             [10, 10, 0], [10, -10, 0], [-10, -10, 0], [-10, 10, 0], // 4 Base points
<Pringle>             [0, 0, 10], [0, 0, -10],                                     // Peak and valley
<Pringle>             ],
<Pringle>         faces=[ [0 ,1 ,4], [1, 2, 4], [2, 3, 4], [3, 0, 4],              // Top faces
<Pringle>             [0 ,1 ,5], [1, 2, 5], [2, 3, 5], [3, 0, 5]                   // Bottom faces
<Pringle>             ]
<Pringle>         );
<Pringle>     cube(15, true);
<Pringle> /}
<Pringle> echo(version=version());
<InPhase> Pringle: You should put that at https://bpa.st
<peepsalot> a pastebin is a website (there are many, e.g. https://bpa.st/ ) that provides a service where you paste text into it and it creates a link you can share
<InPhase> And then give the link from there.
<peepsalot> so it doesn't flood the chat
<Pringle> (y) gotcha sry. https://bpa.st/6ECA
<InPhase> Code formatting on IRC is terrible, and hard to copy and paste back out. So it's a taboo IRC thing to paste code directly (we forgive you, you're new). So pastebin sites like bpa.st are used.
<InPhase> Pringle: As for the disappearing side, that's going to be because some of your faces have the wrong winding order.
<InPhase> Pringle: That'll be in the manual under the right-hand rule.
<Pringle> So the example just below showing a pyramid is wrong?
<InPhase> Pringle: An example of achieving this without struggling with polyhedron is this: https://bpa.st/HEVQ
<InPhase> I'm using "render" here just because preview is going a little wonky on this on some conditions, and this is a small simple shape, so tossing in the render() call gives preview something clean to work with and it's plenty fast enough because it's simple.
<Pringle> ok thank you for the help, and sorry for the elementary questions
<InPhase> Pringle: Note that the inner part with the linear_extrude on the squares violates the overlap rule, which should pretty much ALWAYS be followed, but it works here because it's aligned exactly on the z axis.
Guest83 has joined #openscad
Guest83 has quit [Client Quit]
ccox has quit [Ping timeout: 245 seconds]
<Pringle> ok if i rotate the cube 45, I dont quite get what i was looking for. I guess i need to read a bit more on what this render does.
ccox has joined #openscad
ccox has quit [Ping timeout: 252 seconds]
<Pringle> InPhase All I had to do was make the cube a bit bigger to get the shape I was after. Thank you for this. Im wondering how I can remove some of the faces now so I can access the inside of this shape?
drkow has joined #openscad
ccox has joined #openscad
drfff has quit [Ping timeout: 260 seconds]
SamantazFox has quit [Quit: Bye]
<InPhase> Pringle: Can you clarify what you mean by access the inside?
<InPhase> Pringle: Do you mean, hollow it out?
<InPhase> Like a bucket/jar?
<InPhase> Pringle: That involves making two copies, one bigger than the other by the desired wall width, and doing a difference operation. The best way to do that is to put the shape into a module with a parameter for the extra width, and then wiggle that extra width amount into all the numbers for the shape at the right spots. Then you have one copy of the shape, and you difference the module with and without
<InPhase> the extra width.
<InPhase> And you'll have to add a little special bit to put the opening wherever you want it.
guso78k has joined #openscad
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fling has quit [Ping timeout: 240 seconds]
fling has joined #openscad
fling has quit [Remote host closed the connection]
fling has joined #openscad
aiyion2 has quit [Remote host closed the connection]
aiyion2 has joined #openscad
Pringle has quit [Ping timeout: 250 seconds]
Pringle has joined #openscad
<Pringle> InPhase
<InPhase> Pringle
<Pringle> InPhase Sorry I got disconnected and didnt realize until after I @'d you.
<Pringle> So heres what Ive added. Still not sure how to remove the faces im wanting. https://bpa.st/B6YA
Pringle has quit [Quit: Client closed]
Pringle has joined #openscad
<InPhase> Pringle: You want to avoid reusing code, so like this: https://bpa.st/7FYQ
<InPhase> I mean, avoid repeating code.
<InPhase> I have no idea if that matches your mental image, but something like that.
Pringle81 has joined #openscad
Pringle81 has quit [Client Quit]
Pringle93 has joined #openscad
<Pringle93> idk what happened to my user...either way. you are a wizard! honestly very impressive ha. This is exactly what im looking for.
Pringle has quit [Ping timeout: 250 seconds]
SamantazFox has joined #openscad
Pringle93 has quit [Quit: Client closed]
Pringle has joined #openscad
<InPhase> :)
<InPhase> Pringle: There are a small number of tricks like this to learn, and once you see a few examples like this, you'll be popping out the same sort of thing. :)
<Pringle> InPhase Its honestly a lot of fun, just a lot to learn at first :) I was able to get the rest of the squares, how would I get the hexagonal faces? Heres what Ive tried so far, but feel like im just guessing on locations/rotations. https://bpa.st/6PPQ
Pringle21 has joined #openscad
Pringle85 has joined #openscad
Pringle has quit [Ping timeout: 250 seconds]
Pringle21 has quit [Ping timeout: 250 seconds]
Pringle85 has quit [Quit: Client closed]
Pringle has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
<InPhase> Pringle: Well, there are a few approaches to that sort of thing. One is to do the math for where those hexagonal faces are, and sort it out that way! Another is to rethink the whole thing as a constructive problem, and build the wireframe of your object instead of trying to hollow it out. This would require some math too. A third is to try to do a half-math approach and reuse your existing shape,
<InPhase> something like this hacky first-draft: https://bpa.st/IAZQ
Pringle has quit [Ping timeout: 250 seconds]
J24k37 has quit [Quit: Client closed]
J24k37 has joined #openscad
Lagopus has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.1)]
guso78k has quit [Quit: Client closed]
RoyK has quit [Ping timeout: 256 seconds]
RoyK has joined #openscad