discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

How to use nonconvex sections?

YV
yur_vol@yahoo.com
Tue, Jun 16, 2026 9:16 AM

I firstly try to HULL my sections but it does not work the way I want
Is it bnf the only way?


include <BOSL2/std.scad>
a=21; //
b=0.9*a;
k=1;
m=k/b;
module section(y){    
path =[
 for (fi=[0:1:360]) let(
   pt =(a*fi-b*sin(fi))/360, 
   pt2=m*(b-b*cos(fi))
   ) [pt,pt2]
 ];
 yrot(90)zrot(90)left(a/2)linear_extrude(0.01)scale([1,y])polygon(path);
}
hull(){
            #section(1);
    right(5)section(1.2);
}
I firstly try to HULL my sections but it does not work the way I want\ Is it bnf the only way? --- ``` include <BOSL2/std.scad> ``` ``` a=21; // ``` ``` b=0.9*a; ``` ``` k=1; ``` ``` m=k/b; ``` ``` module section(y){ ``` ``` path =[ ``` ``` for (fi=[0:1:360]) let( ``` ``` pt =(a*fi-b*sin(fi))/360, ``` ``` pt2=m*(b-b*cos(fi)) ``` ``` ) [pt,pt2] ``` ``` ]; ``` ``` yrot(90)zrot(90)left(a/2)linear_extrude(0.01)scale([1,y])polygon(path); ``` ``` } ``` ``` hull(){ ``` ``` #section(1); ``` ``` right(5)section(1.2); ``` ``` } ```
JB
Jordan Brown
Tue, Jun 16, 2026 6:51 PM

On 6/16/2026 2:16 AM, yur_vol--- via Discuss wrote:

I firstly try to HULL my sections but it does not work the way I want
Is it bnf the only way?

I assume that you're talking about the fact that the shallow concave
curve on the original objects is lost.

Yes, that's the way that hull is defined.  It always yields a convex object.

In OpenSCAD itself the only way to do what I think you want is to create
a polyhedron.  (Which really isn't that hard for this case, because the
two sides have the same number of points and the same basic shape.)

In BOSL2, I believe that skin() will do exactly what I think  you're
looking for.  You might also look at rounded_prism(), which will so
things like rounding for simpler cases (probably including this one).

On 6/16/2026 2:16 AM, yur_vol--- via Discuss wrote: > > I firstly try to HULL my sections but it does not work the way I want > Is it bnf the only way? > I assume that you're talking about the fact that the shallow concave curve on the original objects is lost. Yes, that's the way that hull is defined.  It always yields a convex object. In OpenSCAD itself the only way to do what I think you want is to create a polyhedron.  (Which really isn't that hard for this case, because the two sides have the same number of points and the same basic shape.) In BOSL2, I believe that skin() will do exactly what I think  you're looking for.  You might also look at rounded_prism(), which will so things like rounding for simpler cases (probably including this one).
YV
yur_vol@yahoo.com
Thu, Jun 18, 2026 7:02 AM

Thank you!

SKIN works perfectly

Thank you! SKIN works perfectly