I was intrigued that the polygon linear extruded in you IGewinde() module
renders happily while its extrusion fails and I have investigated the issue
a little further. The problem is in the way linear_extrude() generates its
mesh with twist. The attached image of the twisted extrusion with thrown
together shows self-intersections even for low values of the twist. The
image corresponds to the code:
IGewinde(10.4, 11.8, 18, 9);
module IGewinde(r1, r2, n, h){
r=(r1+r2*r2/r1)/2.141;
// linear_extrude(height=h, twist=-360*h/n)
linear_extrude(height=h, twist=-20*h/n)
difference(){
circle(r2);
translate([0,r-r1,0]) circle(r);
}
}
It has been reported here before that linear_extrude with twist makes a
wrong choice for the quad triangulations: it chooses the longest diagonal.
In the case of IGewinde(), that decision produces a self-intersection in
the thin tips of the base polygon. If the shortest quad diagonal were taken
instead, self-intersections would not happen. Note that the shortest
diagonal is chosen in the inner surface of the ring. In fact, the same
diagonal choice is done in the inner surface and the outer surface. It is a
good choice (the shortest diagonal) for one surface and the worst (the
longest) for the other. It is a bug in linear_extrude.
Em sex., 17 de jan. de 2020 às 16:57, Projects around the FreeBASIC
compiler notifications@github.com escreveu:
Indeed, when I cut the tips it renders:
module IGewinde(r1, r2, n, h)
{
r=(r1+r2r2/r1)/2.141;
linear_extrude(height=h, twist=-360h/n)
difference(){
circle(r2);
translate([0,r-r1,0]) circle(r);
polygon(points=[[0,0],[r2,r2],[-r2,r2]]);
}
}
Thanks for pointing to the issue! This granularity is fine enough.
I didn't find any hint that linear_extrude doesn't like thin tips. The
warning seams to be a good idea, at least in the documentation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/openscad/openscad/issues/802?email_source=notifications&email_token=AEYKSLJRNIM7JZT4TONF6ZDQ6HPPHA5CNFSM4APTRKNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJIJ7PY#issuecomment-575709119,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEYKSLKA3GHT64MGGHJ7GADQ6HPPHANCNFSM4APTRKNA
.
Yes linear extrude with twist is known to create self intersections with
thin walls unless slices is set.
On Sat, 18 Jan 2020, 16:18 Ronaldo Persiano, rcmpersiano@gmail.com wrote:
I was intrigued that the polygon linear extruded in you IGewinde() module
renders happily while its extrusion fails and I have investigated the issue
a little further. The problem is in the way linear_extrude() generates its
mesh with twist. The attached image of the twisted extrusion with thrown
together shows self-intersections even for low values of the twist. The
image corresponds to the code:
IGewinde(10.4, 11.8, 18, 9);
module IGewinde(r1, r2, n, h){
r=(r1+r2*r2/r1)/2.141;
// linear_extrude(height=h, twist=-360*h/n)
linear_extrude(height=h, twist=-20*h/n)
difference(){
circle(r2);
translate([0,r-r1,0]) circle(r);
}
}
It has been reported here before that linear_extrude with twist makes a
wrong choice for the quad triangulations: it chooses the longest diagonal.
In the case of IGewinde(), that decision produces a self-intersection in
the thin tips of the base polygon. If the shortest quad diagonal were taken
instead, self-intersections would not happen. Note that the shortest
diagonal is chosen in the inner surface of the ring. In fact, the same
diagonal choice is done in the inner surface and the outer surface. It is a
good choice (the shortest diagonal) for one surface and the worst (the
longest) for the other. It is a bug in linear_extrude.
Em sex., 17 de jan. de 2020 às 16:57, Projects around the FreeBASIC
compiler notifications@github.com escreveu:
Indeed, when I cut the tips it renders:
module IGewinde(r1, r2, n, h)
{
r=(r1+r2r2/r1)/2.141;
linear_extrude(height=h, twist=-360h/n)
difference(){
circle(r2);
translate([0,r-r1,0]) circle(r);
polygon(points=[[0,0],[r2,r2],[-r2,r2]]);
}
}
Thanks for pointing to the issue! This granularity is fine enough.
I didn't find any hint that linear_extrude doesn't like thin tips. The
warning seams to be a good idea, at least in the documentation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/openscad/openscad/issues/802?email_source=notifications&email_token=AEYKSLJRNIM7JZT4TONF6ZDQ6HPPHA5CNFSM4APTRKNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJIJ7PY#issuecomment-575709119,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEYKSLKA3GHT64MGGHJ7GADQ6HPPHANCNFSM4APTRKNA
.