3d-stuff/openscad/own/supermicro_sc808t/hdd-holder/SCAD/modules/disk_lff.scad

74 lines
2.5 KiB
OpenSCAD
Raw Normal View History

2022-09-20 19:05:22 +02:00
/**
* Models and variables according to SFF-8300 specification.
*
* @author Joaquín Fernández
* @url https://gitlab.com/joaquinfq/openscad/blob/master/Modules/Models/SFF/8300.scad
* @license CC-BY-NC-4.0
*
* @see SFF-8300 3.5" Form Factor Drives
*/
//----------------------------------------------------------
use <./box.scad>
//----------------------------------------------------------
/**
* Returns the specifications of the measurements according to SFF-8300.
*
* @param {Float} tolerance Tolerance to be used to adjust the measurements.
* @param {Integer} type Type of unit (0: small, 1: medium, 2: large).
*
* @return {Float[]}
*/
function sff8300(tolerance = 0, type = 1) = [
3.00, // Screw diameter
type == 0 ? 42.00 : (type == 1 ? 26.10 : 17.80) + tolerance,
147.00 + tolerance,
101.60 + tolerance,
95.25 + tolerance,
3.18,
44.45 + tolerance / 2,
41.28 + tolerance / 2,
28.50 + tolerance / 2,
101.60 + tolerance / 2,
6.35 + tolerance / 2,
0.25,
0.50,
76.20 + tolerance / 2
];
//----------------------------------------------------------
/**
* Draw a model of a 3.5" drive according to the SFF-8300 specification.
*
* This model allows the volume to be removed later to create a slot
* like those used in PC cases.
*
* @param {Float} length Length of the drive to be generated.
* @param {Float} thickness Thickness of the block where the model will be inserted.
* @param {Float} screw Diameter of the screw to be used.
* @param {Float} slot Length of the slot where the screws will be inserted.
* @param {Float} tolerance Value to be used to adjust the standard dimensions.
* @param {Integer} type Type of unit (0: small, 1: medium, 2: large).
*/
module sff8300Model(length = 0, thickness = 5, screw = 0, slot = 15, tolerance = 0.3, type = 0)
{
_A = sff8300(tolerance, type);
modelBox(
_A[3],
_A[1],
length ? length : _A[2],
thickness,
screw ? screw : _A[0],
slot,
[
[ _A[10], _A[2] - _A[8] ],
[ _A[10], _A[2] - _A[8] - _A[9] ]
],
[
[ _A[5], _A[2] - _A[7] ],
[ _A[5], _A[2] - _A[7] - _A[6] ],
[ _A[5], _A[2] - _A[7] - _A[13] ],
[ _A[3] - _A[5], _A[2] - _A[7] ],
[ _A[3] - _A[5], _A[2] - _A[7] - _A[6] ],
[ _A[3] - _A[5], _A[2] - _A[7] - _A[13] ]
]
);
}