From 113546782fcbb2a3f7bd14674f0e5101c1dfadb1 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Sat, 6 Sep 2025 22:18:59 +0100 Subject: [PATCH] I've written a hull which in itself isn't dreadful, but which has revealed fragility in the way OpenSCAD handles name collisions. This makes mixing libraries highly problematic. Needs thought. --- model/fourbar.scad | 3 +- model/hull.scad | 65 +++++++++++++++++++++++++++++++++++++++++ model/library/skew.scad | 3 +- model/tricycle.scad | 19 ++++++++++-- 4 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 model/hull.scad diff --git a/model/fourbar.scad b/model/fourbar.scad index 3025fb8..340cdb0 100644 --- a/model/fourbar.scad +++ b/model/fourbar.scad @@ -26,7 +26,7 @@ module fourbar_leg(length=1000, chord=100, long_skew=30, lat_skew=30) { cylinder(h=chord, r=12); // aerofoil section - skew([0, long_skew, 0, 0, 0, 0]) + sskew([0, long_skew, 0, 0, 0, 0]) rotate([lat_skew, 0, 180]) color("black") airfoil(h=length, L=chord); @@ -71,3 +71,4 @@ module fourbar(length=1000, chord=100, long_skew=30, lat_skew=30, shoulder=650) } +// fourbar(); \ No newline at end of file diff --git a/model/hull.scad b/model/hull.scad new file mode 100644 index 0000000..cf08e2a --- /dev/null +++ b/model/hull.scad @@ -0,0 +1,65 @@ +// hull.scad + +// (c) Simon Brooke 2025; CC-BY-SA + +include +include + +// doesn't work, but it's promising +module hull_i() { + color("darkgreen", 0.5) + difference() { + translate([1000, 0, 600]) + rotate([0, 5, 0]) + scale([3.49, .79, 1.19]) + difference() { + sphere(r=500); + cube([1000, 1000, 1000]); + } + + intersection() { + translate([1000, 0, 600]) + rotate([0, 5, 0]) + scale([3.5, .8, 1.2]) + sphere(r=500); + + rotate([0, 95, 0]) + translate([-500,0,0]) + prismoid(size1=[1000, 1000], + size2=[500, 600], + height=3000); + } + } +} + +module hull() { + intersection() { + translate([2000,0,0]) + rotate([180, 90, 0]) + scale([20, 16, 20]) + rotate_extrude() + //rotate([ 0, 90, 0]) + import("library/hull-volume-of-rotation.svg"); + + translate([-900,0, -110]) + rotate([0, 90, 0]) + prismoid(size1=[1100, 1000], + size2=[400, 600], + height=3000); + } + + rotate([0,90,0]) + translate([0,0,-2070]) + difference() { + skin( + [ellipse($fn=64,r=[350,30],center=true), + ellipse($fn=64,r=[430,340],center=true)], z=[0,1200], + slices=40,sampling="length",method="reindex"); + skin( + [ellipse($fn=64,r=[344,24],center=true), + ellipse($fn=64,r=[424,334],center=true)], z=[-1,1201], + slices=40,sampling="length",method="reindex"); + } +} + +hull(); \ No newline at end of file diff --git a/model/library/skew.scad b/model/library/skew.scad index ec76370..f7ecb0b 100644 --- a/model/library/skew.scad +++ b/model/library/skew.scad @@ -8,7 +8,8 @@ * z along x * z along y */ -module skew(dims) { +/* renamed to sskew to resolve name conflict with BOSL2 */ +module sskew(dims) { matrix = [ [ 1, dims[0]/45, dims[1]/45, 0 ], [ dims[2]/45, 1, dims[4]/45, 0 ], diff --git a/model/tricycle.scad b/model/tricycle.scad index c77d5e6..17cc077 100644 --- a/model/tricycle.scad +++ b/model/tricycle.scad @@ -4,10 +4,25 @@ // Top level final rendering +include + include include +// include rotate([0, 0, 270]) -translate([0, 0, 500]) +translate([0, 0, 400]) subframe(); -fourbar(700, 100, 30, 35, 650); \ No newline at end of file +fourbar(700, 100, 30, 35, 650); + +//hull(); + +/* +prop=0.1; +seat_ang=0; +leg_ang=0; +left_fold=0; +head_ang=0; +leg_prop=0.5; + +vRider(prop, seat_ang, leg_ang, left_fold, head_ang, leg_prop);*/ \ No newline at end of file