<kintel>
Do you remember what you try to achieve with this?
<kintel>
It kind of looks like you merge newly created vertices with some random other vertex
<pca006132>
iirc it was not random, the newly created vertices are duplicates of the vertex immediately before it
<pca006132>
at least for the cases I tested
<pca006132>
but yeah, I am trying to merge the newly created vertices with existing vertices
<kintel>
right, so the assumption is that CGAL inserts new vertices in a location immediately after an existing vertex in a constraint
mmu_man has quit [Ping timeout: 246 seconds]
<kintel>
..and hopefully after the _nearest_ vertex ;)
<kintel>
But since this is about intersecting constraints, what about the other intersection constraint? Would CGAL just create another vertex with the same position?
<pca006132>
yeah hopefully, I can't find documentation for this and I am a bit too lazy to dig into the source code...
<kintel>
okok, gotcha, we should probably verify this assumption as if we're wrong, pretty weird stuff will happen :)
<pca006132>
true
<kintel>
..but to rewind a bit: My understanding of constrained triangulation in general is that we have roughly 3 ways of dealing with intersecting constraints:
<kintel>
a) Disallow intersections and bail
<kintel>
b) Allow intersections and create new vertices
<kintel>
c) Ignore intersections and possibly product flipped triangles
<kintel>
whereas CGAL implements a) and b) while Manifold implements c)
<kintel>
Does that sounds reasonable?
<pca006132>
yes
<kintel>
..but OpenSCAD kind of assumes c) at the moment, which causes some problems
<kintel>
..but c) is only necessary (IIUC) if we need to maintain correct connectivity in scenarios where the polygon in question is part of a larger mesh
<kintel>
..which is only really important when using Manifold as a backend
<kintel>
(I think)
<kintel>
If that's the case...
ooxoo has joined #openscad
<kintel>
Perhaps we should just try not to mess with the CGAL triangulation and rather use Manifold triangulation for Manifold and CGAL triangulation for CGAL
<kintel>
i.e. not cross the beams
<pca006132>
sounds good
<pca006132>
btw forgot when will this triangulation be invoked when we use manifold as the backend
<pca006132>
only when we try to make something 2D?
Junxter has quit [Ping timeout: 252 seconds]
<pca006132>
manifold only produce triangular mesh anyway
<kintel>
e.g. linear_extrude, when connecting end caps to the sides
<kintel>
important to get right, especially for the corner cases when we scale one of the axes to (near) zero
<pca006132>
hmmm, feel like it is fine to have extra vertices in the triangulation in that case?
<kintel>
right but in that case, we'd need to fit the new vertices into the polygon2d, as that's used to build inner/outer walls
<kintel>
think linear_extrude of a polygon with holes/islands
mmu_man has joined #openscad
<pca006132>
yes
<kintel>
but if we could triangulate in two steps, that would work: 1) evaluate constraints (polygon2d) and insert vertices where they intersect to produce a new polygon2d 2) triangulate with intersections disallowed
<kintel>
However, we already do 1) using Clipper, but it uses a different vertex format than CGAL (int64 vs. float)
<kintel>
..and unfortunately, CGAL doesn't have a concept of epsilon-valid : (
<kintel>
I wonder how we did this before Manifold. I guess we sometimes failed to produce manifold results...
<kintel>
Wait: We quantized everything to a grid
<pca006132>
not entirely sure how vertex format is a problem, we can always convert it back?
L29Ah has quit [Ping timeout: 246 seconds]
<kintel>
It's only a problem because non-intersections in int64 may turn into intersections in float
<kintel>
..so our nice way of avoiding intersections works in Clipper but causes CGAL issues
LordOfBikes has quit [Ping timeout: 244 seconds]
<pca006132>
I see
LordOfBikes has joined #openscad
mmu_man has quit [Ping timeout: 244 seconds]
J24k59 has joined #openscad
J24k has quit [Ping timeout: 256 seconds]
ooxoo has quit [Remote host closed the connection]
ooxoo has joined #openscad
L29Ah has joined #openscad
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ferdna has joined #openscad
ali12341 has joined #openscad
ali1234 has quit [Remote host closed the connection]
<J24k59>
color(alpha=.5) is not overwriting the alpha
<J24k59>
color(alpha=.1)color(alpha=.8)cube(50); //so you can set alpha without color but not overwrite it without color
<stealth_>
J24k59, you have to give it color?
<stealth_>
J24k59, color("red", alpha=.5)
<J24k59>
color(alpha=.5)cube(50); // works fine
<stealth_>
are you talking about preview of rendering?
<J24k59>
preview - it seems to work in render
<stealth_>
ya
<stealth_>
you can add `render() color(alpha=.5) cube(50);`
<J24k59>
well sort of - the colors are discarded in render
<J24k59>
no it doesn't work with render()
<stealth_>
it does for me for preview
<J24k59>
it is black
<J24k59>
render()color(alpha=1)cube();
<stealth_>
well 1 = 100%
<stealth_>
so there is no alpha in 100% so .5 = 50% alpha
<J24k59>
the color is stripped color(alpha=.9) color("green") cube(50);
<J24k59>
but that is a different issue that undef color are black in render
<J24k59>
but alpha should overwrite alpha also in preview!
<stealth_>
maybe color() second time overwrites the first color! not sure how openscad handles such things. but color("green", alpha=.9) cube(50); works.
teepee_ has joined #openscad
teepee has quit [Ping timeout: 260 seconds]
teepee_ is now known as teepee
<stealth_>
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Transformations#color "Warning: alpha processing (transparency) is order-sensitive. Transparent objects must be listed after non-transparent objects to display them correctly. Some combinations involving multiple transparent objects cannot be handled correctly. See issue #1390. "
<stealth_>
J24k59, ^
<J24k59>
it is not about order if all objects are in the same scope
<J24k59>
but there are other issues with transparent colors
<J24k59>
color("red",alpha=.25) color("green",alpha=.5)cube(10); // works
<J24k59>
but color(alpha=.25) color("blue")cube(10); // doesn't
<stealth_>
ya i get what you are saying
<stealth_>
J24k59, whats the advantage for using 2 color() like that?
<J24k59>
conditional coloring - i have a set of parts with multiple color and transparencies and like to make them transparent without loosing the color - so no i have to add a new alpha parameter for all as workaround
<stealth_>
J24k59, have you tried the Example-2 ?
<J24k59>
this is like using transform([10,0])transform([0,10])cube(5); .. but with color
<InPhase>
J24k59: An obvious workaround would be passing an $alpha, but the situation you describe of providing alpha separately sure sounds like it would be ideal and desired behavior.
<J24k59>
inPhase it is just weird that alpha can be set without color - but not overwriting if a color was set before (or alpha)
<J24k59>
!color(alpha=1)
<J24k59>
color(alpha=.1)cube(10);
<J24k59>
but works in render (well it is black then)
<InPhase>
stealth_: All $variables are definitionally named "special variables", although the more appropriate term for this would be "dynamic variables" as they go dynamically down the call stack. It is not a built-in, but just a name I chose here for clarity.
<stealth_>
InPhase, aww, there wasn't a docs for it was wondering where it came from :p
ferdna has joined #openscad
<InPhase>
stealth_: I will not show the place behind me from which I pulled it.
<J24k59>
stealth_ you noticed that the alpha=.25 is ignored or?
<stealth_>
InPhase, good, dont wana see it
<stealth_>
J24k59, well it shows green in preview but when render its black with alpha
<J24k59>
yes undef color render black - this is a known issue
<stealth_>
well .25 is ignored in preview but render() it is used.
<stealth_>
so ya there are some weirdness going on
<stealth_>
J24k59, try this out `cube(5); color(undef, alpha=.9) color("green", alpha=1) cube(10);` in preview and render
<stealth_>
think it makes the inner cube alpha as well?!
<stealth_>
its more clear is you have other objects
mmu_man has quit [Ping timeout: 246 seconds]
<J24k59>
this is about the order where you place cube(5)
<stealth_>
well i had other object i been working on, and i could see it right through cube(5), too weir.d
<J24k59>
transparency of multiple objects has problems - sometimes is changes with rendering the object (before color)
<J24k59>
preview is some 2D hack
<stealth_>
if you disable manifold and flush, before rendering, you see totally different result.
<stealth_>
so preview and each of the renderer have different results.
mmu_man has joined #openscad
<J24k59>
color and transparency is only working in render with manifold
<J24k59>
and only afaik olivier implemeted it last month
mmu_man has quit [Read error: Connection reset by peer]
mmu_man has joined #openscad
<stealth_>
there is something weird going on with "measure distance" once you enable it you can't disable it, and after some times the whole preview/rendering section gets really slow
<stealth_>
have to restart software to get back to things being fast again.