Commit 9c73ff73 authored by Frederic GOUALARD's avatar Frederic GOUALARD 💬

Réorganisation des fichiers pour différencier la modélisation suivant les années de réalisation.

parent ffe5da06
This diff is collapsed.
nutsnbolts
==========
A OpenSCAD library that allows for simple creation of nuts and bolts and respective nut catches and screw holes.
![Screenshot of examples.scad output](http://i.imgur.com/f0snG.png)
The Library is based iso metric standard screws with hexagon socket head cap and respective nuts (see DIN 912 or DIN EN ISO 4762 for reference). The library allows for easy access to parts and holes of true measures like so: `screw("M5x10")`. For holes and catches all measures can be adjusted by setting additional clearances.
The origin for all parts created in this lib lies on the axis of the hole or screw. For screws on the underside of the head, for holes at top and for catches at the bottom.
And yes this lib can model *threads* on the screws. Beware that this is slow and may create improper stl files. The default is not to create a thread and instead have the outer diameter for bolts or the inner diameter for threaded holes and nuts.
Usage Example
=============
The main file is *cyl_head_bolt.scad*, have a look in there for available modules and parameters (commented).
For more usage examples have a look into *examples.scad*.
### Holes and Nutcatches
The package includes threaded and through holes to screw the bolts in or push them through.
Also nutcatches cut sideways into a body and a catch just parallel to the through-hole axis are available.
difference() {
translate([-15, -15, 0]) cube([80, 30, 50]);
rotate([180,0,0]) nutcatch_parallel("M5", l=5);
translate([0, 0, 50]) hole_through(name="M5", l=50+5, cl=0.1, h=10, hcl=0.4);
translate([55, 0, 9]) nutcatch_sidecut("M8", l=100, clk=0.1, clh=0.1, clsl=0.1);
}
![Screenshot of the resulting model](http://i.imgur.com/8pFyggB.png)
### Screws and Nuts
include <cyl_head_bolt.scad>;
screw("M20x100", thread="modeled"); // screw M20x100 with thread
nut("M20", thread="modeled"); // corresponding nut with thread
screw("M3x12"); // screw M3x12
![Screenshot 1 of screw("M20x100", thread="modeled");](http://i.imgur.com/tIFTW.png)
![Screenshot 2 of screw("M20x100", thread="modeled");](http://i.imgur.com/AfHBo.png)
### Materials and Colors
include <materials.scad>; // this allows you to write stuff like this:
stainless(no="1.4301") nut("M3");
// which colors the parts in the corresponding color and documents the
// intended material. The material number isn't used for anything and can be
// skipped. Sensible defaults are set for stainless/steel/iron.
// Norm Nuts and Bolts - a OpenSCAD library
// Copyright (C) 2012 Johannes Kneer
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// This OpenSCAD File shows all screws and nuts,
// only run this on recent decent hardware or you will wait...
include <cyl_head_bolt.scad>;
include <materials.scad>;
$fn=15;
scri = [ [0:8], [9:17], [18:26], [27:35], [36:45], [46:56],
[57:69], [70:83], [84:98], [99:114], [115:133], [134:153],
[154:171], [172:188], [189:203], [204:222], [223:239], [240:255],
[256:270]];
for (j= [0:25]) {
assign(diao = _get_screw_fam(data_screw[scri[j][0]][_NB_S_DESC])[_NB_F_OUTER_DIA],
dia = 0)
translate([0,j*2*diao,0])
for (i = scri[j]) {
echo(data_screw[i][2]);
assign(name = data_screw[i][_NB_S_DESC],
fam = data_screw[i][_NB_S_FAMKEY],
len = data_screw[i][_NB_S_LENGTH],
dia = _get_screw_fam(data_screw[i][_NB_S_DESC])[_NB_F_OUTER_DIA]) {
echo(name, fam, len, dia, i*2*dia-2*dia*scri[j][0]);
translate([i*2*dia-2*dia*scri[j][0], 0, 0]) {
stainless() screw(name);//, thread="modeled");
translate([0,0,-5/4*len]) stainless() nut(fam);//, thread="modeled");
}
}
}
}
// Norm Nuts and Bolts - a OpenSCAD library
// Copyright (C) 2012 Johannes Kneer
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// DATABASE ACCESS FUNCTIONS AND CONSTANTS
// == CONSTANTS ==
// screw table access keys
_NB_S_DESC = 0;
_NB_S_FAMKEY = 1;
_NB_S_LENGTH = 2;
_NB_S_NOTHREAD_LENGTH = 3;
_NB_F_DESC = 0;
_NB_F_OUTER_DIA = 1;
_NB_F_INNER_DIA = 2;
_NB_F_LEAD = 3;
_NB_F_KEY = 4;
_NB_F_KEY_DEPTH = 5;
_NB_F_HEAD_HEIGHT = 6;
_NB_F_HEAD_DIA = 7;
_NB_F_NUT_KEY = 8;
_NB_F_NUT_HEIGHT = 9;
// == FUNCTIONS ==
// _get_screw("descriptor") with descriptor = M8x25
// find the line for a general object in the data matrix
function _get_screw(n) = data_screw[search([n], data_screw)[0]];
function _get_screw_fam(n) = data_screw_fam[search([_get_screw(n)[_NB_S_FAMKEY]], data_screw_fam)[0]];
function _get_fam(n) = data_screw_fam[search([n], data_screw_fam)[0]];
// _get_XXXXX("descriptor") functions
// find a single property in the database
function _get_desc(n) = _get_screw(n)[_NB_S_DESC];
function _get_famkey(n) = _get_screw(n)[_NB_S_FAMKEY];
function _get_length(n) = _get_screw(n)[_NB_S_LENGTH];
function _get_nt_length(n) = _get_screw(n)[_NB_S_NOTHREAD_LENGTH];
function _get_outer_dia(n) = _get_screw_fam(n)[_NB_F_OUTER_DIA];
function _get_inner_dia(n) = _get_screw_fam(n)[_NB_F_INNER_DIA];
function _get_lead(n) = _get_screw_fam(n)[_NB_F_LEAD];
function _get_head_height(n) = _get_screw_fam(n)[_NB_F_HEAD_HEIGHT];
function _get_head_dia(n) = _get_screw_fam(n)[_NB_F_HEAD_DIA];
function _get_nut_key(n) = _get_screw_fam(n)[_NB_F_NUT_KEY];
function _get_nut_height(n) = _get_screw_fam(n)[_NB_F_NUT_HEIGHT];
// Norm Nuts and Bolts - a OpenSCAD library
// Copyright (C) 2012 Johannes Kneer
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// USAGE EXAMPLES
include <cyl_head_bolt.scad>;
include <materials.scad>;
// == example nut catches and holes ==
difference() {
translate([-15, -15, 0]) cube([80, 30, 50]);
rotate([180,0,0]) nutcatch_parallel("M5", l=5);
translate([0, 0, 50]) hole_through(name="M5", l=50+5, cl=0.1, h=10, hcl=0.4);
translate([55, 0, 9]) nutcatch_sidecut("M8", l=100, clk=0.1, clh=0.1, clsl=0.1);
translate([55, 0, 50]) hole_through(name="M8", l=50+5, cl=0.1, h=10, hcl=0.4);
translate([27.5, 0, 50]) hole_threaded(name="M5", l=60);
}
// == example nuts and screws ==
$fn=60;
translate([0,50, 0]) stainless() screw("M20x100", thread="modeled");
translate([0,50,-120]) stainless() nut("M20", thread="modeled");
translate([30,50,0]) screw("M12x60");
translate([30,50,-80]) nut("M12");
translate([50,50,0]) screw("M5x20");
translate([50,50,-30]) nut("M5");
//key("M5");
// == example db lookups ==
//echo(_get_fam("M8"));
//echo(_get_screw("M5x8"));
//echo(_get_screw_fam("M5x8"));
// Norm Nuts and Bolts - a OpenSCAD library
// Copyright (C) 2012 Johannes Kneer
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// USAGE EXAMPLES
include <cyl_head_bolt.scad>;
include <materials.scad>;
// == example nut catches and holes ==
difference() {
translate([-15, -15, 0]) cube([80, 30, 50]);
rotate([180,0,0]) nutcatch_parallel("M5", l=5);
translate([0, 0, 50]) hole_through(name="M5", l=50+5, cl=0.1, h=10, hcl=0.4);
translate([55, 0, 9]) nutcatch_sidecut("M8", l=100, clk=0.1, clh=0.1, clsl=0.1);
translate([55, 0, 50]) hole_through(name="M8", l=50+5, cl=0.1, h=10, hcl=0.4);
translate([27.5, 0, 50]) hole_threaded(name="M5", l=60);
}
// == example nuts and screws ==
$fn=60;
translate([0,50, 0]) stainless() screw("M20x100", thread="modeled");
translate([0,50,-120]) stainless() nut("M20", thread="modeled");
translate([30,50,0]) screw("M12x60");
translate([30,50,-80]) nut("M12");
translate([50,50,0]) screw("M5x20");
translate([50,50,-30]) nut("M5");
//key("M5");
// == example db lookups ==
//echo(_get_fam("M8"));
//echo(_get_screw("M5x8"));
//echo(_get_screw_fam("M5x8"));
// Norm Nuts and Bolts - a OpenSCAD library
// Copyright (C) 2012 Johannes Kneer
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// MATERIALS
// all materials take a no-parameter that should be used to document
// the exact material in code, the number is not yet used in the code
module stainless(no="1.4301") {
color([0.45, 0.43, 0.5]) children([0:$children-1]);
}
module steel(no) {
color([0.65, 0.67, 0.72]) children([0:$children-1]);
}
module iron(no="ST37") {
color([0.36, 0.33, 0.33]) children([0:$children-1]);
}
// additional colors
CL_ZINC = [0.4, 0.4, 0.4];
/*
Modélisation d'un pilulier de 50x21 mm
  • /!\ Le bouchon s'enfonce de 10 mm dans le pilulier ce qui implique qu'au final on ne peut l'enfoncer que de 40 mm dans le photoréacteur au lieu de 50 mm (hauteur du pilulier)

Please register or sign in to reply
*/
module pilulier() {
color("Ivory") cylinder(d=21,h=50);
}
pilulier();
  • Bonne remarque. Le bouchon est bien celui utilisé au quotidien par Yann ? Si oui, il faut rajouter un bouchon adapté sur la modélisation. Bon exercice pour débuter avec OpenSCAD ! :o)

  • Oui je pense qu'ils mettent le bouchon lors de chaque manipulation car pour le modèle de l'année dernière, les piluliers ne tenaient dans le photoreacteur que si les bouchons étaient mis. Comme Yann ne nous a pas parlé de ce sujet lors de notre discussion sur les problèmes rencontrés je ne pense pas que ce soit un problème.

    Oui j'ai presque fini la modélisation du puits avec opensad (qui est très facile à prendre en main) j'ai fait un modélisation du pilulier avec et sans bouchons en prenant les nouvelles dimentions !

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment