Tuesday, April 15, 2025

Setting Circles

 I mentioned to my wife making setting circles and she reminded me that some years ago, I spent some time coding PostScript to produce them on paper.  My thought is to use the code for cutting a 6" circle of CFC, then sticking these on and applying whatever best protects the surface.  Polyurethane?

Advantages include that these markings are much finer than I can machine except with endmills so narrow that I am skeptical they will survive many strokes.  I was going to need to fill in the cuts with a little white paint and wipe away the excess.


If you have not had the joy of coding in PostScript, it is very close to a write-only language.

%!

{1 exch sub} settransfer % only used for making negative images

showpage

/center {

/width exch def

/str exch def

width str stringwidth pop sub 2 div 0 rmoveto

str show

} bind def

/circletext {

circtextdict begin

/radius exch def

/centerangle exch def

/ptsize exch def

/str exch def

/xradius radius ptsize 3 div sub def

gsave

centerangle str findhalfangle sub rotate

str {

/charcode exch def

( ) dup 0 charcode put placechar

} forall

grestore

end

} bind def

/circtextdict 16 dict def

circtextdict begin

/findhalfangle {

stringwidth pop 2 div

2 xradius mul pi mul div 360 mul

} bind def

/placechar {

/char exch def

/halfangle char findhalfangle def

gsave

halfangle rotate

radius 0 translate

90 rotate

char stringwidth pop 2 div neg 0 moveto

char show

grestore

halfangle 2 mul rotate

} bind def

/pi 3.1415923 def

end




/in {72 mul} def

/LineWidth 1 def

/R 3 in def

/OriginX 4.25 in def

/OriginY 5.5 in def

/StartX {cos mul} def

/StartY {sin mul} def

/FontSize 18 def

/Times-Roman findfont FontSize scalefont setfont

/CompDegreeNbr {Angle 0 ge Angle 90 le and

{Angle} % 0-90

{Angle 90 gt Angle 180 le and %90-360

{90 Angle 90 sub sub} % 90-180

{Angle 180 gt Angle 270 le and % 180-360

{Angle 180 sub} % 180-270

{360 Angle sub} % 270-360

ifelse}

ifelse}

ifelse} def

/ComputeRotate {Angle 0 ge Angle 90 le and

{Angle 90 add} % 0-90

{Angle 90 gt Angle 180 le and %90-360

{Angle 90 sub 180 add} % 90-180

{Angle 180 gt Angle 270 le and % 180-360

{Angle 180 sub 270 add} % 180-270

{Angle 270 sub} % 270-360

ifelse}

ifelse}

ifelse} def

/CopyrightNotice

{gsave

/Times-Roman findfont 12 scalefont setfont

(Copyright Clayton E. Cramer 1989 All Rights Reserved) 12 0 1 in circletext

grestore} def

/TextLoc 1 in def

1 setlinewidth

% draw outer circle

OriginX OriginY translate 0 0 R 0 360 arc stroke

% draw center point for drill

0 0 1 0 360 arc stroke

% draw .5" cut marks

%0 0 0.25 in 0 360 arc stroke

% draw 1" cut marks

0 0 0.5 in 0 360 arc stroke

% draw 1.5" cut marks

%0 0 .75 in 0 360 arc stroke

% draw 2" cut marks

%0 0 1 in 0 360 arc stroke

% draw 2.5" cut marks

%0 0 1.25 in 0 360 arc stroke

% put out copyright notice

CopyrightNotice

% narrowest possible lines

LineWidth setlinewidth

% draw ten degree line dividers

/TenDegreeDividers 0.75 in def

/DrawTenDegreeLine {/Angle exch def R Angle StartX R Angle StartY moveto

R TenDegreeDividers sub Angle StartX

R TenDegreeDividers sub Angle StartY lineto stroke

R TextLoc sub Angle StartX

R TextLoc sub Angle StartY moveto

ComputeRotate rotate

CompDegreeNbr 10 3 string cvrs % string now computed

dup stringwidth exch -2 div exch % center string horiz

rmoveto

show ComputeRotate neg rotate} def

/FiveDegreeDividers 0.6 in def

/DrawFiveDegreeLine {/Angle exch def R Angle StartX R Angle StartY moveto

R FiveDegreeDividers sub Angle StartX

R FiveDegreeDividers sub Angle StartY lineto stroke} def

/OneDegreeDividers 0.4 in def

/DrawOneDegreeLine {/Angle exch def R Angle StartX R Angle StartY moveto

R OneDegreeDividers sub Angle StartX

R OneDegreeDividers sub Angle StartY lineto stroke} def

/HalfDegreeDividers 0.25 in def

/DrawHalfDegreeLine {/Angle exch def R Angle StartX R Angle StartY moveto

R HalfDegreeDividers sub Angle StartX

R HalfDegreeDividers sub Angle StartY lineto stroke} def

/QuarterDegreeDividers 0.25 in def

/DrawQuarterDegreeLine {/Angle exch def R Angle StartX R Angle StartY moveto

R QuarterDegreeDividers sub Angle StartX

R QuarterDegreeDividers sub Angle StartY lineto stroke} def

0 10 360 10 sub {DrawTenDegreeLine} for

0 5 360 5 sub {DrawFiveDegreeLine} for

0 1 360 1 sub {DrawOneDegreeLine} for

0 .5 360 .5 sub {DrawHalfDegreeLine} for

% 0 .25 360 .25 sub {DrawQuarterDegreeLine} for

showpage

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Draw Right Acension circle.

1 setlinewidth

% draw outer circle

OriginX OriginY translate 0 0 R 0 360 arc stroke

% draw center point for drill

0 0 1 0 360 arc stroke

% draw .5" cut marks

%0 0 0.25 in 0 360 arc stroke

% draw 1" cut marks

0 0 0.5 in 0 360 arc stroke

% draw 1.5" cut marks

%0 0 .75 in 0 360 arc stroke

% draw 2" cut marks

%0 0 1 in 0 360 arc stroke

% draw 2.5" cut marks

%0 0 1.25 in 0 360 arc stroke

% put out copyright notice

CopyrightNotice

% narrowest possible lines

LineWidth setlinewidth

% draw hour line dividers

/HourDividers 0.75 in def

/DrawHourLine {15 mul /Angle exch def R Angle StartX R Angle StartY moveto

R HourDividers sub Angle StartX

R HourDividers sub Angle StartY lineto stroke

R TextLoc sub Angle StartX

R TextLoc sub Angle StartY moveto

ComputeRotate rotate

Angle 15 div cvi 10 3 string cvrs % string now computed

dup stringwidth exch -2 div exch % center string horiz

rmoveto

show (h) show ComputeRotate neg rotate} def

/HalfHourDividers 0.6 in def

/DrawHalfHourLine {/Angle exch def R Angle StartX R Angle StartY moveto

R HalfHourDividers sub Angle StartX

R HalfHourDividers sub Angle StartY lineto stroke} def

/TenMinDividers 0.4 in def

/DrawTenMinLine {/Angle exch def R Angle StartX R Angle StartY moveto

R TenMinDividers sub Angle StartX

R TenMinDividers sub Angle StartY lineto stroke} def

/TwoMinDividers 0.2 in def

/DrawTwoMinLine {/Angle exch def R Angle StartX R Angle StartY moveto

R TwoMinDividers sub Angle StartX

R TwoMinDividers sub Angle StartY lineto stroke} def

/OneMinDividers 0.2 in def

/DrawOneMinLine {/Angle exch def R Angle StartX R Angle StartY moveto

R OneMinDividers sub Angle StartX

R OneMinDividers sub Angle StartY lineto stroke} def

0 1 23 {DrawHourLine} for

0 7.5 360 7.5 sub {DrawHalfHourLine} for

0 2.5 360 2.5 sub {DrawTenMinLine} for

0 0.5 360 0.5 sub {DrawTwoMinLine} for

%0 0.25 360 0.25 sub {DrawOneMinLine} for

showpage




1 comment:

  1. Oregon Rule Co. produces adhesive dials of various sorts, easy peasy:

    https://oregonrule.com/orc/

    ReplyDelete