discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Confused as how a this could happen

A
adrian
Tue, Jan 10, 2017 6:52 PM

nophead wrote

On 9 January 2017 at 20:58, nop head <

nop.head@

> wrote:

I am struggling to understand why it is so complicated. Why do you do the
end bits separately and not just intersect some oversized wedges with
rotate_extrude?

The end bits are when the angle is not an even multiple of 360 in the case
of when max_angle_exact is false (uses rotate_extrude and intersects it with
a wedge) or max_angle doesn't divide angle evenly when max_angle_exact=true.
Without that, the end faces would not fit the original 2D extruded object
exactly.

nophead 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)],
]);
}
}

$fn = 32;

module rotate_extrude_angle(angle, radius, convexity)
intersection() {
rotate_extrude(convexity = convexity)
children();

     hull()
         linear_extrude(height = 1, convexity = convexity)
             pie_slice(radius, 0, angle);

 }

rotate_extrude_angle(angle=45, radius=1, convexity=5)
arrow_2d(1, .5, .25);

module arrow_2d(l,w,a)
{
polygon([[0,0],[w,0],[w,l-a],[w*1.3,l-a],[0,l]]);
}

The reason I didn't do that was specifically because I wanted an /exact/
fit.  Note the following code using your function:

And now see the image of where the rotate_extrude_angle() interfaces with a
liner extrusion of the same object:
http://forum.openscad.org/file/n20005/nophead-rotate-extrude.png
Notice that they don't fit exactly.

--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20005.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

nophead wrote > On 9 January 2017 at 20:58, nop head &lt; > nop.head@ > &gt; wrote: > >> I am struggling to understand why it is so complicated. Why do you do the >> end bits separately and not just intersect some oversized wedges with >> rotate_extrude? The end bits are when the angle is not an even multiple of 360 in the case of when max_angle_exact is false (uses rotate_extrude and intersects it with a wedge) or max_angle doesn't divide angle evenly when max_angle_exact=true. Without that, the end faces would not fit the original 2D extruded object exactly. nophead 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)], > ]); > } > } > > $fn = 32; > > module rotate_extrude_angle(angle, radius, convexity) > intersection() { > rotate_extrude(convexity = convexity) > children(); > > hull() > linear_extrude(height = 1, convexity = convexity) > pie_slice(radius, 0, angle); > > } > > > rotate_extrude_angle(angle=45, radius=1, convexity=5) > arrow_2d(1, .5, .25); > > module arrow_2d(l,w,a) > { > polygon([[0,0],[w,0],[w,l-a],[w*1.3,l-a],[0,l]]); > } The reason I didn't do that was specifically because I wanted an /exact/ fit. Note the following code using your function: And now see the image of where the rotate_extrude_angle() interfaces with a liner extrusion of the same object: <http://forum.openscad.org/file/n20005/nophead-rotate-extrude.png> Notice that they don't fit exactly. -- View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20005.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Tue, Jan 10, 2017 6:54 PM

nophead 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

a previous version.

Yes.

What was the hull() for?  Something that was left in by accident?  I didn't
understand why it was there.

--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20006.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

nophead 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 > a previous version. > > Yes. What was the hull() for? Something that was left in by accident? I didn't understand why it was there. -- View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20006.html Sent from the OpenSCAD mailing list archive at Nabble.com.
NH
nop head
Tue, Jan 10, 2017 6:58 PM

Yes I change my mind part way through and forgot to delete it.

My plan was to rotate five copies of the 2D object rotated to be vertical
and hull them, but OpenSCAD doesn't like hulling 2D objects in 3D, it
crashed.

On 10 January 2017 at 18:54, adrian adrianh.bsc@gmail.com wrote:

nophead 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

a previous version.

Yes.

What was the hull() for?  Something that was left in by accident?  I didn't
understand why it was there.

--
View this message in context: http://forum.openscad.org/
Confused-as-how-a-this-could-happen-tp19958p20006.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

Yes I change my mind part way through and forgot to delete it. My plan was to rotate five copies of the 2D object rotated to be vertical and hull them, but OpenSCAD doesn't like hulling 2D objects in 3D, it crashed. On 10 January 2017 at 18:54, adrian <adrianh.bsc@gmail.com> wrote: > nophead 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 > > a previous version. > > > > Yes. > > What was the hull() for? Something that was left in by accident? I didn't > understand why it was there. > > > > -- > View this message in context: http://forum.openscad.org/ > Confused-as-how-a-this-could-happen-tp19958p20006.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 >
R
Ronaldo
Tue, Jan 10, 2017 7:27 PM

adrian wrote

The end bits are when the angle is not an even multiple of 360 in the case
of when max_angle_exact is false (uses rotate_extrude and intersects it
with a wedge) or max_angle doesn't divide angle evenly when
max_angle_exact=true.  Without that, the end faces would not fit the
original 2D extruded object exactly.

The reason I didn't do that was specifically because I wanted an

/

exact

/

fit.  Note the following code using your function:

And now see the image of where the rotate_extrude_angle() interfaces with
a liner extrusion of the same object:
(...)
Notice that they don't fit exactly.

I can't see anything in your image but I guess I understand your point now.

With the new rotate_extrude (with an angle argument) the extreme sections
are identical to the given 2D shape. So any lateral joint will fit exactly
if it is based on the 2D shape. The angle subdivision does not comply with
$fn exactly though except when the angle is multiple of 360/$fn. So if you
try to fit something on top of the rotate_extrude, $fn is useless.

As far as I understand it, there is no way to reproduce the new
rotate_extrude by intersections of the old one for angles such 360/$fn is
not an integer. Anyway, the results I have gotten with your code does not
seems to preserve the shape at the extremities of the extrusion.

--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20010.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

adrian wrote > The end bits are when the angle is not an even multiple of 360 in the case > of when max_angle_exact is false (uses rotate_extrude and intersects it > with a wedge) or max_angle doesn't divide angle evenly when > max_angle_exact=true. Without that, the end faces would not fit the > original 2D extruded object exactly. > > The reason I didn't do that was specifically because I wanted an / > exact / > fit. Note the following code using your function: > > And now see the image of where the rotate_extrude_angle() interfaces with > a liner extrusion of the same object: > (...) > Notice that they don't fit exactly. I can't see anything in your image but I guess I understand your point now. With the new rotate_extrude (with an angle argument) the extreme sections are identical to the given 2D shape. So any lateral joint will fit exactly if it is based on the 2D shape. The angle subdivision does not comply with $fn exactly though except when the angle is multiple of 360/$fn. So if you try to fit something on top of the rotate_extrude, $fn is useless. As far as I understand it, there is no way to reproduce the new rotate_extrude by intersections of the old one for angles such 360/$fn is not an integer. Anyway, the results I have gotten with your code does not seems to preserve the shape at the extremities of the extrusion. -- View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20010.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Tue, Jan 10, 2017 7:34 PM

Did you update the wedge_extrude that I posted? That will fix the issue.
Everything fits perfectly.

--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20011.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Did you update the wedge_extrude that I posted? That will fix the issue. Everything fits perfectly. -- View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20011.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Tue, Jan 10, 2017 7:37 PM

The cyan is the linear extrude and the grey is the rotation extrude. The
image shows the right most arrow tip which do not align.

--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20012.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

The cyan is the linear extrude and the grey is the rotation extrude. The image shows the right most arrow tip which do not align. -- View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20012.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Tue, Jan 10, 2017 9:26 PM

Adrian,

Note that using the < raw> </ raw> markup is not good, as nabble deletes it
before sending the post to the mailing-list.
Use either plain text or < quote> </ quote>, manually typed - if you use the
button above it deletes highlighted text and replaces it with the previous
post's quote.


Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20014.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Adrian, Note that using the < raw> </ raw> markup is not good, as nabble deletes it before sending the post to the mailing-list. Use either plain text or < quote> </ quote>, manually typed - if you use the button above it deletes highlighted text and replaces it with the previous post's quote. ----- Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20014.html Sent from the OpenSCAD mailing list archive at Nabble.com.
A
adrian
Wed, Jan 11, 2017 4:19 PM

Can that not be fixed or have a proper code tag?

--
View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20025.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Can that not be fixed or have a proper code tag? -- View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20025.html Sent from the OpenSCAD mailing list archive at Nabble.com.
NH
nop head
Wed, Jan 11, 2017 8:33 PM

The mailing list works a lot better than the forum IMHO.

On 11 January 2017 at 16:19, adrian adrianh.bsc@gmail.com wrote:

Can that not be fixed or have a proper code tag?

--
View this message in context: http://forum.openscad.org/
Confused-as-how-a-this-could-happen-tp19958p20025.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

The mailing list works a lot better than the forum IMHO. On 11 January 2017 at 16:19, adrian <adrianh.bsc@gmail.com> wrote: > Can that not be fixed or have a proper code tag? > > > > -- > View this message in context: http://forum.openscad.org/ > Confused-as-how-a-this-could-happen-tp19958p20025.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 >
M
MichaelAtOz
Wed, Jan 11, 2017 9:11 PM

adrian wrote

Can that not be fixed or have a proper code tag?

Nabble support levels cannot be compared to that here...

Are there any Nabble experts out there?

I looked into NAML and how it all hangs together, it's possible, but it's
not something I want to be the sole-source single point of failure with a
customised forum.

I think Marius was thinking of alternatives and is open to ideas, but like
us all we have our real work to do. Any alternative would need to meet both
the forum and mailing-list core users requirements.

Another alternative is to italicise the code.

/i=true;
linear_extrude(height=50,center=true,convexity=10,twist=5)
translate([-30,-5,0])
text("Italics rule!",font="Liberation Sans:style=Bold Italic");
/


Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20032.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

adrian wrote > Can that not be fixed or have a proper code tag? Nabble support levels cannot be compared to that here... Are there any Nabble experts out there? I looked into NAML and how it all hangs together, it's possible, but it's not something I want to be the sole-source single point of failure with a customised forum. I think Marius was thinking of alternatives and is open to ideas, but like us all we have our real work to do. Any alternative would need to meet both the forum and mailing-list core users requirements. Another alternative is to italicise the code. /i=true; linear_extrude(height=50,center=true,convexity=10,twist=5) translate([-30,-5,0]) text("Italics rule!",font="Liberation Sans:style=Bold Italic"); / ----- Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Confused-as-how-a-this-could-happen-tp19958p20032.html Sent from the OpenSCAD mailing list archive at Nabble.com.