<JordanBrown>
My mental model of skewing (in one dimension) is that you translate in Y as you scan across X. (Substitute other axes as desired.)
<JordanBrown>
And 2D skewing is that you translate in Y and Z as you scan across X.
<JordanBrown>
But what I'm trying to figure out right now is whether a 4x4 matrix lets you *scale* in X and Y as you scan across Z. I think it does, because I think that's what a perspective transform is.
<JordanBrown>
But as I said I don't think OpenSCAD does 4x4 transforms, and I'm not feeling energetic enough to write a suite of array-based transforms, or dig up one of the ones I've already written, or dig up somebody else's, in order to experiment.
<InPhase>
JordanBrown: Certainly, you simply put values in the third column, top two rows.
<InPhase>
Although shrinking in x and y as you translate across z would not be an affine transformation, and thus is out of scope for what a multmatrix approach will do.
<InPhase>
Maybe that's what you meant by scale.
<joseph_>
teepee: I fixed the WASM build error by updating the signatures in the dummy methods to match the changes I made to the real methods. Thanks for pointing me to the ifdef NULLGL section
teepee has quit [Quit: bye...]
teepee has joined #openscad
Colere has quit [Ping timeout: 240 seconds]
teepee has quit [Remote host closed the connection]
Furor has joined #openscad
teepee has joined #openscad
LordOfBikes has quit [Ping timeout: 245 seconds]
LordOfBikes has joined #openscad
Furor is now known as Colere
J1A847954 has joined #openscad
J1A8479 has quit [Ping timeout: 252 seconds]
linext_ has joined #openscad
linext has quit [Ping timeout: 240 seconds]
linext__ has joined #openscad
linext_ has quit [Ping timeout: 268 seconds]
fling has quit [Remote host closed the connection]
fling has joined #openscad
pbsds has quit [Ping timeout: 268 seconds]
pbsds has joined #openscad
pbsds has quit [Ping timeout: 252 seconds]
<JordanBrown>
InPhase: I believe that a 4x4 can do perspective, and that's not affine. (Parallel lines become non-parallel.) I think the trick is that after you do the multiply you have a 4x1, and you multiply the first three by the fourth.
<JordanBrown>
They say you divide by the fourth coordinate.
<JordanBrown>
Which, I guess, makes sense, because if you divide the entire 4x1 by the 4th coordinate, the 4th coordinate goes back to 1.
<joseph_>
teepee InPhase: Here's a report generated by CTest on my branch: https://gist.github.com/jbinvnt/d30996384dd60eb5646bc0d878331ce0. I was concerned by the result for cgalpngtest_example022 because I thought it could have been an edge case resulting from converting polyhedron to polysets. The output for example022 in a Debug build at least is as expected, tomorrow I'll try to see if I can replicate it in an interactive Release build
<joseph_>
teepee InPhase: There is a broad category of test failures resulting from back faces being rendered as yellow instead of green. I can think of a couple ways to try fixing this, first is to modify the default shader to draw back faces as green, although I'd need to think about whether the necessary face information is already discarded between the CSG stage and the time it gets to the OpenGL render. The other option is to only
<joseph_>
enable the shader for F6 when a separate experimental feature is set (although arguably this just defeats the purpose of the test case. so it would just be a short-term fix to get the tests passing)
paddymahoney has quit [Read error: Connection reset by peer]
paddymahoney has joined #openscad
<JordanBrown>
InPhase: yeah, I can't say that I more than scratch the surface of understanding it, but I've demonstrated a non-affine perspective transform, where X and Y scale as Z changes. Source https://pastebin.com/dRB8MtN1 demonstration image https://pasteboard.co/eV5bkPcH9K2M.png
<JordanBrown>
I believe that perspective transforms are usually used to do 3D-to-2D projection with perspective - and I suspect that OpenSCAD itself uses them for its perspective view - but that doesn't mean that's their only use.
<JordanBrown>
Is there a paste service that does both text and images? It seems awkward to switch between multiple services. Of course, I guess there's always Google Docs.
pbsds has joined #openscad
foul_owl has quit [Ping timeout: 245 seconds]
<InPhase>
joseph_: That ability to show back faces reversed with Thrown Together mode is pretty critical. Have you tried gui testing your changes under that? I assume that's what the failing test is using in the command line call.
<InPhase>
joseph_: Thrown Together is also available in the menu drop downs.
<InPhase>
JordanBrown: Well it does the scaling. To test it, perspective views have the property that, at least from the right vantage point, all parallel lines (before the transform) are after the transform converging to a common point, with that point based only on their angle and not on their starting position.
<InPhase>
JordanBrown: So a bunch of really long rectangles at different orientation angles and translations should converge to a point at the far end based on their orientation angle.
<InPhase>
JordanBrown: Your operation seems like it might have that property.
<InPhase>
(But it's getting late here.)
pbsds has quit [Ping timeout: 245 seconds]
<JordanBrown>
I think that if you look at the Google Doc again, you'll see a demonstration that indicates that it does the right thing.
<JordanBrown>
Now, figuring out the transform that yields any particular *desired* vanishing point (or points!), that's a different matter entirely.
<J1A847954>
InPhase skewing is when you build a cube with skewers and move the top .. so some just have practical grasp to form their mind model
guerd871 has quit [Read error: Connection reset by peer]
<J1A847954>
JordanBrown quite interesting .. that is like the scale in extrusions
<JordanBrown>
Yes.
<JordanBrown>
And while it's not as late here as it is for some, I need to call it a night too.
* J1A847954
just woke up and gets blinded by the sun..
guerd87 has joined #openscad
GNUmoon2 has joined #openscad
GNUmoon2 has quit [Remote host closed the connection]
GNUmoon2 has joined #openscad
GNUmoon2 has quit [Remote host closed the connection]
GNUmoon2 has joined #openscad
ccox_ has joined #openscad
ccox has quit [Ping timeout: 245 seconds]
fling has quit [Remote host closed the connection]
fling has joined #openscad
pbsds has joined #openscad
pbsds has quit [Ping timeout: 268 seconds]
foul_owl has joined #openscad
pbsds has joined #openscad
Non-ICE has quit [Quit: Screw you guys! I'm going home!]
GNUmoon2 has quit [Write error: Connection reset by peer]
GNUmoon2 has joined #openscad
GNUmoon2 has quit [Remote host closed the connection]
teepee_ has joined #openscad
GNUmoon2 has joined #openscad
teepee has quit [Ping timeout: 268 seconds]
teepee_ is now known as teepee
Guest12 has joined #openscad
<Guest12>
Hi all, I can not find on the mail list a way to extrude a 3d object. I need it to automatically make a rail inside an object to let another one slide in it. My workaround using minkowski is https://gist.github.com/pocomane/92a9cdd2027de35c62db56cdccbbc42e . Are there any other known soulution? (hull do not work because the original object is not
<Guest12>
convex)
Non-ICE has joined #openscad
Non-ICE has quit [Client Quit]
<teepee>
yes, there's no built-in 3d extrusion/sweep
Non-ICE has joined #openscad
<teepee>
I don't know any other easy solution that works for the general case
<teepee>
for some special cases it might be possible to project the 3d shape to 2d and extrude that again
<Guest12>
It would also be enough to allow minkowski between 2d and 3d object. This is how my workaround works. If no other general solution is know, I would tray to open a feature request
J1A847954 is now known as J1A84
<J1A84>
Guest12 sometimes you can split your object so that it becomes convex
<J1A84>
if you have points you can use a polyhedron approach like in "closepoints" or other libs
<J1A84>
Guest12 i would use a polygon, also scale might offer some help
<J1A84>
after a linear_extrusion you can add a rotate_extrusion as end
<J1A84>
my lib offers this as LinEx(30,end=true){Quad(20,2);Quad(5);}
<Guest12>
Re-designing the orignal model as multiple convex part, I think will considerably reduce the code re-usability. I did not know the polyedron/closepoints approach, I will look to them
<pa>
InPhase: i think i didn't expressed myself correctly. Essentially i would like a transformation that for example, applies a varying scaling as one coordinate changes
<Guest12>
maybe I had give a bit of context: I am designin 3d printable parts, so be able to re-using them in other project, is crucial to me
<pa>
in your example it seems the scaling is just not aligned with the axis
<pa>
imagine one cube (or sphere) that gets thicker toward one side
<pa>
*towards
<J1A84>
guerd87 i would go the polygon extrusion path .. if your input is a 3D you can use a projection() first
<J1A84>
pa sounds like a chained hull is what you need
<pa>
umh.. maybe this way can get me closer to what i have in mind, yes thanks!
<J1A84>
you can go with scale within linear_extrusion if a flat top is ok
<pa>
well my current shape was made with a torus, with a squished sphere in the center, so that the sphere would connect to the torus more or less on the top/bottom of it
<pa>
this would give me some sort of scaled sphere, with more rounded edges
<pa>
now what i tried to make is the same thing but with one side thicker than the other
<pa>
i also considered to generate the geometry entirely, as it should be relatively easy, but this would have taken me a quite longer time, so i was wondering if there was an easy way to just scale this one
<pa>
(for now i kinda found some parameter that makes it sort of work non-scaled, so i can live with what i have)
<J1A84>
use closepoints or PolyH
<pa>
i thought of closepoints, but i wasnt sure what sort of cross sections to use..
<pa>
i was afraid that crossing cross sections werent supported
<J1A84>
hm i would use rotate extrude and then scale it in one dimension if a little distortion is ok
<J1A84>
and yes closepoints would need a open center
p3ck has quit [Ping timeout: 268 seconds]
<J1A84>
but you can use an elliptic polygon and build the polygon in Z so the roundings are a function of Z
<J1A84>
pa that is not symetrical .. you can scale each quadrant separately or using a bezier polygon.. however as this is not symetrical rotate_extrude can't work
<pa>
no, not symmetrical indeed. that's what i meant with scaling dependent on x value
<J1A84>
(i have a Scale(v=[1,1,1,1,1,1]) where you can scale each axis independently)
<pa>
one ugly and slow way to do that i guess could be to cut many slices of uniform geometry, and then hull them together
<pa>
each of which is scaled independently
<J1A84>
not sure about the other 2 cross sections but this is not easy to make without bezier functions
<J1A84>
(bezier for scaling )
<J1A84>
interesting that some people find it easier to open tickets and write text instead of just testing the 3 possible options - maybe they just lack a better problem solving strategy
<teepee>
yeah
<teepee>
but it's true that it's quite confusing to use those menu entries
<teepee>
mostly because some depend on each other / are only effective for one of the f5/f6 modes
<J1A84>
as some don't work at all with single objects (wireframe) or not at all (snapshot) maybe dividing the view options into a preview (F9,F12) and render (F10 F11) section
<teepee>
I guess part of the issue is that they look like command menu actions but are actually options, either on/off or radio button groups or something
<J1A84>
or just remove them and only have "show problems F12" as the use of F5 and F6 will switch to F9 and F10 (and F11 is not working and is not needed - use alpha=0 and show edges can suffice )
ghee has joined #openscad
<J1A84>
is anyone using F9 or is that a remanent from ancient versions (when "compile" was there)
ghee has quit [Quit: EOF]
<pa>
one thing that doesn't seem to work is clear caches
<J1A84>
JordanBrown i think with fastCSG wireframe doesn't work
<JordanBrown>
Don't know. I think I'm running a mostly-default 2022.03.22.
<J1A84>
Wireframe relay on the render data
<JordanBrown>
Why that? Because it was the last time I grabbed a nightly...
p3ck has joined #openscad
<pa>
InPhase: nice! and thanks! let me see if i can fit this into what i was trying to get
<pa>
sadly it has to be tomorrow, now i have to finish a magnetic latch for an ikea door.. :/
<pa>
screw library came super handy!
<InPhase>
JordanBrown: The emu eggs are indeed very symmetric. That old version I had did have an asymmetry parameter that would range toward something like that.
fling has quit [Remote host closed the connection]
fling has joined #openscad
<InPhase>
pa, JordanBrown: There, I reinvented a parameterized egg shape module: https://bpa.st/YE7A I suspect this is probably very close to the same thing I had before, because I remember this range of shapes resulting upon varying that asymmetry parameter from positive to negative.
<pa>
InPhase: is the asymmetry a linear scale increase towards one end?
<pa>
ok works in nightly
<InPhase>
https://bpa.st/T42Q Updated with asymmetry comments, and keeping the egg upright with negative values.
<InPhase>
The negatives basically just let you sample a different curve.
<InPhase>
You get two types from one equation.
<InPhase>
1.5 is pretty chicken egg for some eggs. But so is -0.6 for different chickens. :)
<InPhase>
I've seen smaller bird eggs shaped like -1
<InPhase>
-2 is basically not an egg, and -5 is an earplug.
teepee_ has joined #openscad
teepee has quit [Ping timeout: 268 seconds]
teepee_ is now known as teepee
<J1A84>
weird math .. Ü
teepee has quit [Ping timeout: 268 seconds]
teepee has joined #openscad
<InPhase>
I almost never use the built-in customizer, but I guess this is a perfect design for it. Updating with: asymmetry = -0.6; // [-20:0.1:20] and then Egg(6, 10, asymmetry); Then you have an asymmetry slider. :)
<InPhase>
Although everything interesting is in -5 to 5, so one could pick that for the slider too.
<InPhase>
I think that's really enough degrees of freedom that it's a very good approximation of almost any egg shape. Looked up "bird egg", quail eggs came up first, -1.1 matches it pretty well.
<InPhase>
Some other unspecified bird egg looks like 1.8
<InPhase>
Found some robin eggs, -1.3
<InPhase>
Also unspecified, but there's a -1.8 shaped egg here in the google image search, which is pretty pointy but it seems a bird made it. :)
califax has quit [Ping timeout: 268 seconds]
GNUmoon2 has quit [Read error: Connection reset by peer]
TheAssassin has quit [Read error: Connection reset by peer]
aiyion has quit [Write error: Connection reset by peer]
califax has joined #openscad
TheAssassin has joined #openscad
aiyion has joined #openscad
GNUmoon2 has joined #openscad
GNUmoon2 has quit [Read error: Connection reset by peer]
GNUmoon2 has joined #openscad
rvt has quit [Ping timeout: 255 seconds]
teepee has quit [Ping timeout: 268 seconds]
teepee has joined #openscad
teepee has quit [Remote host closed the connection]