Ball Bearing Script: Difference between revisions
Jump to navigation
Jump to search
(Created page with "Explained fully at https://linuxforanengineer.blogspot.com/2013/08/free-cad-bearing-script.html: import Part import math #VALUES# R1=15.0 R2=25.0 R3=30.0 R4=40.0 TH=15.0 NB...") |
No edit summary |
||
Line 1: | Line 1: | ||
Explained fully at https://linuxforanengineer.blogspot.com/2013/08/free-cad-bearing-script.html: | Explained fully at https://linuxforanengineer.blogspot.com/2013/08/free-cad-bearing-script.html: | ||
import Part | <nowiki>import Part | ||
import math | import math | ||
Line 37: | Line 37: | ||
Ball.translate(BV) | Ball.translate(BV) | ||
Part.show(Ball) | Part.show(Ball) | ||
</nowiki> |
Revision as of 02:28, 31 May 2020
Explained fully at https://linuxforanengineer.blogspot.com/2013/08/free-cad-bearing-script.html:
import Part import math #VALUES# R1=15.0 R2=25.0 R3=30.0 R4=40.0 TH=15.0 NBall=10 RBall=5.0 #Program# B1=Part.makeCylinder(R1,TH) B2=Part.makeCylinder(R2,TH) IR=B2.cut(B1) B3=Part.makeCylinder(R3,TH) B4=Part.makeCylinder(R4,TH) OR=B4.cut(B3) Part.show(IR) Part.show(OR) CBall=((R3-R2)/2)+R2 PBall=TH/2 for i in range(NBall): Ball=Part.makeSphere(RBall) Alpha=(i*2*math.pi)/NBall BV=(CBall*math.cos(Alpha),CBall*math.sin(Alpha),TH/2) Ball.translate(BV) Part.show(Ball)