Openscad User Guide
Openscad User Guide
Openscad User Guide
STL INSERTAR
import_stl("XXXX.stl");
VARIABLES
translate([0, 0, 30])OBJETO
ROTAR
rotate(a = deg, v = [x, y, z]) OBJETO rotate(a=[0,180,0]) OBJETO rotate(a=45, v=[1,1,0]) OBJETO
ESCALA
Decimal. This is the radius of the sphere. The resolution of the sphere will be based on the size of the sphere and the $fa, $fs and $fn variables. For more information on these special variables look at: OpenSCAD_User_Manual/Other_Language_Features $fa Angle in degrees $fs Angle in mm $fn Resolution
cylinder(h=40, r=10); cylinder(h = 10, r1 = 10, r2 = 20, center = false); cylinder(h = 10, r1 = 20, r2 = 10, center = true); cylinder(h = 10, r=20); cylinder(h = 10, r=20, $fs=6);
Creates a cylinder or cone at the origin of the coordinate system. A single radius (r) makes a cylinder, two different radi (r1, r2) make a cone. Parameters h Decimal. This is the height of the cylinder. Default value is 1. r1 Decimal. This is the radius of the cone on bottom end. Default value is 1. r2 Decimal. This is the radius of the cone on top end. Default value is 1. r Decimal. The radius of both top and bottom ends of the cylinder. Use this parameter if you want plain cylinder. Default value is 1. center boolean. If true will center the height of the cone/cylinder around the origin. Default is false, placing the base of the cylinder or r1 radius of cone at the origin. $fa Angle in degrees $fs Angle in mm $fn Resolution
OPERACIN
difference() { cube(30, center=true); sphere(20); } union() { cylinder (h = 4, r=1, center = true, $fn=100); rotate ([90,0,0]) cylinder (h = 4, r=0.9, center = true, $fn=100); }
intersection() { cylinder (h = 4, r=1, center = true, $fn=100); rotate ([90,0,0]) cylinder (h = 4, r=0.9, center = true, $fn=100);
COLOR
color("red") cube(); color([1,0,0]) cube([2,3,4]); translate([3,0,0]) color([0,1,0]) cube([2,3,4]); translate([6,0,0]) color([0,0,1]) cube([2,3,4]);
For Loop
for (z = [-1, 1]) // two iterations, z = -1, z = 1 { translate([0, 0, z]) cube(size = 1, center = false); } for ( i = [0 : 5] ) { rotate( i * 360 / 6, [1, 0, 0]) translate([0, 10, 0]) sphere(r = 1); } for(i = [ [ 0, 0, 0], [ 10, 20, 300], [200, 40, 57], [ 20, 88, 57] ]) { rotate(i) cube([100, 20, 20], center = true); }