File:Rectilinear motion of horizontal bar.gif

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Rectilinear_motion_of_horizontal_bar.gif (453 × 460 pixels, file size: 205 KB, MIME type: image/gif, looped, 50 frames, 5.0 s)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Rectilinear motion of horizontal bar, by means of vibrating slotted bar hung from the top
Date
Source Own work, inspired by http://507movements.com/mm_101.html
Author MichaelFrey
//Rectilinear motion of horizontal bar,
//by means of vibrating slotted bar hung from the top
//created by Michael Frey
//released on Wikimedia commons under
//CC-BY-SA 3.0 license
//(c) Michael Frey
//---------------------
//inspired by
//http://507movements.com/mm_101.html
use <../lib/geom2D.scad>;
ang = sin($t*360)*15;

lc = 130; //Crank length
sa =  40; //Start of the Slot
sb =  60; //end  of the Slot

off = 48; //offset of the bearings
bd = 50; //bearing distance

sl = 160; //slide length
sw =20; //slide width
slideSquare = true;

gw= 26;

base =200;

pinWidth=5;

//---------------------

org=[0,0];
A=addAngle2D(org,ang,lc);

A1=addAngle2D(org,ang,sa);
A2=addAngle2D(org,ang,sb);

B0=[off,0];
B1=[off,+bd];
B2=[off,-bd];

B = crossPoint(B1,B2,org,A);

BC =add2D(B,[0,-sl/2]);
BD =add2D(B,[0,+sl/2]);

//---------------------

translate([0,0,-5])
translate(B0)
color([0.8,0.8,1.0])
cube([base,base,2],center=true);

color([0,0,0])
translate([0,0,1])
translate(org)
cylinder(r=pinWidth,h=13,center = true);
 
color([1,0.75,0.2])
translate([0,0,5])
difference(){
    union(){
        hull(){
            translate(A1)
            cylinder(r=10,h=2,center = true);
            translate(A2)
            cylinder(r=10,h=2,center = true);
        }
         hull(){
            translate(org)
            cylinder(r=pinWidth,h=2,center = true);
            translate(A)
            cylinder(r=pinWidth,h=2,center = true);
        }
    }
    hull(){
        translate(A1)
        cylinder(r=pinWidth,h=3,center = true);
        translate(A2)
        cylinder(r=pinWidth,h=3,center = true);
    }
}
    
//slider guide
color([0,0,0])translate(B1)
cube(size = [25,5,10], center = true);
//slider guide
color([0,0,0])translate(B2)
cube(size = [25,5,10], center = true);

//Pin
color([1,0,0])translate([0,0,5])
translate(B)
cylinder(r=pinWidth,h=10,center = true);

//slider
color([0,1,0])
if(slideSquare){
    translate(B)
    cube([sw,sl,2],center = true);
}else{
    hull(){
        translate(BC)
        cylinder(d=sw,h=2,center = true);
        translate(BD)
        cylinder(d=sw,h=2,center = true);
   }
 }
//created by Michael Frey
//released on Wikimedia commons under
//CC-BY-SA 3.0 license
//(c) Michael Frey

function add2D(v1,v2) = [v1[0]+v2[0], v1[1]+v2[1]];
function sub2D(v1,v2) = [v1[0]-v2[0], v1[1]-v2[1]];
function addAngle2D(v1,ang,l) = 
  [
    v1[0]+cos(ang)*l,
    v1[1]-sin(ang)*l,
  ];

function negativ(val) = (val==abs(val)) ? false: true;

function getAngle2D(v1,v2=[0,0]) =
  let(dx=v2[0]-v1[0])
  let(dy=v2[1]-v1[1])
  let(ang=atan((dx)/(dy)))
  (negativ(dy) ) ? ang-180 : ang;

function getAngle2Ds(v1,v2=[0,0]) =
  let(dx=v2[0]-v1[0])
  let(dy=v2[1]-v1[1])
  atan((dx)/(dy));

function getAngle2D2(v1,v2=[0,0]) =
  let(dx=v2[0]-v1[0])
  let(dy=v2[1]-v1[1])
  atan2((dx),(dy));

function scale2D(v1,c=1)= 
  [
    v1[0]*c,
    v1[1]*c,
  ];
  
 function midpoint2D(v1,v2)=
 [
    (v1[0]+v2[0])/2,
    (v1[1]+v2[1])/2
 ];
  
function scaleToLength2D(v1,v2,l)= 
  let(c=l/length2D(v1,v2))
  [
    (v2[0]-v1[0])*c+v1[0],
    (v2[1]-v1[1])*c+v1[1],
  ];

//Calculating the crossing point of two vectors,
//defined by two coordinates each
function crossPoint(v1,v2,v3,v4) =
[
  
	   ( (v4[0]-v3[0])*(v2[0]*v1[1]-v1[0]*v2[1]) - (v2[0]-v1[0])*(v4[0]*v3[1]-v3[0]*v4[1]) ) /
	   ( (v4[1]-v3[1])*(v2[0]-v1[0])       - (v2[1]-v1[1])*(v4[0]-v3[0]) )
  ,
   
	   ( (v1[1]-v2[1])*(v4[0]*v3[1]-v3[0]*v4[1]) - (v3[1]-v4[1])*(v2[0]*v1[1]-v1[0]*v2[1]) ) /
	   ( (v4[1]-v3[1])*(v2[0]-v1[0])       - (v2[1]-v1[1])*(v4[0]-v3[0]) )
  
];

function length2D(v1,v2=[0,0])=
  sqrt(
      (v1[0]-v2[0])*(v1[0]-v2[0])
      +
      (v1[1]-v2[1])*(v1[1]-v2[1])
    );

//Law of cosines
function VVLL2D(v1,v2,l1,l2) =
  let(sAB = length2D(v1,v2))
  let(ang12=getAngle2D(v2,v1))
  let(ang0=
        acos(
          (l2*l2-l1*l1-sAB*sAB)/
          (-abs(2*sAB*l1))
        ))
        
  addAngle2D(
    v1=v1,
    ang=ang0+ang12-90,
    l=-l1
  );

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current03:58, 4 October 2017Thumbnail for version as of 03:58, 4 October 2017453 × 460 (205 KB)MichaelFrey (talk | contribs)User created page with UploadWizard

There are no pages that use this file.