I'm trying to draw/code an FPV camera mount in OpenSCAD and I've come to a sticking point.
I've done the camera body and lens, rotated them and removed them from a block to make a camera shaped impression I can put zip ties round.
The problem I've got is the hole for the wires. I'm thinking I need to make a polyhedron from 4 points on the back of the rotated camera to 4 points on the block which hasn't been rotated.
Is there an easy solution to this or do I just need to do the geometry to work out the 4 points on the back of the camera?
i.e. I'm looking to make a hole that replaces the "//REPLACE ME" lines of code below that goes from the corner of the camera to the middle of the rear face of the block.
Iain.
echo(version=version());
//Frame
Layerheight=10;
// Camera
BodyWid = 19;
BodyDep = 10;
BodyHei = 19;
LensRad1 = 7.5;
LensLen1 = 12;
LensRad2 = 9.5;
LensLen2 = 8;
LensX = 10;
LensY = 10;
CableHoleX = 6;
CableHoleY = 4;
CableHoleZ = 20;
// Zip Ties
TieWidth = 3;
TieThick = 2;
LensTieOffsetFromLens = 3;
CamTieRad = 18;
//Main Block
BlockWidth = CamTieRad*2;
BlockLength = Layerheight*2;
BlockHeight = 30;
difference()
{
// Main Block with Cable Tie Loop
translate([0,-5,-5])
{
difference()
{
cube([BlockWidth,BlockLength,BlockHeight]);
translate([BlockWidth/2,BlockLength-Layerheight,0])
{
rotate([-90,0,0])
difference()
{
cylinder(r=CamTieRad+TieThick,h=TieWidth);
cylinder(r=CamTieRad,h=TieWidth);
}
}
}
}
// Camera and Cable Tie Loop
translate ([BlockWidth/2-(BodyWid/2) ,5,0])
{
rotate([-10,0,0])
{
cube([BodyHei, BodyWid, BodyDep]);
translate ([LensX,LensY,BodyDep])
{
cylinder(r=LensRad1,h=LensLen1);
}
translate ([LensX,LensY,BodyDep+LensLen1])
{
cylinder(r=LensRad2,h=LensLen2);
}
translate ([BodyWid-CableHoleX,0,-CableHoleZ]) // REPLACE ME
{
cube([CableHoleX, CableHoleY, CableHoleZ]); // REPLACE ME
}
translate([LensX,LensY,BodyDep+LensLen1/2-(TieWidth/2)])
{
difference()
{
cylinder(r=LensRad1+LensTieOffsetFromLens+TieThick,h=TieWidth);
cylinder(r=LensRad1+LensTieOffsetFromLens,h=TieWidth);
}
}
}
}
}