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

130 lines
3.4 KiB
OpenSCAD
Raw Permalink Normal View History

2022-09-20 19:05:22 +02:00
/**
* Modelos y variables según la especificación SFF-8200.
*
* @author Joaquín Fernández
* @url https://gitlab.com/joaquinfq/openscad/blob/master/Modules/Models/SFF/8200.scad
* @license CC-BY-NC-4.0
*
* @see SFF-8200 2.5" Form Factor Drives
*/
//----------------------------------------------------------
use <./box.scad>
//----------------------------------------------------------
/**
* Devuelve las especificaciones de las medidas según SFF-8200.
*
* @param {Float} tolerance Tolerancia a usar para ajustar las medidas.
* @param {Integer} type Tipo de unidad (0: pequeña, 1: mediana, 2: grande).
*
* @return {Float[]}
*/
function sff8200(tolerance = 0, type = 0) = [
3.00, // Diámetro del tornillo
(
type == 0
? 19.05
: type == 1
? 17.00
: type == 2
? 15.00
: type == 3
? 12.70
: type == 4
? 10.50
: type == 5
? 9.50
: type == 6
? 8.47
: type == 7
? 7.00
: 5.00
) + tolerance,
0.00,
0.50,
69.85 + tolerance,
0.25,
100.45 + tolerance,
undef,
undef,
undef,
100.20 + tolerance, // #10
100.50 + tolerance,
110.20 + tolerance,
undef,
undef,
undef,
undef,
undef,
undef,
undef,
undef, // #20
undef,
undef,
3.00 + tolerance / 2,
34.93,
38.10,
undef,
0.50,
4.07 + tolerance / 2,
61.72,
34.93, // #30
38.10,
undef,
0.50,
undef,
undef,
undef,
8.00,
3.00,
undef,
undef, // #40
2.50,
undef,
undef,
undef,
undef,
undef,
undef,
undef,
undef,
14.00 + tolerance / 2, // #50
90.60 + tolerance / 2,
14.00 + tolerance / 2,
90.60 + tolerance / 2
];
//----------------------------------------------------------
/**
* Draw a model of a 3.5" drive according to the SFF-8200 specification.
*
* This model allows the volume to be removed later to create a slot as used in PC cases.
* 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 sff8200Model(length = 0, thickness = 5, screw = 0, slot = 15, tolerance = 0.3, type = 0)
{
_A = sff8200(tolerance, type);
modelBox(
_A[4],
_A[1],
length ? length : _A[6],
thickness,
screw ? screw : _A[0],
slot,
[
[ _A[23], _A[6] - _A[52] ],
[ _A[23], _A[6] - _A[53] ]
],
[
[ _A[28], _A[6] - _A[50] ],
[ _A[28], _A[6] - _A[51] ],
[ _A[4] - _A[28], _A[6] - _A[50] ],
[ _A[4] - _A[28], _A[6] - _A[51] ]
]
);
}