Skip to content

Instantly share code, notes, and snippets.

@feomike
Last active May 7, 2021 18:03
Show Gist options
  • Save feomike/9924f5ffdb7e068d5556 to your computer and use it in GitHub Desktop.
Save feomike/9924f5ffdb7e068d5556 to your computer and use it in GitHub Desktop.
bike aml drawing

this public gist contains the arc macro language (aml) code for drawing the frame that i built at UC Davis Experimental College in 1998. the class required we have a full 1:1 scale drawing of the frame. i wrote this aml to draw out the bike, and plotted on a large scale plotter.

this is the bike - https://photos.app.goo.gl/DfCBH6uPjwr6HXGn9

i still ride this bike today.

&if [exists bkmap -dir] &then killmap bkmap
map bkmap
clear
&call symbolset
&call pagesetup
&call drawbox
&call drawtics
&call bblines
&call bglines
&call centerofsteering
&call fhub
&call crownraceseat
&call headtube
&call bottombracket
&call seattubecenter
&call downtubecenter
&call railheightline
&return
/****************************************************
/***********************SymbolSet
&routine symbolset
shadeset colornames
lineset carto
markerset water
/*background lines
linesymbol 101
linecolor slategray
lineput 402
/*point markers
markersymbol 108
markersize .15
markerput 108
&return
/****************************************************
/***********************PageSetUp
&routine pagesetup
&s maxx = 60
&s maxy = 36
pagesize %maxx% %maxy%
&return
/****************************************************
/***********************DrawBox
&routine drawbox
linesymbol 102
box .1 .1 [calc %maxx% - .1] [calc %maxy% - .1]
&return
/****************************************************
/***********************Drawtics
&routine drawtics
&s xbegp = 1
&s xendp = [calc %maxx% - 5]
/*draw tics on all sides
linesymbol 101
line %xbegp% .1 %xbegp% [calc %maxy% - .1]
line %xendp% .1 %xendp% [calc %maxy% - .1]
&do i = 1 &to [calc %maxy% - 1]
line [calc %xbegp% - .1] %i% [calc %xbegp% + .1] %i%
line [calc %xendp% - .1] %i% [calc %xendp% + .1] %i%
&end
&return
/****************************************************
/***********************BBLines
&routine bblines
&do i = 3 &to 5
line %xbegp% %i% %xendp% %i%
&end
&return
/****************************************************
/***********************BGLines
&routine bglines
linesymbol 402
&do i = 6 &to [calc %maxy% - 1]
line %xbegp% %i% %xendp% %i%
&end
&return
/****************************************************
/***********************CenterOfSteering
&routine centerofsteering
linesymbol 102
&s cos = 4,5
&s cosbegarrow 1,5
markersymbol 106
marker %cos%
arrowtype single open
arrowsize 30 109
arrow %cosbegarrow% %cos%
&return
/****************************************************
/***********************FHub
&routine FHub
markersymbol 108
&s fhubx = [calc [extract 1 %cos%] - 1.5]
&s fhuby = [extract 2 %cos%]
&s fhub = %fhubx%,%fhuby%
marker %fhub%
linesymbol 101
circle %fhub% .5
&return
/****************************************************
/***********************CrownRaceSeat
&routine crownraceseat
linesymbol 402
arrowsize 17.25 113.7
arrow 1 %fhuby% %fhub%
/*hardcoded after using measure where from 17.25
/*inches from front hub
&s CRS = 9.42 20.75
marker 9.42 20.75
&return
/****************************************************
/***********************HeadTube
&routine headtube
linesymbol 201
arrowsize .5 109
arrow [calc [extract 1 %CRS%] - .1] [extract 2 %CRS%] %CRS%
/*measure end of line using measure where and hardode the
/*center-bottom of the headtube
&s CBHT = 9.582 21.223
marker 9.582 21.223
arrowsize .625 90
linesymbol 102
arrow %CRS% %CBHT%
arrowsize .625 -90
arrow %CRS% %CBHT%
/*measure end of these lines and handcode the headtube
/*sides
&s BLHT = 8.99 21.425
&s BRHT = 10.173 21.02
&s HTL = 4.5
arrowsize %HTL% 90
arrow %BLHT% %BRHT%
arrowsize %HTL% -90
arrow %BRHT% %BLHT%
/*measure where and hand code the top of the toptupe
&s TLHT = 10.448 25.683
&s TRHT = 11.631 25.277
line %TLHT% %TRHT%
&return
/****************************************************
/***********************BottomBracket
&routine bottombracket
&s bbdrop = 1
&s frontcenter = 24.75
&s bbshellx = [calc %fhubx% + %frontcenter%]
&s bbshelly = [calc %fhuby% - %bbdrop%]
markersymbol 108
marker %bbshellx% %bbshelly%
linesymbol 102
circle %bbshellx% %bbshelly% .75
&return
/****************************************************
/***********************SeatTubeCenter
&routine seattubecenter
linesymbol 402
arrowsize 30 107
arrow [calc %bbshellx% - 1] %bbshelly% %bbshellx% %bbshelly%
&return
/****************************************************
/***********************DownTubeCenter
&routine downtubecenter
/*set angle of 90 degrees and 3/8 + 1/2 1 and 3/8
/* or .375 + .5(1.375) = 1.0625
/*inches from BRHT to hand measure the downtube center
/*attach point to headtube
linesymbol 201
arrowsize 1.0625 90
arrow %CBHT% %BRHT%
/*hand measured center downtube
&s CTDT = 10.518 22.025
linesymbol 402
line %CTDT% %bbshellx% %bbshelly%
&return
/****************************************************
/***********************RailHeightLine
&routine railheightline
&s RH = 27
linesymbol 203
lines 25 [calc %RH% + %bbshelly%] 45 [calc %RH% + %bbshelly%]
&return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment