Openscad User Guide

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

OpenSCAD User GUIDE

STL INSERTAR

import_stl("XXXX.stl");
VARIABLES

deck = [64, 89, 18]; cube(deck);


MOVER

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

scale(v = [x, y, z]) OBJETO scale([0.5,1,2] OBJETO


OBJETOS

cube([X,Y,Z]); cube(size = 1, center = false); cube(size = [1,2,3], center = true);


Parameters size Decimal or 3 value array. If a single number is given, the result will be a cube with sides of that length. If a 3 value array is given, then the values will correspond to the lengths of the X, Y, and Z sides. Default value is 1. center Boolean. This determines the positioning of the object. If true, object is centered at (0,0,0). Otherwise, the cube is placed in the positive quadrant with one corner at (0,0,0). Defaults to false

sphere(R); sphere(r = 1); sphere(r = 5); sphere(r = 10);


Creates a sphere at the origin of the coordinate system. The argument name is optional. Parameters r

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); }

You might also like