Compare commits
No commits in common. "e8dde9987621d11917f6327b8da163d767915488" and "420a5432299344a1d6cbbcb45916bd03fe0726b4" have entirely different histories.
e8dde99876
...
420a543229
@ -36,6 +36,7 @@
|
|||||||
"parts": "all",
|
"parts": "all",
|
||||||
"piston_depth": "5",
|
"piston_depth": "5",
|
||||||
"printable": "false",
|
"printable": "false",
|
||||||
|
"render_drill_template": "false",
|
||||||
"resin_escape_diameter": "4",
|
"resin_escape_diameter": "4",
|
||||||
"scale_factor": "1",
|
"scale_factor": "1",
|
||||||
"show_curve_points": "false",
|
"show_curve_points": "false",
|
||||||
@ -83,6 +84,7 @@
|
|||||||
"pin_dia": "3",
|
"pin_dia": "3",
|
||||||
"piston_depth": "5",
|
"piston_depth": "5",
|
||||||
"printable": "true",
|
"printable": "true",
|
||||||
|
"render_drill_template": "false",
|
||||||
"resin_escape_diameter": "4",
|
"resin_escape_diameter": "4",
|
||||||
"scale_factor": "1",
|
"scale_factor": "1",
|
||||||
"screw_dia": "4.5",
|
"screw_dia": "4.5",
|
||||||
@ -135,6 +137,7 @@
|
|||||||
"pin_dia": "3",
|
"pin_dia": "3",
|
||||||
"piston_depth": "5",
|
"piston_depth": "5",
|
||||||
"printable": "true",
|
"printable": "true",
|
||||||
|
"render_drill_template": "false",
|
||||||
"resin_escape_diameter": "4",
|
"resin_escape_diameter": "4",
|
||||||
"scale_factor": "1",
|
"scale_factor": "1",
|
||||||
"screw_dia": "4.5",
|
"screw_dia": "4.5",
|
||||||
|
@ -106,8 +106,6 @@ skirt_angle=80;
|
|||||||
// Dimensions in mm
|
// Dimensions in mm
|
||||||
//length = 180;
|
//length = 180;
|
||||||
//length=fin_base;
|
//length=fin_base;
|
||||||
|
|
||||||
box_thickness = 9.6;
|
|
||||||
height = 25;
|
height = 25;
|
||||||
thick = 9.2;
|
thick = 9.2;
|
||||||
mirror_vec = [1,1,0];
|
mirror_vec = [1,1,0];
|
||||||
@ -154,6 +152,7 @@ draw_profile = false;
|
|||||||
build_fin = false;
|
build_fin = false;
|
||||||
build_box = false;
|
build_box = false;
|
||||||
build_mold = true;
|
build_mold = true;
|
||||||
|
render_drill_template = false;
|
||||||
|
|
||||||
parts = "all"; // [all, top, bottom]
|
parts = "all"; // [all, top, bottom]
|
||||||
|
|
||||||
@ -285,14 +284,13 @@ if ( build_box ) {
|
|||||||
* Render Mold
|
* Render Mold
|
||||||
*/
|
*/
|
||||||
if ( build_mold ) buildMold();
|
if ( build_mold ) buildMold();
|
||||||
|
if ( render_drill_template ) buildDrillTemplate();
|
||||||
|
|
||||||
|
|
||||||
module buildCompletFin() {
|
module buildCompletFin() {
|
||||||
difference(){
|
union(){
|
||||||
buildFin( fin_thickness );
|
buildFin( fin_thickness );
|
||||||
//buildBox();
|
//buildBox();
|
||||||
// Remove extra base
|
|
||||||
baseMask();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,32 +312,27 @@ module buildBoxMold() {
|
|||||||
// To be defined
|
// To be defined
|
||||||
}
|
}
|
||||||
|
|
||||||
module baseMask() {
|
|
||||||
fwd(OFFSET) cube([fin_base*1.1,base_extra_thickness*1.1,fin_thickness*1.1],anchor=BACK);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module usBoxMask() {
|
/**
|
||||||
left(80) color("Blue") usBox(fin_base+30,thickness = box_thickness+2*OFFSET,drill=false);
|
* Remove bottom part of the fin mold to let the box mold do the job
|
||||||
}
|
*
|
||||||
|
*/
|
||||||
|
module moldBottomMask(moldThickness = 3,height,angle) {
|
||||||
|
|
||||||
|
// Remove bottom part
|
||||||
|
//color("Red") cube([fin_width,base_extra_thickness,80],anchor=BACK);
|
||||||
/*
|
deviation = opp_ang_to_adj (height,angle);
|
||||||
module bottomSupport() {
|
//back(moldThickness)
|
||||||
moldHeight = 10;
|
back(-1)
|
||||||
moldContour = expandPath(profile,mold_extra_width);
|
down(OFFSET)
|
||||||
down(moldHeight)
|
//up(2)
|
||||||
linear_extrude (moldHeight) polygon(moldContour); // bottom support
|
color ("Blue") prismoid(
|
||||||
}
|
size1=[fin_width/2*1.2, moldThickness*2],
|
||||||
*/
|
size2=[fin_width/2*1.2, moldThickness*2+ 2*deviation],
|
||||||
|
h=height+OFFSET*2
|
||||||
module support( part ) {
|
);
|
||||||
moldHeight = 10;
|
|
||||||
moldContour = expandPath(profile,mold_extra_width);
|
|
||||||
down( (part == "bottom" ? 1 : 0) * moldHeight)
|
|
||||||
linear_extrude (moldHeight) polygon(moldContour); // bottom support
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -347,44 +340,55 @@ module support( part ) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
module buildMold() {
|
module buildMold() {
|
||||||
|
moldHeight = 10;
|
||||||
|
skirtHeight = 30;
|
||||||
|
|
||||||
|
|
||||||
|
moldContour = expandPath(profile,mold_extra_width);
|
||||||
|
buildMoldSkirt(skirtHeight,mold_extra_width,3);
|
||||||
|
|
||||||
// Bottom Mold
|
// Bottom Mold
|
||||||
if (mold_part != "top") {
|
if (mold_part != "top") {
|
||||||
|
|
||||||
// Fin mold
|
// Fin mold
|
||||||
difference() {
|
difference() {
|
||||||
support(part="bottom");
|
union() {
|
||||||
usBoxMask();
|
down(moldHeight) linear_extrude (moldHeight) polygon(moldContour); // bottom
|
||||||
|
//back(5) left(95) cube([20+10,25,moldHeight],anchor=BACK+TOP); // Box shell
|
||||||
|
difference() {
|
||||||
|
skirt( profile, moldThickness = 3 , angle = skirt_angle, moldDeep = fin_thickness );
|
||||||
|
moldBottomMask(height=fin_thickness * 3,angle=skirt_angle);
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
//moldJunctionMask(height=fin_thickness * 3,angle=skirt_angle);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
// Remove Fin
|
||||||
buildCompletFin();
|
buildCompletFin();
|
||||||
}
|
}
|
||||||
// Box mold
|
// Box mold
|
||||||
|
assert (fin_base,"fin_base missing");
|
||||||
|
echo ("fin_base----------",fin_base);
|
||||||
|
// left(80) finBoxMold( length = 130, finLength = fin_base );
|
||||||
|
//diff() {
|
||||||
difference() {
|
difference() {
|
||||||
left(80) finBoxMold( fin_base+30,part="bottom",skirt=false );
|
left(80) finBoxMold( fin_base+30,skirtAngle = skirt_angle );
|
||||||
// Remove fin
|
|
||||||
|
// Remove junction between skirt
|
||||||
|
//tag("remove")
|
||||||
|
moldJunctionMask(height=fin_thickness * 3,angle=skirt_angle);
|
||||||
|
//tag("remove")
|
||||||
buildCompletFin();
|
buildCompletFin();
|
||||||
}
|
}
|
||||||
// Mold skirt
|
//moldJunctionMask(height=fin_thickness * 3,angle=skirt_angle);
|
||||||
moldSkirt( part="bottom" );
|
|
||||||
}
|
|
||||||
// Top
|
|
||||||
if (mold_part != "bottom") up(80) {
|
|
||||||
difference(){
|
|
||||||
support(part="top");
|
|
||||||
usBoxMask();
|
|
||||||
buildCompletFin();
|
|
||||||
|
|
||||||
}
|
|
||||||
// Box mold
|
|
||||||
difference() {
|
|
||||||
left(80) finBoxMold( fin_base+30,part="top",skirt=false );
|
|
||||||
// Remove fin
|
|
||||||
//buildCompletFin();
|
|
||||||
}
|
|
||||||
// Mold skirt
|
|
||||||
down( fin_thickness * 3 ) moldSkirt( part="top" );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//up(50) buildCompletFin();
|
}
|
||||||
|
|
||||||
|
up(50) buildCompletFin();
|
||||||
|
|
||||||
//left(300) linear_extrude (skirtHeight) polygon(moldSkirtRegion);
|
//left(300) linear_extrude (skirtHeight) polygon(moldSkirtRegion);
|
||||||
/*
|
/*
|
||||||
@ -411,33 +415,6 @@ module buildMold() {
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Build the piston skirt
|
|
||||||
*
|
|
||||||
* @param part - Part could be 'top' or 'bottom'
|
|
||||||
*/
|
|
||||||
module moldSkirt( part ){
|
|
||||||
assert( part , "'part' parameter should be defined in mold skirt");
|
|
||||||
|
|
||||||
box_profile = move([-80,0],profileUS (fin_base+30));
|
|
||||||
finAndBoxProfile = path_merge_collinear(union([box_profile,profile]));
|
|
||||||
|
|
||||||
//if (part == "bottom") {
|
|
||||||
|
|
||||||
skirt( finAndBoxProfile, side = part ,moldThickness = 3 , angle = skirt_angle, moldDeep = fin_thickness );
|
|
||||||
//} else if (part == "top") {
|
|
||||||
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//moldSkirt(part="top");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module moldJunctionMask(moldThickness = 3,height,angle){
|
module moldJunctionMask(moldThickness = 3,height,angle){
|
||||||
|
|
||||||
deviation = opp_ang_to_adj (height,angle);
|
deviation = opp_ang_to_adj (height,angle);
|
||||||
@ -478,6 +455,81 @@ module buildMoldSkirt( height,offset,thickness ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mold Case
|
||||||
|
*
|
||||||
|
* @param height - Height of the case
|
||||||
|
* @param bottom - Is bottom or top
|
||||||
|
*/
|
||||||
|
module case( height , bottom=true ) {
|
||||||
|
difference() {
|
||||||
|
diff() cuboid( [ mold_length, mold_width, height ],
|
||||||
|
rounding=4,
|
||||||
|
edges=[bottom ? BOTTOM: TOP],
|
||||||
|
anchor=TOP ){
|
||||||
|
// Drills
|
||||||
|
align(BOTTOM,[FRONT+LEFT,FRONT+RIGHT,BACK+LEFT,BACK+RIGHT],inset=10,overlap=-OFFSET)
|
||||||
|
color("orange")
|
||||||
|
tag("remove")
|
||||||
|
drilling();
|
||||||
|
};
|
||||||
|
// Material holes
|
||||||
|
mirror([bottom ? 0:1,0,0])
|
||||||
|
back(38) left(55)
|
||||||
|
color("Red")
|
||||||
|
up(OFFSET)
|
||||||
|
rounded_triangle(radius=3, height=height+2*OFFSET);
|
||||||
|
// Length hole
|
||||||
|
fwd(32) cuboid([120,10,50],rounding=5);
|
||||||
|
// Side holes
|
||||||
|
left(67) cuboid([10,40,50],rounding=5);
|
||||||
|
right(67) cuboid([10,40,50],rounding=5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Drill template
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
module buildDrillTemplate() {
|
||||||
|
|
||||||
|
spacing = 38.5;
|
||||||
|
drill_depth = 15;
|
||||||
|
drill_diameter = 6;
|
||||||
|
template_height = 5;
|
||||||
|
|
||||||
|
p1 = 20;
|
||||||
|
p2 = p1-spacing;
|
||||||
|
|
||||||
|
mirror([0,0,printable ? 1 : 0]) difference() {
|
||||||
|
|
||||||
|
left(1) color ("Orange") cuboid([fin_width+7,15,10],rounding=3);
|
||||||
|
down(OFFSET) {
|
||||||
|
hull(){
|
||||||
|
left(28) cylinder(h=template_height+2*OFFSET,r=drill_diameter/2);
|
||||||
|
left(55) cylinder(h=template_height+2*OFFSET,r=drill_diameter/2);
|
||||||
|
}
|
||||||
|
hull(){
|
||||||
|
left(12) cylinder(h=template_height+2*OFFSET,r=drill_diameter/2);
|
||||||
|
left(-10) cylinder(h=template_height+2*OFFSET,r=drill_diameter/2);
|
||||||
|
}
|
||||||
|
hull(){
|
||||||
|
left(-27) cylinder(h=template_height+2*OFFSET,r=drill_diameter/2);
|
||||||
|
left(-53) cylinder(h=template_height+2*OFFSET,r=drill_diameter/2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xrot(-90) buildFin(fin_thickness + 2*CLEARING );
|
||||||
|
//left(60) cylinder(h=20,r=6/2);
|
||||||
|
up(template_height+OFFSET)
|
||||||
|
{
|
||||||
|
left(p1)
|
||||||
|
cylinder(h=drill_depth+template_height,r=drill_diameter/2,orient=DOWN);
|
||||||
|
left(p2)
|
||||||
|
cylinder(h=drill_depth,r=drill_diameter/2,orient=DOWN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// *****************
|
// *****************
|
||||||
// * Bottom insert *
|
// * Bottom insert *
|
||||||
@ -536,10 +588,109 @@ module resin_escape(length) {
|
|||||||
color ("Blue") cylinder(h=length, r=resin_escape_diameter/2);
|
color ("Blue") cylinder(h=length, r=resin_escape_diameter/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// *****************
|
||||||
|
// * Drilling *
|
||||||
|
// *****************
|
||||||
|
module drilling(){
|
||||||
|
/*fwd(20)*/ color("Red") /*up(mold_piston_height+5)*/ up(-OFFSET)
|
||||||
|
orient(DOWN)
|
||||||
|
threaded_rod(
|
||||||
|
d=merge_holes_diameter,
|
||||||
|
l=drilling_length,
|
||||||
|
pitch=1.5,
|
||||||
|
anchor=BOTTOM,
|
||||||
|
//orient=BOTTOM
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function addBase(path) = concat(path,[[fin_base,-base_extra_thickness],[0,-base_extra_thickness]]);
|
function addBase(path) = concat(path,[[fin_base,-base_extra_thickness],[0,-base_extra_thickness]]);
|
||||||
|
|
||||||
|
|
||||||
|
// Function to create a parallel bezier curve offset by a given amount
|
||||||
|
function offset_bezier_points(points, offset_distance, normal=[0,0,1]) =
|
||||||
|
[for (pt = points) pt + offset_distance * normal];
|
||||||
|
|
||||||
|
// Function to create multiple parallel bezier curves
|
||||||
|
function create_patch_points(base_points, width, steps=4) =
|
||||||
|
[for (i = [0:1:steps])
|
||||||
|
let(
|
||||||
|
t = i/steps,
|
||||||
|
offset = width * t
|
||||||
|
)
|
||||||
|
offset_bezier_points(base_points, offset)
|
||||||
|
];
|
||||||
|
|
||||||
|
// Create the bezier patch VNF
|
||||||
|
function make_bezier_patch_from_curve(base_points, width, length_steps=32, width_steps=8) =
|
||||||
|
let(
|
||||||
|
// Generate parallel curves to form patch
|
||||||
|
patch_points = create_patch_points(base_points, width, width_steps),
|
||||||
|
// Generate points for each curve
|
||||||
|
curves_points = [for (curve_pts = patch_points)
|
||||||
|
bezier_points(curve_pts, length_steps)
|
||||||
|
],
|
||||||
|
// Create vertices for VNF
|
||||||
|
vertices = flatten(curves_points),
|
||||||
|
// Calculate indices for faces
|
||||||
|
indices = [
|
||||||
|
for (i=[0:1:width_steps-1], j=[0:1:length_steps-1])
|
||||||
|
let(
|
||||||
|
idx00 = i*(length_steps+1) + j,
|
||||||
|
idx10 = (i+1)*(length_steps+1) + j,
|
||||||
|
idx11 = (i+1)*(length_steps+1) + (j+1),
|
||||||
|
idx01 = i*(length_steps+1) + (j+1)
|
||||||
|
)
|
||||||
|
each [[idx00, idx10, idx11, idx01]]
|
||||||
|
]
|
||||||
|
)
|
||||||
|
[vertices, indices];
|
||||||
|
|
||||||
|
|
||||||
|
if (false) {
|
||||||
|
|
||||||
|
//vnf = bezier_vnf(profile_curve_with_base, splinesteps=10);
|
||||||
|
|
||||||
|
/*
|
||||||
|
vnf = make_bezier_patch_from_curve(points, width=10);
|
||||||
|
back (100) {
|
||||||
|
cube([20,20,20]);
|
||||||
|
vnf_polyhedron(vnf);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
polygon(profile_curve_with_base);
|
||||||
|
vnf2 =vnf_from_region(polygon(profile_curve_with_base));
|
||||||
|
//vnf2 = vnf_from_polygons(profile_curve_with_base, fast=true);
|
||||||
|
vnf_polyhedron(vnf2);
|
||||||
|
*/
|
||||||
|
|
||||||
|
//curve_points = bezier_curve(points,N=3, splinesteps=32);
|
||||||
|
curve_points = bezpath_curve(points,N=3, splinesteps=32);
|
||||||
|
curve_points2 = [ for(p = curve_points) [p.x, p.y, 0]]; // Offset by 1 in Z
|
||||||
|
//echo ("curve_points",curve_points);
|
||||||
|
curve_points_offset = [ for(p = curve_points) [p.x, p.y, (p.z != undef ? p.z : 0) + 1 ]]; // Offset by 1 in Z
|
||||||
|
|
||||||
|
// Combine original and offset points to form a 2D array for a simple patch
|
||||||
|
patch_points = [
|
||||||
|
curve_points,
|
||||||
|
curve_points_offset
|
||||||
|
];
|
||||||
|
//echo ("patch_points",patch_points);
|
||||||
|
//echo ("curve_points_offset",curve_points_offset);
|
||||||
|
echo ("curve_points2",curve_points2);
|
||||||
|
echo ("length curve_points2",len(curve_points2));
|
||||||
|
|
||||||
|
//vnf_5 = bezier_vnf(patch_points, caps=false, splinesteps=10);
|
||||||
|
//vnf_5 = bezier_vnf(curve_points2, splinesteps=10);
|
||||||
|
echo ("is_bezier_patch",is_bezier_patch(curve_points));
|
||||||
|
echo ("is_bezier_patch",is_bezier_patch(curve_points2));
|
||||||
|
|
||||||
|
//vnf_5 = bezier_vnf(curve_points_offset, splinesteps=10);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a profile based on Bezier path points with optional debug visualization.
|
* Draws a profile based on Bezier path points with optional debug visualization.
|
||||||
*
|
*
|
||||||
@ -570,7 +721,3 @@ module drawProfile( points,debug = true ){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
44
common.scad
44
common.scad
@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
include <BOSL2/std.scad>;
|
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
|
|
||||||
@ -167,53 +166,18 @@ function layerHeights(n, fin_thickness) =
|
|||||||
* @param side - Bottom or top part of the mold
|
* @param side - Bottom or top part of the mold
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
module skirt( profile, moldThickness = 4 , angle = 45 , moldDeep, side = "bottom", heightFactor = 3, clearance = 0.2 ) {
|
module skirt( profile, moldThickness, angle, moldDeep, side = "bottom", heightFactor = 3 ) {
|
||||||
height = heightFactor * moldDeep;
|
|
||||||
echo ("height",height);
|
|
||||||
deviation = opp_ang_to_adj (height,angle);
|
deviation = opp_ang_to_adj (height,angle);
|
||||||
// deviation = 3;
|
skirtHeight = heightFactor * moldDeep;
|
||||||
|
|
||||||
if ( side == "bottom" ) {
|
if ( side == "bottom" ) {
|
||||||
lowInt = profile;
|
lowInt = profile;
|
||||||
lowExt = expandPath( lowInt , moldThickness );
|
lowExt = expandPath( lowInt , moldThickness );
|
||||||
highInt = expandPath( lowInt , deviation );
|
highInt = expandPath( lowInt , deviation );
|
||||||
highExt = expandPath( lowInt , deviation + moldThickness );
|
highExt = expandPath( lowInt , deviation + moldThickness );
|
||||||
difference(){
|
difference(){
|
||||||
skin([lowExt , highExt ], z=[0 , height ] , slices=0);
|
skin([lowExt , highExt ], z=[0 , skirtHeight] , slices=0);
|
||||||
skin([lowInt , highInt ], z=[-OFFSET , height+OFFSET ] , slices=0);
|
skin([lowInt , highInt ], z=[-OFFSET , skirtHeight+OFFSET] , slices=0);
|
||||||
}
|
}
|
||||||
} else if ( side == "top" ) {
|
|
||||||
lowInt = expandPath( profile , -moldThickness );
|
|
||||||
lowExt = expandPath( profile , -clearance );
|
|
||||||
highInt = expandPath( profile , +deviation-moldThickness );
|
|
||||||
highExt = expandPath( profile , +deviation -clearance );
|
|
||||||
difference(){
|
|
||||||
skin([lowExt , highExt ], z=[0 , height ] , slices=0);
|
|
||||||
skin([lowInt , highInt ], z=[-OFFSET , height+OFFSET ] , slices=0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( false ) {
|
|
||||||
skirt(
|
|
||||||
rect([30,30]),
|
|
||||||
moldDeep=5,
|
|
||||||
moldThickness = 3,
|
|
||||||
side="bottom"
|
|
||||||
);
|
|
||||||
up(1)
|
|
||||||
skirt(
|
|
||||||
rect([30,30]),
|
|
||||||
moldDeep=5,
|
|
||||||
moldThickness = 3,
|
|
||||||
side="top",
|
|
||||||
clearance=1
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,11 +18,6 @@ OFFSET=0.01;
|
|||||||
module boxProfileUS( length ,height=23, tabHeight = 8,tabLength = 20, backRounding = 8, backExtra = 10 ) {
|
module boxProfileUS( length ,height=23, tabHeight = 8,tabLength = 20, backRounding = 8, backExtra = 10 ) {
|
||||||
|
|
||||||
|
|
||||||
echo ("------ height",height);
|
|
||||||
echo ("------ tabHeight",tabHeight);
|
|
||||||
echo ("------ height-tabHeight",height-tabHeight);
|
|
||||||
assert (height-tabHeight,"height-tabHeight should be bigger than 0");
|
|
||||||
|
|
||||||
tabExtra = opp_ang_to_adj(height-tabHeight,45);
|
tabExtra = opp_ang_to_adj(height-tabHeight,45);
|
||||||
points = [
|
points = [
|
||||||
[ -tabLength , 0 ,1], // 0
|
[ -tabLength , 0 ,1], // 0
|
||||||
@ -63,15 +58,12 @@ module usBox( length, height=23, thickness = 9, tabLength = 20,pinDiameter = 5,p
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength = 20,part = "bottom",skirtAngle=80 , skirt = true ) {
|
module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength = 20,part = "bottom",skirtAngle=80 ) {
|
||||||
|
|
||||||
//assert(length == 130,"Not 130");
|
//assert(length == 130,"Not 130");
|
||||||
assert (length >0,"length should be bigger than 0");
|
|
||||||
|
|
||||||
moldHeight = thickness + 2 * moldThickness;
|
moldHeight = thickness + 2 * moldThickness;
|
||||||
skirtHeight = 3 * thickness;
|
skirtHeight = 3 * thickness;
|
||||||
echo ("---skirtHeight",skirtHeight);
|
|
||||||
echo ("---part",part);
|
|
||||||
deviation = opp_ang_to_adj (skirtHeight,skirtAngle); // Skirt devitation
|
deviation = opp_ang_to_adj (skirtHeight,skirtAngle); // Skirt devitation
|
||||||
|
|
||||||
baseInt = profileUS (length);
|
baseInt = profileUS (length);
|
||||||
@ -83,20 +75,11 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
|
|||||||
difference() {
|
difference() {
|
||||||
// Mold
|
// Mold
|
||||||
{
|
{
|
||||||
//if ( part == "bottom")
|
if ( part == "bottom")
|
||||||
|
|
||||||
down (moldHeight/2) linear_extrude(moldHeight)
|
down (moldHeight/2) linear_extrude(moldHeight)
|
||||||
offset(r=moldThickness)
|
offset(r=moldThickness)
|
||||||
boxProfileUS( length, height );
|
boxProfileUS( length, height );
|
||||||
|
if ( part == "top") {
|
||||||
/*
|
|
||||||
if ( part == "top")
|
|
||||||
|
|
||||||
down (moldHeight/2) linear_extrude(moldHeight)
|
|
||||||
offset(r=moldThickness)
|
|
||||||
boxProfileUS( length, height );
|
|
||||||
*/
|
|
||||||
if ( part == "top__" ) {
|
|
||||||
//baseInt = profileUS (length);
|
//baseInt = profileUS (length);
|
||||||
//baseInt = profileUS (length);
|
//baseInt = profileUS (length);
|
||||||
//topInt = offset(baseInt,delta=-deviation,chamfer=false,same_length=true);
|
//topInt = offset(baseInt,delta=-deviation,chamfer=false,same_length=true);
|
||||||
@ -115,8 +98,6 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// US Box to subtract
|
// US Box to subtract
|
||||||
usBox(length,height,drill=false,color="Red");
|
usBox(length,height,drill=false,color="Red");
|
||||||
|
|
||||||
@ -129,12 +110,14 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
|
|||||||
linear_extrude( moldHeight )
|
linear_extrude( moldHeight )
|
||||||
offset( r = moldThickness*2 )
|
offset( r = moldThickness*2 )
|
||||||
boxProfileUS( length, height );
|
boxProfileUS( length, height );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( part == "bottom" ) {
|
if ( part == "bottom") {
|
||||||
|
// offset is a function
|
||||||
|
|
||||||
//topInt = offset(baseInt,delta=deviation,chamfer=false,same_length=true);
|
//topInt = offset(baseInt,delta=deviation,chamfer=false,same_length=true);
|
||||||
if (skirt) difference(){
|
showSkirt = true;
|
||||||
|
if (showSkirt) difference(){
|
||||||
skin([baseExt,topExt],z=[0,skirtHeight],slices=0);
|
skin([baseExt,topExt],z=[0,skirtHeight],slices=0);
|
||||||
skin([baseInt,topInt],z=[0,skirtHeight+OFFSET],slices=0);
|
skin([baseInt,topInt],z=[0,skirtHeight+OFFSET],slices=0);
|
||||||
}
|
}
|
||||||
@ -146,16 +129,11 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//usBoxMold (130,part="bottom",skirt=false);
|
module finBoxMold( length, finLength=-1, skirtAngle = 80, part="bottom") {
|
||||||
|
|
||||||
//back (30) usBoxMold (130,part="top",skirt=false);
|
|
||||||
|
|
||||||
|
|
||||||
module finBoxMold( length, finLength=-1, skirtAngle = 80, part="bottom", skirt = true) {
|
|
||||||
|
|
||||||
assert (finLength,"Missing 'finLength' parameter in finBoxMold module");
|
assert (finLength,"Missing 'finLength' parameter in finBoxMold module");
|
||||||
//if (part=="bottom") {
|
//if (part=="bottom") {
|
||||||
usBoxMold( length,part=part,skirtAngle=skirtAngle,skirt=skirt );
|
usBoxMold( length,part=part,skirtAngle=skirtAngle );
|
||||||
//}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -188,6 +166,6 @@ module thickness_cut(thickness,height) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (false )down(50) usBoxMold( 130,part="bottom",skirt=false );
|
//down(50) usBoxMold( 130,part="bottom" );
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user