Previous Events

From Nadhack wiki
Jump to: navigation, search

CAD Tools Evening - 13th Feb 2019

Please find below a link to the PowerPoint Presentation that was used during the CAD Tools Evening.


File:Hackspace talk feb 2019.pptx


For those of you interested in knowing a little more about OpenSCAD one of our members has very kindly provided the documentation used during the CAD Tools Evening, please see link below and example code you can try out for yourself.


File:OpenSCAD-notes.pdf

Example #1 - 3D Text

// B.A.B.Y text to be exported as .SVG
// Originally to be used on
// Brother `Scan 'n Cut` machine

// Using a module to make text items simpler...
module mytext( txt )
 {
	txtfont = "Verdana:style=bold";
	txtsize = 10;
	text(txt, font=txtfont, size=txtsize);
	}

// `Scale` can be used to change overall size...
scale(2.5)
	{
	// Placing individual letters of our
	// word using `translate`...	
	translate([0,11]) mytext("B");
	translate([5,6]) mytext("A");
	translate([12,3]) mytext("B");
	translate([19.5,0]) mytext("Y");
	}


/* ------------------------------
Note: Our `mytext` module could be altered
      to allow font and size to be changed
	     via parameters...
	
module mytext( txt, txtfont = "Verdana:style=bold",txtsize = 10 )
 {
 text(txt, font=txtfont, size=txtsize);
 }
--------------------------------- */


Example #2 - 3D Name Tag

cube([10,20,5]);

cylinder( r=4, h=7 );

cylinder( r1=2, r2=0, h=15 );


translate([20,0,0]) cylinder( r=4, h=7, $fn=80 );
translate([20,10,0]) cylinder( r1=2, r2=0, h=15 );

translate([20,18,0]) cylinder( r=4, h=7, $fn=5 );


'''Example #3 - Various 3D shapes'''

$fn=80;

module base() 
 {
 translate([0,-10,0]) cube([50,20,2]);
 cylinder(r=11,h=2);
 }

module hole() 
 {
 translate([-2,0,0]) cylinder(r=6,h=3);
 }

module name() 
 {
 translate([8,-5,1]) 
  {
  linear_extrude(height=1) 
   {
   text("Name", font="Verdana", size=10);
   }
  }			
 }

difference() 
 {
 base();
 hole();
 name();
 }


Example #4 - 3D Plastic Cap

// Set default `facet number` for circles
// to 80 to make them smoother...
$fn=80;

// Put some values into variables to
// make changes easier...
thick=0.5;
diam=10;
radius=diam / 2;
height=6;	

// `difference` takes shapes away from the
// first in its list...
difference()
 {
 // main shape...	
 cylinder( r=radius, h=height );
 // use `translate to `lift` the inner
 // cylinder......	
 translate([0,0,thick])
  {	
  cylinder( r=radius-thick, h=height );
  }	
 }