discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

chain_hull does not work with For?

YV
yur_vol@yahoo.com
Thu, Nov 20, 2025 10:06 PM

I use hull for building curved tubes
but when I try to replace “for” with chain_hull it does not work

module tube_in(pd,p,n,w){   //internal tube
    pbr = resample_path(pd, n+1, closed=false);
   // echo(pbr);
    for (i=[1:1:n]){
       hull(){  
          path_copies(p, 1,1,pbr[i-1][0], rotate_children=true,closed=false) rotate(90,[0,1,0])translate([0,0,-0.08])cylinder(d=pbr[i-1][1]+w,h=0.1,$fn=tube_fn);
          path_copies(p, 1,1,pbr[i][0], rotate_children=true,closed=false) rotate(90,[0,1,0])translate([0,0,-0.08])cylinder(d=pbr[i][1]+w,h=0.1,$fn=tube_fn);
       }} }
I use hull for building curved tubes\ but when I try to replace “for” with chain_hull it does not work ``` module tube_in(pd,p,n,w){ //internal tube ``` ``` pbr = resample_path(pd, n+1, closed=false); ``` ``` // echo(pbr); ``` ``` for (i=[1:1:n]){ ``` ``` hull(){ ``` ``` path_copies(p, 1,1,pbr[i-1][0], rotate_children=true,closed=false) rotate(90,[0,1,0])translate([0,0,-0.08])cylinder(d=pbr[i-1][1]+w,h=0.1,$fn=tube_fn); ``` ``` path_copies(p, 1,1,pbr[i][0], rotate_children=true,closed=false) rotate(90,[0,1,0])translate([0,0,-0.08])cylinder(d=pbr[i][1]+w,h=0.1,$fn=tube_fn); ``` ``` }} } ```