# Rounded Polygon

172 messages
1 ... 56789
Open this post in threaded view
|

## Re: Rounded Polygon

 On 27 Apr 2019 at 22:21, nop head wrote: > It isn't the notation it the fact that in maths you don't let x mean one thing and then on the next line > make it mean some else. Again reinforcing my happiness in using a program instead of math. >  There are lots of programming languages where you > can't mutate variables. And yet they are still called variables. Fascinating. -- Magic trumps science for most people, and wishful thinking drives a lot of decision-making.     - Joe Haldeman _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Rounded Polygon

 Yes they are still called variable because they can take any value at run time but can only be assigned once. See  https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.htmlThis is how I would code Adrian's problem, although I haven't needed such a construct myself yet.r_h = is_undef(a) ? let(h = F(b), r = G(h, b)) [r, h]                  : let(r = f(a), h = g(r, a)) [r, h];r = r_h[0];h = r_h[1];Or a slightly more compact version but I think less readable:r_h = is_undef(a) ? let(h = F(b)) [G(h, b), h]                  : let(r = f(a)) [r, g(r, a)];r = r_h[0];h = r_h[1];On Sun, 28 Apr 2019 at 06:09, <[hidden email]> wrote:On 27 Apr 2019 at 22:21, nop head wrote: > It isn't the notation it the fact that in maths you don't let x mean one thing and then on the next line > make it mean some else. Again reinforcing my happiness in using a program instead of math. >  There are lots of programming languages where you > can't mutate variables. And yet they are still called variables. Fascinating. -- Magic trumps science for most people, and wishful thinking drives a lot of decision-making.     - Joe Haldeman _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Rounded Polygon

 I noticed that (at least) two people felt like the coding problem I noted was sufficiently interesting that they tried to implement it.  There is no other language I know where this would even be an interesting problem---it would just be trivial.  The fact that more than one person thought my coding problem was a sufficient challenge that it was worth doing I think demonstrates the issue with the language.   But that's not why I'm posting.  I'm posting because I finally completed my rounded_extrude module which made this possible: box = [[0,0], [0,50], [255,50], [255,0]]; rbox = roundcorners(box, curve="smooth", type="cut", all=4); difference(){   rounded_extrude(rbox, height=50, r1=2, r2=1, steps = 22, edge1="teardrop", self_intersection=false);   translate([0,0,2])     rounded_extrude(pathoffset(rbox, r=-2, closed=true), height=48, r1=4, r2=-1,steps=22,extra2=1,self_intersection=false); } So I have a rounded box with a teardrop edge at the base, a rounded top edge, and a more rounded interior bottom edge.   -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Rounded Polygon

 On 2019-05-03 11:58, adrianv wrote: > So I have a rounded box with a teardrop edge at the base, a rounded top > edge, and a more rounded interior bottom edge. > > That's very, very nice (and clever)! But what is a "teardrop edge" precisely? Carsten Arnholm _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Rounded Polygon

 I use an inverted truncated rotate_extruded teardrop on the bottom edges of my rounded objects so they don't need support when printing. I assume that is what a "teardrop edge" is.On Fri, 3 May 2019 at 12:05, <[hidden email]> wrote:On 2019-05-03 11:58, adrianv wrote: > So I have a rounded box with a teardrop edge at the base, a rounded top > edge, and a more rounded interior bottom edge. > > That's very, very nice (and clever)! But what is a "teardrop edge" precisely? Carsten Arnholm _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

 In reply to this post by William Adams-2 Yes, what I meant by "teardrop" is an edge which combines 45 degrees of a circular arc with a bevel at 45 deg so that the edge can be 3d printed without support---with the bevel down there are no unsupported areas at lower than a 45 deg angle.   William Adams-2 wrote > Okay. Discussion of a list of two-dimensional shapes, > mathematical/programmatic techniques for dividing shapes into regions, and > the possible shapes which one can use in such deconstruction. I really don't understand your question.  When people talk of dividing 2d shapes into regions they usually mean triangulating the shape.  But it sounds like you mean something else.  Maybe you should give a specific example?   -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

 In reply to this post by adrianv adrianv wrote > I really don't understand your question.  When people talk of dividing 2d > shapes into regions they usually mean triangulating the shape.  But it > sounds like you mean something else.  Maybe you should give a specific > example?   For example, given a rectangular outline of a box, I might like to split that box into two compartments, and then I might want to further split one of those compartments into three compartments (but sliced in the opposite direction). I actually did write a module for doing this (for rectangular boxes and subdivisions).  It needs dusting off, though. Ray -- Sent from: http://forum.openscad.org/_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Rounded Polygon

 That's exactly what I've been working up --- I got rectangles done, now I'm starting in on circles, next will be regular polygons, then we'll see if we can do ovals and other shapes.WilliamOn Fri, May 3, 2019 at 12:20 PM RayBellis <[hidden email]> wrote:adrianv wrote > I really don't understand your question.  When people talk of dividing 2d > shapes into regions they usually mean triangulating the shape.  But it > sounds like you mean something else.  Maybe you should give a specific > example?  For example, given a rectangular outline of a box, I might like to split that box into two compartments, and then I might want to further split one of those compartments into three compartments (but sliced in the opposite direction). I actually did write a module for doing this (for rectangular boxes and subdivisions).  It needs dusting off, though. Ray -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|

## Re: Rounded Polygon

Open this post in threaded view
|