Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Prochaine révision Les deux révisions suivantes | ||
logiciels:openscad:accueil [2015/09/16 17:44] resonance |
logiciels:openscad:accueil [2018/01/18 13:03] resonance ancienne révision (2016/04/05 19:59) restaurée |
||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
* General inquiries can be sent to info@openscad.org | * General inquiries can be sent to info@openscad.org | ||
* Licence : GPL v2 | * Licence : GPL v2 | ||
- | | + | * Fichiers : {{: |
- | | + | |
* Lien : http:// | * Lien : http:// | ||
Ligne 10: | Ligne 9: | ||
{{: | {{: | ||
- | "OpenSCAD est un logiciel de modélisation tridimensionnelle rudimentaire. C'est un logiciel libre qui fonctionne à la fois sous Linux, Mac OS et Microsoft Windows. Le projet a débuté en Février 2010. OpenSCAD a pour particularité de fonctionner de façon entièrement paramétrique, | + | < |
===== Ressources===== | ===== Ressources===== | ||
- | [[https:// | + | * [[https:// |
- | [[http:// | + | |
- | [[http:// | + | |
- | [[http:// | + | |
- | [[http:// | + | |
- | [[http:// | + | |
- | ===== Tutoriel ===== | + | * [[http:// |
- | Photos ou guide pas à pas | + | * [[https:// |
- | ===== Photos ===== | + | * [[http:// |
- | Autres photos, galerie, | + | |
- | Les mots clés (tags) représentant votre travail | + | ===== Installation===== |
- | {{tag>[tag1 tag2 tag3]}} | + | * [[http:// |
+ | * Bibliothèques à télécharger : | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | * Plugins Inkscape | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | ===== Exemples===== | ||
+ | ==== Primitives 3D et transformations==== | ||
+ | {{: | ||
+ | ++++ exemple_1.scad | | ||
+ | |||
+ | <code c> | ||
+ | // Unité = millimètre | ||
+ | // Vecteur = point en 3D = [x,y,z] | ||
+ | |||
+ | // CUBE | ||
+ | // Arguments : dimensions (un nombre ou un vecteur), center (booléen) | ||
+ | cube(5, true); | ||
+ | translate([5, | ||
+ | rotate([45, | ||
+ | cube([5, | ||
+ | |||
+ | // SPHERE | ||
+ | // Arguments : rayon, résolution ($fn), fragment angle ($fa), fragment size ($fs) | ||
+ | translate([0, | ||
+ | translate([0, | ||
+ | translate([0, | ||
+ | |||
+ | // CYLINDRE | ||
+ | // Arguments : hauteur, rayon, rayon1, rayon2, center, $fa, $fs, $fn | ||
+ | translate([0, | ||
+ | |||
+ | // POLYHEDRE | ||
+ | translate([0, | ||
+ | polyhedron( | ||
+ | points=[ [10, | ||
+ | | ||
+ | triangles=[ [0, | ||
+ | [1, | ||
+ | ); | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ==== Modélisation simple avec opérations booléennes==== | ||
+ | {{: | ||
+ | ++++ exemple_2.scad | | ||
+ | |||
+ | <code c> | ||
+ | // DIFFERENCE | ||
+ | difference(){ | ||
+ | cube(10, true); | ||
+ | |||
+ | cylinder(h=15, | ||
+ | rotate([90, | ||
+ | rotate([0, | ||
+ | } | ||
+ | |||
+ | // INTERSECTION | ||
+ | translate([20, | ||
+ | intersection() { | ||
+ | sphere(6); | ||
+ | cube(10, | ||
+ | } | ||
+ | |||
+ | //UNION | ||
+ | translate([40, | ||
+ | union() { | ||
+ | sphere(6); | ||
+ | cube(10, | ||
+ | } | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ==== Extrusion d'une forme 2D en 3D==== | ||
+ | {{: | ||
+ | ** difficulté pour extruder un .dxf ? > voir [[http:// | ||
+ | ++++ exemple_3.scad | | ||
+ | |||
+ | <code c> | ||
+ | // Rotation = révolution | ||
+ | rotate_extrude($fn=20) polygon( points=[ [0, | ||
+ | |||
+ | // Linéaire | ||
+ | linear_extrude(height = 2) | ||
+ | translate([3, | ||
+ | square(5); | ||
+ | |||
+ | // Extrusion d'un fichier DXF | ||
+ | linear_extrude(height = 2) | ||
+ | scale (0.5) | ||
+ | translate([20, | ||
+ | import (file = " | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | ==== Avantages du paramétrique ==== | ||
+ | Possible aussi en python avec Freecad et Blender. | ||
+ | {{: | ||
+ | difficulté pour extruder un .dxf ? > voir [[http:// | ||
+ | ++++ exemple_4.scad | | ||
+ | |||
+ | <code c> | ||
+ | /* | ||
+ | * EXEMPLE 4 : avantages d'un logiciel paramétrique | ||
+ | * Accès aux principes de bases de la programmation : | ||
+ | * Structures et fonctions | ||
+ | */ | ||
+ | |||
+ | // --------- Programme principal ---------------- // | ||
+ | // Appel des modules, etc. | ||
+ | |||
+ | difference(){ | ||
+ | support(); | ||
+ | trous(); | ||
+ | } | ||
+ | |||
+ | // --------- Variables (ou plutôt constantes) -- // | ||
+ | longueur = 50; | ||
+ | hauteur = 5; | ||
+ | profondeur = 15; | ||
+ | trou_rayon = 2; | ||
+ | trou_nb = 6; | ||
+ | $fn=20; | ||
+ | |||
+ | // --------- Modules --------------------------- // | ||
+ | module support() { | ||
+ | union(){ | ||
+ | cube([longueur, | ||
+ | color ([0,1,0]) | ||
+ | translate ([0, | ||
+ | cylinder(h=hauteur, | ||
+ | } | ||
+ | } | ||
+ | |||
+ | module trous() { | ||
+ | for (i=[0: | ||
+ | translate([i*5, | ||
+ | cylinder(h=hauteur+2, | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | ==== Utilisation des bibliothèques ==== | ||
+ | [[https:// | ||
+ | Il suffit de décompresser le dossier et de le mettre dans le dossier de travail, puis d' | ||
+ | {{: | ||
+ | |||
+ | ++++ exemple_5.scad | | ||
+ | |||
+ | <code c> | ||
+ | /* | ||
+ | * Utilisation des bibliothèques | ||
+ | * - MCAD pour les engrenages et bien d' | ||
+ | * - nutsnbolts pour les écrous et boulons : https:// | ||
+ | * - Write.scad pour le texte : http:// | ||
+ | * -- Attention, il faut placer les fichiers Letters.dxf et Write.scad dans le répertoire de travail | ||
+ | */ | ||
+ | |||
+ | // Importer les bibliothèques | ||
+ | include < | ||
+ | include < | ||
+ | include < | ||
+ | include < | ||
+ | |||
+ | // Moteur pas à pas Nema 17 | ||
+ | stepper_motor_mount(17); | ||
+ | |||
+ | // Engrenages | ||
+ | translate([0,0,15]) gear(number_of_teeth=51, | ||
+ | translate([0, | ||
+ | gear(number_of_teeth=17, | ||
+ | |||
+ | // Écrous et boulons | ||
+ | $fn=60; | ||
+ | translate([35, | ||
+ | translate([35, | ||
+ | |||
+ | // Lettres | ||
+ | translate([0, | ||
+ | rotate(90, | ||
+ | write(" | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | ==== Autres exemples ==== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ++++ exemple_6.scad | | ||
+ | |||
+ | <code c> | ||
+ | for(i=[0: | ||
+ | translate([i*10, | ||
+ | | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | {{: | ||
+ | [[http:// | ||
+ | ++++ exemple_7.scad | | ||
+ | |||
+ | <code c> | ||
+ | seashell(5, | ||
+ | |||
+ | module seashell(turns, | ||
+ | for ( i = [0 : 0.2 : turns] ) | ||
+ | { | ||
+ | rotate( i * 360/6, [100 * i, i, 0]) | ||
+ | difference () { | ||
+ | cylinder(h=i, | ||
+ | cylinder(h=i/ | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | ==== Extrusion complexe ==== | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ++++ exemple_8.scad | | ||
+ | |||
+ | <code c> | ||
+ | // Example009.scad from OpenSCAD examples | ||
+ | |||
+ | bodywidth = dxf_dim(file = " | ||
+ | fanwidth = dxf_dim(file = " | ||
+ | platewidth = dxf_dim(file = " | ||
+ | fan_side_center = dxf_cross(file = " | ||
+ | fanrot = dxf_dim(file = " | ||
+ | |||
+ | % linear_extrude(height = bodywidth, center = true, convexity = 10) | ||
+ | import(file = " | ||
+ | |||
+ | % for (z = [+(bodywidth/ | ||
+ | -(bodywidth/ | ||
+ | { | ||
+ | translate([0, | ||
+ | linear_extrude(height = platewidth, center = true, convexity = 10) | ||
+ | import(file = " | ||
+ | } | ||
+ | |||
+ | intersection() | ||
+ | { | ||
+ | linear_extrude(height = fanwidth, center = true, convexity = 10, twist = -fanrot) | ||
+ | import(file = " | ||
+ | |||
+ | // NB! We have to use the deprecated module here since the " | ||
+ | // layer contains an open polyline, which is not yet supported | ||
+ | // by the import() module. | ||
+ | rotate_extrude(file = " | ||
+ | origin = fan_side_center, | ||
+ | } | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | * [[https:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | |||
+ | {{: | ||
+ | {{: |