This is a file from the Wikimedia Commons

File:Quick return crank motion.gif

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Original file(499 × 687 pixels, file size: 88 KB, MIME type: image/gif, looped, 25 frames, 2.5 s)

Summary

Description
English: Quick return crank motion
Date
Source Own work, inspired by http://507movements.com/mm_100.html
Author MichaelFrey
Other versions

Code

//Quick return crank motion
//created by Michael Frey
//released on Wikimedia commons under
//CC-BY-SA 3.0 license
//(c) Michael Frey
//---------------------
//inspired by
//http://507movements.com/mm_100.html
use <../lib/geom2D.scad>;
ang = $t*360;

lc=20;   //Crank length

org=[0,0];
A=[cos(-ang)*lc, sin(-ang)*lc];
B=[0,50];
alpha=getAngle2D(A,B);

C=addAngle2D(B,alpha+90,100);
C1=addAngle2D(B,alpha+90,20);
C2=addAngle2D(B,alpha+90,100-20);
C3=addAngle2D(B,alpha+90,-50);

translate([0,0,-3]){
color([0,1,0])
translate(org)
cylinder(r=40,h=2,center = true);
    
color([0,0,0])
translate(org)
cylinder(r=5,h=3,center = true);

}

color([0,0.5,0])
translate(A)
cylinder(r=5.9,h=4,center = true);

color([0.5,0,0])
translate(B)
cylinder(r=5,h=5,center = true);

difference(){
    hull(){
        translate(B)
        cylinder(r=10,h=2,center = true);
        translate(C)
        cylinder(r=10,h=2,center = true);
    }
    hull(){
        translate(C1)
        cylinder(r=6,h=5,center = true);
        translate(C2)
        cylinder(r=6,h=5,center = true);
    }
}
hull(){
    translate(B)
    cylinder(r=5,h=2,center = true);
    translate(C3)
    cylinder(r=5,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

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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

2 October 2017

File history

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

Date/TimeThumbnailDimensionsUserComment
current11:28, 2 October 2017Thumbnail for version as of 11:28, 2 October 2017499 × 687 (88 KB)MichaelFreyUser created page with UploadWizard

The following page uses this file: