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.
This commit is contained in:
Simon Brooke 2025-09-06 22:18:59 +01:00
parent d2399a464c
commit 113546782f
4 changed files with 86 additions and 4 deletions

View file

@ -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();

65
model/hull.scad Normal file
View file

@ -0,0 +1,65 @@
// hull.scad
// (c) Simon Brooke 2025; CC-BY-SA
include <BOSL2/std.scad>
include <BOSL2/skin.scad>
// 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();

View file

@ -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 ],

View file

@ -4,10 +4,25 @@
// Top level final rendering
include <BentSim/Library/Velo_rider.scad>
include <subframe.scad>
include <fourbar.scad>
// include <hull.scad>
rotate([0, 0, 270])
translate([0, 0, 500])
translate([0, 0, 400])
subframe();
fourbar(700, 100, 30, 35, 650);
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);*/