<kintel>
manifold vs. fast-csg: Are we, generally, confident that manifold will take over? ..to the point that we can/should start pulling out fast-csg, at least from the test framework?
<kintel>
^ there's a bunch of automatic enabling of fast-csg for tests which would be good to clean up
<teepee>
my view is Manifold for everything supported, CGAL only for the remaining stuff which is probably the decomposition and straight skeleton
<teepee>
I'm not sure if those are corefinement or something else
<teepee>
basically retire fast-csg as separate option, maybe even making Manifold the default
<teepee>
it's not like there are no problems with CGAL
Guest80 has joined #openscad
<Guest80>
Hi all. Is there an optics workbench for OpenSCAD? I know there is one for FreeCAD, but I'm just used to mechanical designs in OpenSCAD.
<peeps[zen]>
Guest80: there are no workbenches at all
<teepee>
I suppose the analog thing would be a library with functions for optics?
<teepee>
I don't know if that exists, there's a big projects for microscopes
<Guest80>
I tried using pyrate, which is very powerful. It had plugins for FreeCAD. It has no GUI on its own, it is totally scripted. The documentation is almost nothing for that code.
<Guest80>
the microscope project seems cool
<Guest80>
i used OpenSCAD to make a lot of lens mounts and the plastic parts for a projector.
noonien88 has joined #openscad
noonien8 has quit [Ping timeout: 272 seconds]
noonien88 is now known as noonien8
<Guest80>
Thanks all. I know lens design is a dark art lol.
Guest80 has quit [Quit: Client closed]
Guest80 has joined #openscad
<kintel>
teepee yeah, makes sense. I feel the test framework got a little out of hand with all the fast-csg and manifold config. I'll try to clean up a bit
<Guest80>
what I did find is there is an OpenSCAD workbench in FreeCAD, so I can just build the model in OpenSCAD and use it in FreeCAD and then use their optics workbench.
<teepee>
yeah, too many combinations and possibilities by now
<Guest80>
cheers everyone
Guest80 has quit [Client Quit]
<peeps[zen]>
i wonder if tetrahedral meshing would be useful, as a roundabout convex-decomposition method. i think it is used in many FEM/FEA apps, but don't know the exact format used for that.
<peeps[zen]>
also might be useful for multi-material support in some way?
<peeps[zen]>
hadn't noticed that myself. i guess manifold doesn't automatically simplify colinear edges, coplanar faces
teepee has joined #openscad
<peeps[zen]>
that's one thing CGAL handled remarkably well in retrospect. seems tricky since faces of the final cube are all dependent, can't remove a vertex on edge of one face without affecting the adjacent face
snaked has joined #openscad
<InPhase>
kintel: That might be a good Manifold issue to open.
<InPhase>
kintel: Especially with such a clear comparison image.
<InPhase>
kintel: ... Unless it already does it and we're just missing a call.
<InPhase>
That might be something you'd only do when asked in such a library. Prematurely guessing that this should be done might be unhelpful.
<peeps[zen]>
to be done on final output of render?
TheAssassin has quit [Remote host closed the connection]
<InPhase>
peeps[zen]: If it's fast, it might actually be worth doing more often.
TheAssassin has joined #openscad
<InPhase>
peeps[zen]: There could be combinatoric gains in some designs.
<peeps[zen]>
true
<InPhase>
And I could imagine that function being fairly fast. The search space is simple and linear.
<InPhase>
Or if it has some overhead, it could be top level render and explicit render(), and it could be thrown in as an optimizer. :)
<peeps[zen]>
although I feel like most real-world use cases wouldn't result in significant amount of coplanar faces like that, just as a gut feeling
<InPhase>
Probably also right. So it has to be pretty fast to be worth throwing everywhere.
<kintel>
Interesting detail: The underside of the object has no internal vertices
<kintel>
floating point issue perhaps?
<kintel>
Anyway, will keep it in the back of my head for a rainy day :)
<InPhase>
Manifold might have purged the grid snap.
<InPhase>
I think there was discussion of that.
<InPhase>
The premise of doing it was based on keeping the rationals small. But coplanarity might then also need an epsilon.
<peeps[zen]>
that test scad is kinda funky. the intersection is not needed to avoid lazy union when there is an explicit union there anyways. and center=1 seems to evaluate to false
<peeps[zen]>
so that intersection is maybe responsible for the lack of internal vertices?
<peeps[zen]>
putting a # on the cube outside the loop to see
<peeps[zen]>
is that a new bug (boolean parameters like "center" should accept "truthy" values?) might be a pain to audit all builtins for that
<peeps[zen]>
s/new/newly discovered/
TheAssassin has quit [Remote host closed the connection]
TheAssassin has joined #openscad
<peeps[zen]>
kintel: I just confirmed that changing the center=1 to center=true makes the bottom face no longer coplanar during intersection, so it tesselates the same as the top
<InPhase>
peeps[zen]: That truthy thing might relate to all those changes you made of value comparisons years back? Maybe the test result changed and no one noticed?
<InPhase>
I see no need to support center=1 though.
<InPhase>
In fact I might interpret the meaning of that differently...
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qeed has quit [Remote host closed the connection]
misterfish has joined #openscad
qeed has joined #openscad
hyperair has quit [Ping timeout: 255 seconds]
misterfish has quit [Ping timeout: 260 seconds]
hyperair has joined #openscad
arebil has joined #openscad
ferdna_ has quit [Quit: Leaving]
lastrodamo has joined #openscad
hyperair has quit [Remote host closed the connection]
L29Ah has quit [Ping timeout: 255 seconds]
hyperair has joined #openscad
hyperair has quit [Remote host closed the connection]
misterfish has joined #openscad
hyperair has joined #openscad
cart_ has joined #openscad
mmu_man has joined #openscad
quiliro has joined #openscad
<quiliro>
hello
<quiliro>
I did not know about so many libraries!
<quiliro>
I thought functions were basic.
<quiliro>
But I feel overwhelemed.
snaked has quit [Quit: Leaving]
<quiliro>
I would like to find the shape of the line on the intresection between an ondulated sheet and a square cylinder which becomes a circular cylinder.
<InPhase>
quiliro: Current versions of OpenSCAD do not provide numerical descriptions of generated geometry. The data flow goes the other way, computational to geometry. You need to either compute the shapes in question, or use geometric manipulations to utilize shapes after you generate them.
<InPhase>
If you put up a paste using one of those urls of your design, and a description of what you're trying to do given that paste, someone might be able to offer feedback on how best to achieve the objective.
<InPhase>
The U.S. is still in the process of waking up though, which is a chunk of us, so a little patience waiting on replies is advised. :)
<quiliro>
How can I find the formula for the intersection of one shape with another?
<J23k5>
nice shape
<J23k5>
but not sure what intersection you talk about
<J23k5>
quiliro can you explain what you are trying to accomplish? .. You could make the intersection, then a projection and export as svg so you get a 2D shape of it
mmu_man has quit [Ping timeout: 240 seconds]
mmu_man has joined #openscad
<quiliro>
I have two shapes made out of paper:
<quiliro>
one is a ciruclar cylinder (a normal one)
<quiliro>
circular*
<quiliro>
which becomes a square cylinder
<quiliro>
the other shape is the one shown in the image which I linked: a sheet which makes a roof
<quiliro>
the first shape is a square tube on one end and it is a circular tube on the other end
<quiliro>
it is a house with a square base and a hanging roof made from a sheet which is not stretched but deformed as a sheet of paper would be deformed
<quiliro>
the walls, which for a square on the base, form a circle when it goes up
<J23k5>
here you find the comands (click on them) to see how they work and can be used
<quiliro>
nice
<J23k5>
to make that roof proper you need a bit more complex approach
<quiliro>
were you able to change the curves on the roof?
<quiliro>
and there is one more detail... the perimeter of the cylinder is the same all along
<quiliro>
but it is beautiful!
<quiliro>
I did not know it could be made so quickly
<quiliro>
once you know how!
<J23k5>
here the roof without creating a polyhedron with points and more math https://bpa.st/3AOQ
<J23k5>
when you loft a circle into a square you either have the square edges on the same radius or the sides so the square is either bigger on the edges or smaller on the sides
<InPhase>
J23k5: Wait, the cube thing is actually serving as an example for someone's real world problem? :)
<quiliro>
do the straight lines measure the same as the curved lines?
<J23k5>
this is the code i gave you just change the delta and delta2 .. there are some ratio of these that will end with flat surfaces .. other will have curved skin
<J23k5>
InPhase just the way the surface was generated .. if you are not ready to deep dive into polyhedra
<J23k5>
and how you can manipulate the surface with functions
<InPhase>
J23k5: :) I just remember that one as being hacky, and done that way primarily because it allowed making a surprising effect and a neat color pattern.
<J23k5>
Iirc i made the original version for pupils to show them how a surface can be made from "vertices" without using vertices but more visible alternatives
<quiliro>
do the straight lines on the top measure the same as the curved lines ?
<quiliro>
on the last design
<quiliro>
I need to know how to cut the paper in order to have the edges of the top paper match the edges of the bottom paper. Wil openscad help me do that?
<J23k5>
no that is pure math .. you can use openSCAD to calculate but you still need to put in the formular for the angles and resulting length
<J23k5>
if you calculate the length of each bar it could be used to simulate the distortion on a flat paper
<J23k5>
but using UV mapping in blender is probably easier
<quiliro>
I know I have to do it in blender. But it is useful to have the shape of my abstract idea visible on 3D
<quiliro>
with openscad
<InPhase>
quiliro: If you're talking about an arrangement of paper in which the edges are straight (like in your last image), then the calculation is actually straightforward. It's just the pythagorean distance between the coordinates of the edges.
<InPhase>
quiliro: I mean, between the coordinates of the corners.
<InPhase>
quiliro: So you would just need to calculate where those corners actually are. A good test is to calculate the corners, then put a red marker sphere at each calculated corner with an isolated translate(corner1) color("red") sphere(2); Then you have visual confirmation that you calculated it correctly.
<InPhase>
Then echo("Edge 2-1 length:", norm(corner2-corner1));
<quiliro>
InPhase: I am a little confused
<InPhase>
Excellent. That's better than very confused.
<lf94>
hahaha
<quiliro>
would you describe it in simpler terms.
<quiliro>
sure
<lf94>
I think he's getting a bit tired x)
<quiliro>
what is a pythagorean distance?
<lf94>
it's just distance.
<lf94>
sqrt(a^2 + b^2)
<quiliro>
oh...hypothenuse
<lf94>
yea
<lf94>
A quick search wouldve told you ;)
<lf94>
all good
<quiliro>
true..thanks for the tip
<lf94>
How'd you do that roof in OpenSCAD ? It's an interesting shape
<quiliro>
it is better to give a fishing cane than a fish
<quiliro>
but both is better!
<lf94>
of course B)
<quiliro>
I don't know how to do that shape in openscad
<quiliro>
but one with the foldings on the x and y axes, respectively....was done before
<lf94>
who did it? where'd you find it
<quiliro>
nevertheless, the foldings are not on the axes, they are on the x-z and the y-z planes, though
<quiliro>
InPhase made it
<lf94>
InPhase: how'd you do it
<lf94>
(just share the script)
<lf94>
(save you some explanation time ;p)
<InPhase>
quiliro: Well, looking at your last code pastebin... You have a for (y=[0:step:50-step]), so your first one is y=0, You put a cube at [0,0,0], [50,0,0], [0,1,0], and [50,1,-1] So it looks like your two corners at y=0 are [0,0,0] and [50,0,0]. Now let's take the far end, y=50-step, which is 49. You have [0,49,0], [50,49,-49], [0,49+1,0], and [50,49+1,-49-1]. So your farthest corners from the first
<InPhase>
set appear to be [0,50,0] and [50,50,50]. Therefore, those are your 4 corners. Name them corner1, corner2, corner3, and corner4 in the right order, and your edges are the norms going around the perimeter using that echo command above.
<J23k5>
2 delta variables to change for the angle https://bpa.st/K2AQ put in 50 for delta2 pulls the edges deeper and curves the surface
<InPhase>
lf94: How did I do what?
<lf94>
the roof
<InPhase>
I didn't.
<lf94>
roof looking
<lf94>
ah
<InPhase>
J23k5 was helping. :)
<lf94>
it was a mystery man
<lf94>
ah
<lf94>
it was a well known man
<lf94>
B)
<InPhase>
I just jumped in to advise some math.
<lf94>
J23k5: looking
<J23k5>
again ? 2 delta variables to change for the angle https://bpa.st/K2AQ
<lf94>
J23k5: sorry your name kinda blends in lol. The visual perceived randomness makes it hard to catch my attention
* J23k5
blends in …
<lf94>
I see now. basically hulling a bunch of cube points you generate in quadrants
<lf94>
hull() is probably the most interesting unique function of openscad IMO
<lf94>
I wish SDFs had a similar function sometimes
<lf94>
There's probably some math shit to make it possible
<lf94>
I think loft() is the closest
<lf94>
loft is like a degenerate version of hull lol
<J23k5>
hull as it is used here is just creating a quad without using a polyhedra
<lf94>
yea exactly
<quiliro>
the last paste is right except that the highest point should make a straight line to the lowest points
<quiliro>
because the water should run down to the corners of the roof
<quiliro>
and should hang from the walls
<quiliro>
not be a dome... but a catenary
<lf94>
draw it on paper
<lf94>
(maybe you already did, im late to the convo)
<quiliro>
I made it on paper
<quiliro>
not just sketch
<quiliro>
but cannot make the shape of the intersection
<J23k5>
use »color(alpha=.5)« to make an object transparent
<quiliro>
nice!
<quiliro>
it make the colors dim, not transparent
<quiliro>
it is not possible te see through the faces
<quiliro>
te - to*
<quiliro>
it would be interesting to be able to edit the code in Emacs and render it in openscad to open a buffer in Emacs with the image....nevertless, it would not rotate as in openscad
<quiliro>
that is a bummer
<quiliro>
what is the difference between rendering and previewing?
<J23k5>
rendering calculates geometry, preview is faster but is just 2D simulating 3D - colors work only in preview
<J23k5>
JordanBrown if you check the image you notice this is a transparent object .. not seeing another object through one
<JordanBrown>
I don't understand the distinction that you are making.
<J23k5>
if your object is generated by a difference/hull/intersection ... you need render() to make it transparent else you will only get the surface
<J23k5>
compare color("skyblue",alpha=.5)render()difference(){cylinder(5,d=50);cube(10);} with a version without the render()
<JordanBrown>
Given the black magic that goes into difference and intersection, I wouldn't be surprised at all to find that transparency doesn't work well with them.
<JordanBrown>
But even for simple shapes you have to get the order right.
<J23k5>
there is only ONE object .. so no order applies
<JordanBrown>
OK.
<J23k5>
but you are right that for multiple objects the drawing sequence is relevant and there are even more issues if transparent objects are behind transparent objects
<J23k5>
i think there is a bug if transparencies are overlay they can become more transparent
<J23k5>
and ctrl+shift+c will copy a different transparent image
<JordanBrown>
Yeah, I was just going to mention that for some reason Edit/Copy viewport image gave an incorrect result.
<JordanBrown>
And for some reason imgur doesn't want to accept a paste.
<J23k5>
kind a strange how dependent we are from browsers and how different results they can display - i mean i can even display different images for different browser
<quiliro>
perhaps the transparency should be some other place
<quiliro>
tries top and bottom...they do not work
<quiliro>
tried*
<JordanBrown>
InPhase yeah, but you applied transparency to the negative object. You deserve what you get.
<JordanBrown>
quiliro can you supply a paste of what you're playing with?
<J23k5>
something that even render() can't fix .. mixed color objects
fling has quit [Remote host closed the connection]
fling has joined #openscad
juri__ has joined #openscad
juri_ has quit [Ping timeout: 255 seconds]
juri__ has quit [Read error: Connection reset by peer]
<J23k5>
quiliro you can't put a ; after the color as it will terminate - but you want the color to affect the object after .. also use render() after the color
<J23k5>
quiliro your 4c0g post is missing a } at the end and also will result in a difference of the two roofs but one is higher as the other so it just takes a bit from the top .. if you have too many elements put a render() in front of the loop so the geometry is calculated there
mmu_man has joined #openscad
cart_ has quit [Ping timeout: 255 seconds]
teepee_ has joined #openscad
teepee has quit [Ping timeout: 256 seconds]
teepee_ is now known as teepee
fling has quit [Remote host closed the connection]
fling has joined #openscad
<quiliro>
where should color go to get transparency?