Simple solution indeed. And easier to understand. I guess the hull() is an
innocuous remaining of a previous version.
On 09. jan. 2017 22:19, nop head wrote:
Something like this ?:
$fn=8*4;
rotate_extrude(angle=45)
union() {
square([.5,.75]);
polygon([[0,.75],[.65,.75],[0,1]]);
}
Carsten Arnholm
Yes but Adrian said he has a version before rotate_extrude takes an angle.
And easier to understand. I guess the hull() is an innocuous remaining of
On 09. jan. 2017 22:19, nop head wrote:
Something like this ?:
$fn=8*4;
rotate_extrude(angle=45)
union() {
square([.5,.75]);
polygon([[0,.75],[.65,.75],[0,1]]);
}
Carsten Arnholm
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
If @adrian is worried out getting whole segments then why not use $fa,
while setting $fs to a very small number?
On 9 January 2017 at 23:31, nop head nop.head@gmail.com wrote:
Yes but Adrian said he has a version before rotate_extrude takes an angle.
And easier to understand. I guess the hull() is an innocuous remaining of
On 09. jan. 2017 22:19, nop head wrote:
Something like this ?:
$fn=8*4;
rotate_extrude(angle=45)
union() {
square([.5,.75]);
polygon([[0,.75],[.65,.75],[0,1]]);
}
Carsten Arnholm
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
nophead,
You already calculated the new radius. With this pie_slice() doesn't need
more than the intersection of a circle with a triag. Also negative angles
may be allowed.
module pie_slice(r, start_angle, end_angle)
intersection() {
circle(r);
polygon((r * sqrt(2) + 1)*[ [0,0],[cos(start_angle),
sin(start_angle)], [cos(end_angle), sin(end_angle)]]);
}
--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p19998.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
You cant get more than 180 degrees of a pie with a triangle intersection
and its radius would tend towards infinity. I think 4 triangles is the
least needed for an angle close to 360 without the radius getting very
large.
The version I presented works up to 360. I wrote it long before
rotate_extrude took an angle and before list comprehensions and offset.
On 10 January 2017 at 10:58, Parkinbot rudolf@parkinbot.com wrote:
nophead,
You already calculated the new radius. With this pie_slice() doesn't need
more than the intersection of a circle with a triag. Also negative angles
may be allowed.
module pie_slice(r, start_angle, end_angle)
intersection() {
circle(r);
polygon((r * sqrt(2) + 1)*[ [0,0],[cos(start_angle),
sin(start_angle)], [cos(end_angle), sin(end_angle)]]);
}
--
View this message in context: http://forum.openscad.org/
Confused-as-how-a-this-could-happen-tp19958p19998.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 9 January 2017 at 21:19, nop head nop.head@gmail.com wrote:
Something like this ?:
module pie_slice(r, start_angle, end_angle) {
R = r * sqrt(2) + 1;
a0 = (4 * start_angle + 0 * end_angle) / 4;
a1 = (3 * start_angle + 1 * end_angle) / 4;
a2 = (2 * start_angle + 2 * end_angle) / 4;
a3 = (1 * start_angle + 3 * end_angle) / 4;
a4 = (0 * start_angle + 4 * end_angle) / 4;
if(end_angle > start_angle)
intersection() {
circle(r);
polygon([
[0,0],
[R * cos(a0), R * sin(a0)],
[R * cos(a1), R * sin(a1)],
[R * cos(a2), R * sin(a2)],
[R * cos(a3), R * sin(a3)],
[R * cos(a4), R * sin(a4)],
]);
}
}
That looks like a similar approach to something I did to make short arcs of
tube. It boils down to making a torus by rotate_extruding a circle,
subtracting a thinner torus to make a hollow one then intersecting with the
output of this module, which produces an 8-sided wedge (which becomes a
hexagon when ang=360) by linear_extruding a polygon.
module wedge (thickness, rad, ang)
translate ([0,0,-(thickness/2)-1]) {
linear_extrude (height = thickness+2) {
polygon(points=[
[radcos(ang/2),-radsin(ang/2)],
[0,0],
[radcos(ang/2),radsin(ang/2)],
[radcos(ang/3),radsin(ang/3)],
[radcos(ang/6),radsin(ang/6)],
[rad,0],
[radcos(ang/6),-radsin(ang/6)],
[radcos(ang/3),-radsin(ang/3)]],
paths=[[0,1,2,3,4,5,6,7]]);}
}
Just remember to make rad big enough that the wedge will totally enclose
the object to be rotate_extruded.
Ian
--
Stand firm for what you believe in, until and unless logic and experience
prove you wrong. Remember: when the emperor looks naked, the emperor is
naked, the truth and a lie are not "sort-of the same thing" and there is
no aspect, no facet, no moment of life that can't be improved with pizza.
-Daria Morgendorffer
Yes but since rotate extrude now takes an angle these workarounds are just
an exercise.
On 10 January 2017 at 13:59, Ian Nichols ian.a.nichols@gmail.com wrote:
On 9 January 2017 at 21:19, nop head nop.head@gmail.com wrote:
Something like this ?:
module pie_slice(r, start_angle, end_angle) {
R = r * sqrt(2) + 1;
a0 = (4 * start_angle + 0 * end_angle) / 4;
a1 = (3 * start_angle + 1 * end_angle) / 4;
a2 = (2 * start_angle + 2 * end_angle) / 4;
a3 = (1 * start_angle + 3 * end_angle) / 4;
a4 = (0 * start_angle + 4 * end_angle) / 4;
if(end_angle > start_angle)
intersection() {
circle(r);
polygon([
[0,0],
[R * cos(a0), R * sin(a0)],
[R * cos(a1), R * sin(a1)],
[R * cos(a2), R * sin(a2)],
[R * cos(a3), R * sin(a3)],
[R * cos(a4), R * sin(a4)],
]);
}
}
That looks like a similar approach to something I did to make short arcs
of tube. It boils down to making a torus by rotate_extruding a circle,
subtracting a thinner torus to make a hollow one then intersecting with the
output of this module, which produces an 8-sided wedge (which becomes a
hexagon when ang=360) by linear_extruding a polygon.
module wedge (thickness, rad, ang)
translate ([0,0,-(thickness/2)-1]) {
linear_extrude (height = thickness+2) {
polygon(points=[
[radcos(ang/2),-radsin(ang/2)],
[0,0],
[radcos(ang/2),radsin(ang/2)],
[radcos(ang/3),radsin(ang/3)],
[radcos(ang/6),radsin(ang/6)],
[rad,0],
[radcos(ang/6),-radsin(ang/6)],
[radcos(ang/3),-radsin(ang/3)]],
paths=[[0,1,2,3,4,5,6,7]]);}
}
Just remember to make rad big enough that the wedge will totally enclose
the object to be rotate_extruded.
Ian
--
Stand firm for what you believe in, until and unless logic and experience
prove you wrong. Remember: when the emperor looks naked, the emperor is
naked, the truth and a lie are not "sort-of the same thing" and there is
no aspect, no facet, no moment of life that can't be improved with pizza.
-Daria Morgendorffer
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Sorry, of course you are right ...
--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20003.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Hi @nophead,
I'll have to take a look at your solution later to see what you've done.
However, I have discovered the reason for the issue I was having. The wedge
extrude when centred around the xy plane, was too big.The problem was that
the ends were not scaled on the x-axis properly to make the end faces fit.
Here is my solution (I updated the module comment to show how width is
calculated and added a comment in module where the change was made):
This will make the pieces fit perfectly.
--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20004.html
Sent from the OpenSCAD mailing list archive at Nabble.com.