Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenSCAD source code: Bayonet desk mount for Nissan fog lamp
// Nissan Fog Light Base
// Ed Nisley KE4ZNU 2020-04-20
/* [Hidden] */
ThreadThick = 0.25;
ThreadWidth = 0.40;
HoleWindage = 0.2;
function IntegerMultiple(Size,Unit) = Unit * ceil(Size / Unit);
Protrusion = 0.1; // make holes end cleanly
//----------------------
// Dimensions
ID = 0;
OD = 1;
LENGTH = 2;
/* [Fog Light] */
ShellBase = [49.0,55.0,10.0];
Dog = [55.0,60.0,7.0];
DogWidth = 21.0;
DogAngle = atan(DogWidth / ShellBase[ID]);
echo(str("Dog angle: ",DogAngle));
ReflectorOD = 90.0;
LensOD = 110.0;
LensAngle = -90; // peak relative to dogs
WallThick = 4.0;
BaseThick = 2*WallThick;
CableOD = 3.5;
$fn = 3*4*5;
//-------------------
// Useful shapes
module Dogs(h=Dog[LENGTH]) {
translate([0,0,h/2])
intersection() {
cube([Dog[OD],DogWidth,h],center=true);
cylinder(d=Dog[OD],h=h,center=true);
}
}
//-------------------
// Build it
difference() {
union() {
cylinder(d=(Dog[OD] + 2*WallThick),h=(BaseThick + ShellBase[LENGTH]));
intersection() {
resize([0,0,2*BaseThick])
sphere(d=LensOD);
translate([0,0,BaseThick/2])
cube([2*LensOD,2*ReflectorOD,BaseThick],center=true);
}
}
translate([0,0,BaseThick])
cylinder(d=ShellBase[OD],h=ShellBase[LENGTH] + Protrusion);
translate([0,0,BaseThick]) {
Dogs();
rotate(1.5*DogAngle)
Dogs();
rotate(2*DogAngle)
Dogs(2*ShellBase[LENGTH]);
}
rotate(LensAngle)
translate([0.75*ShellBase[ID]/2,0,-Protrusion]) {
cylinder(d=CableOD,h=2*BaseThick,$fn=8);
translate([LensOD/2,0,CableOD/2])
cube([LensOD,CableOD,CableOD + Protrusion],center=true);
}
translate([31,0,ThreadThick-Protrusion])
cube([23.0,55.0,2*ThreadThick],center=true);
}
linear_extrude(height=2*ThreadWidth + Protrusion) {
translate([32,0,-Protrusion])
rotate(-90) mirror([1,0,0])
text(text="Ed Nisley",size=6,font="Arial:style:Bold",halign="center");
translate([23,0,-Protrusion])
rotate(-90) mirror([1,0,0])
text(text="softsolder.com",size=5,font="Arial:style:Bold",halign="center");
}
@ednisley

This comment has been minimized.

Copy link
Owner Author

@ednisley ednisley commented Apr 21, 2020

More details on my blog at https://wp.me/poZKh-8Zg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.