Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
h1. General Program Information

{float:left|border=2px solid black}
[!1.bmp|width=580px!|AutoCAD Pipe Program]    [!2.bmp|width=400px!|AutoCAD Elbow Program]
Southwest Isometric View
{float}
\\
\\

h3. Input Definitions


h5. Inputs Needed to Call the Elbow Function

o -The the origin, the point corresponding to where the elbow will be drawn. o is also the center of the radius of curvature of the elbow.
Pipe{~}inr~ND \- theThe innernominal radiusdiameter of the elbow

h5pipe.  InputsThis value Definedalong withinwith the Elbow Function

p1 =
* x : o{~}0~
* y : o{~}1~
* pipe schedule is used to determine other actual dimensions of the elbow
EN - The enumerated pipe schedule type.  Each schedule of pipe has a specific number that represents it within our code.

h5. Inputs Defined within the Elbow Function

p1 =
* x : o{~}0~
* y : o{~}1~
* z : o{~}2~

p2 =
* x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND)
* y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND)
* z : o{~}2~ \- outerradius(2*pipe{~}inr~ND) + SocketDepth(2*pipe{~}inr~ND)

p3 =
* x : o{~}0~
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND)
* z : o{~}2~ + outerradius(2*pipe{~}inr~ND) + SocketDepth(2*pipe{~}inr~ND)

p4 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND) + outerraduis(2*pipe{~}inr~ND)
* y : o{~}1~
* z : o{~}2~

p5 =
* x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~ND) - pipe{~}inr~innerD(ND,EN)/2
* y : o{~}1~
* z : o{~}2~

p6 =
* x : o{~}0~
* y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~ND) - outerraduis(2*pipe{~}inr~outerraduis(ND) - zc
* z : o{~}2~ \- ConRadius(2*pipe{~}inr~ND)

p7 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND) + outerraduis(2*pipe{~}inr~ND) + zc
* y : o{~}1~
* z : o{~}2~ + ConRadius(2*pipe{~}inr~ND)

p9 =
* x : o{~}0~
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

p10 =
* x : o{~}0~ \- SocketDepth(2*pipe{~}inr~ND)
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

p11 =
* x : o{~}0~
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ElbowRadius(ND) - ConRaduis(2*pipe{~}inr~ND)
* z : o{~}2~

p12 =
* x : o{~}0~ \- SocketDepth(2*pipe{~}inr~ND) - zc
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) - outerraduis(2*pipe{~}inr~ND)
* z : o{~}2~

p13 =
* x : o{~}0~ + zc
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) + outerraduis(2*pipe{~}inr~ND)
* z : o{~}2~

p14 =
* x : o{~}0~ \- SocketDepth(2*pipe{~}inr~ND)
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~(ND) - ConRaduis(2*pipe{~}inr~ND)
* z : o{~}2~

p15 =
* x : o{~}0~
* y : o{~}1~

p16 =
* x : o{~}0~ + zc
* y : o{~}1~ + zc

p17 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND)
* y : o{~}1~ \- SocketDepth(2*pipe{~}inr~ND)
* z : o{~}2~

p18 =
* x : o{~}0~ \- SocketDepth(2*pipe{~}inr~ND)
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

R1 = ElbowRadius(2*pipe{~}inr~ND)

R2 = outerraduis(2*pipe{~}inr~ND)

R3 = pipe{~}inr~innerD(ND,EN)/2

R4 = ConRaduis(2*pipe{~}inr~ND)

win1 =
* x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~ND) - ConRaduis(2*pipe{~}inr~ND) + zc
* y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~ND) - ConRaduis(2*pipe{~}inr~ND) + zc
* z : o{~}2~

win2 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND) + zc
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~(ND) + ConRaduis(2*pipe{~}inr~ND) + zc
* z : o{~}2~

*Note:* zc corresponds to the zoom constant used within AutoCAD, defined by the basics file.

h1. Technical Program Outline

*Note:* All coordinates are referenced in top view in the program unless otherwise specified
{float:left|border=2px solid black}
[!3.bmp|width=580px!|AutoCAD Elbow Program]
{float}
*zoom{*}{*}{~}win{~}*\- zooms on a window space directly around where the elbow is to be drawn

zoom{~}win~ <-\- zoom{~}wina~(win1,win2)

win1 =
* x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~ND) - ConRaduis(2*pipe{~}inr~ND) + zc
* y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~ND) - ConRaduis(2*pipe{~}inr~ND) + zc
* z : o{~}2~

win2 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND) + zc
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND) + zc
* z : o{~}2~
\\
\\

{float:left|border=2px solid black}
[!4b.bmp|width=600px!|AutoCAD Elbow Program]
Top View
[!5.bmp|width=600px!|AutoCAD Elbow Program]
Southwest Isometric  View
{float}
*torus{*}{~}big~ \- Draws the larger torus, a 3 dimensional ring that creates the outer surface of the elbow

torus{~}big~ <-\- torus(p1,R1,R2)

p1 =
* x : o{~}0~
* y : o{~}1~
* z : o{~}2~

R1 = ElbowRadius(2*pipe{~}inr~ND)

R2 = outerraduis(2*pipe{~}inr~ND)

\\
\\
{float:left|border=2px solid black}
[!6.bmp|width=640px!|AutoCAD Elbow Program]
{float}
*box1* \- draws a box slightly larger than the torus, in all dimensions

box1 <-\- box(p2,p3)

p2 =
* x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND)
* y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND)
* z : o{~}2~ \- outerradius(2*pipe{~}inr~ND) + SocketDepth(2*pipe~inr~ND)

p3 =
* x : o{~}0~
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) + ConRaduis(2*pipe{~}inr~ND)
* z : o{~}2~ + outerradius(2*pipe{~}inr~ND) + SocketDepth(2*pipe{~}inr~ND)
\\
\\

{float:left|border=2px solid black}
[!7c.bmp|width=640px!|AutoCAD Elbow Program]
*Before Subtract*
[!7a.bmp|width=480px!|AutoCAD Elbow Program]
*After Subtract*
{float}
*subtract1* \- removes the box that was drawn over half of the torus in order to make it a half torus
subtract1<-\- subtractD(p4,p1)

p4 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND) + outerraduis(2*pipe{~}inr~ND)
* y : o{~}1~
* z : o{~}2~

p1 =
* x : o{~}0~
* y : o{~}1~
* z : o{~}2~
\\
\\

{float:left|border=2px solid black}
[!8.bmp|width=680px!|AutoCAD Elbow Program]
{float}
\*torus\*~small~\ - draws a smaller torus

torus{~}small~ <-\- torus(p1,R1,R3)

p1 =
* x : o{~}0~
* y : o{~}1~
* z : o{~}2~

R1 = ElbowRadius(2*pipe{~}inr~ND)

R3 = pipe{~}inr~innerD(ND,EN)/2

\\
\\
{float:left|border=2px solid black}
[!8b.bmp|width=680px!|AutoCAD Elbow Program]
*Before Subtract*
[!9.bmp|width=500px!|AutoCAD Elbow Program]
*After Subtract*
{float}
*subtract2* \- removes the left half of the smaller torus

subtract2 <-\- subtractA(p4,p5)

p4 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND) + outerraduis(2*pipe{~}inr~ND)
* y : o{~}1~
* z : o{~}2~

p5 =
* x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~ND) - pipe{~}inr~)innerD(ND,EN)/2
* y : o{~}1~
* z : o{~}2~

\\
\\
{float:left|border=2px solid black}
[!10.bmp|width=480px!|AutoCAD Elbow Program]
{float}
*box2*\- draws a box over the lower half of the remaining torus

box2 <-\- box(p6,p7)

p6 =
* x : o{~}0~
* y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~ND) - outerraduis(2*pipe{~}inr~ND) - zc
* z : o{~}2~ \- ConRadius(2*pipe{~}inr~ND)

p7 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND) + outerraduis(2*pipe{~}inr~ND) + zc
* y : o{~}1~
* z : o{~}2~ + ConRadius(2*pipe{~}inr~ND)

\\
\\
{float:left|border=2px solid black}
[!11.bmp|width=480px!|AutoCAD Elbow Program]
{float}
*subtract3* \- removes the box that was drawn in the previous step

subtract3 <-\- subtractD(p9,p1)

p9 =
* x : o{~}0~
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

p1 =
* x : o{~}0~
* y : o{~}1~
* z : o{~}2~

\\
\\
{float:left|border=2px solid black}
[!12.bmp|width=480px!|AutoCAD Elbow Program]
{float}
*outercylinder* \- draws a cylinder at the end of the elbow to form the outer surface of a socket

outercylinder <-\- cylinderB(p9,R4,P10)

p9 =
* x : o{~}0~
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

R4 = ConRaduis(2*pipe{~}inr~ND)

p10 =
* x : o{~}0~ \- SocketDepth(2*pipe~inr~ND)
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

\\
\\
{float:left|border=2px solid black}
[!13a.bmp|width=480px!|AutoCAD Elbow Program]
[!13a.bmp|width=6000px!|AutoCAD Elbow Program]
Southwest Isometric View
{float}
*innercylinder* \- draws a smaller cylinder within the larger cylinder, forming the inner surface of a socket

innercylinder <-\- cylinderB(p9,R2,p10)

p9 =
* x : o{~}0~
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

R2 = outerraduis(2*pipe{~}inr~outerraduis(ND)

p10 =
* x : o{~}0~ \- SocketDepth(2*pipe~inr~ND)
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

\\
\\
{float:left|border=2px solid black}
[!14.bmp|width=480px!|AutoCAD Elbow Program]
{float}
*subtract4* \- removes the smaller cylinder, creating a hollow socket at the end of the elbow

subtract4 <-\- subtractH(p11,p12,p13)

p11 =
* x : o{~}0~
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) - ConRaduis(2*pipe{~}inr~ND)
* z : o{~}2~

p12 =
* x : o{~}0~ \- SocketDepth(2*pipe~inr~ND) - zc
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) - outerraduis(2*pipe{~}inr~ND)
* z : o{~}2~

p13 =
* x : o{~}0~ + zc
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) + outerraduis(2*pipe{~}inr~outerraduis(ND)
* z : o{~}2~
\\
\\

{float:left|border=2px solid black}
[!15a.bmp|width=480px!|AutoCAD Elbow Program]
[!15b.bmp|width=480px!|AutoCAD Elbow Program]
{float}
*mirror* \- replicates the socket drawn onto the opposite end of the elbow

mirror <-\- mirrorA(p14,p15,p16)

p14 =
* x : o{~}0~ \- SocketDepth(2*pipe~inr~ND)
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND) - ConRaduis(2*pipe{~}inr~ND)
* z : o{~}2~

p15 =
* x : o{~}0~
* y : o{~}1~

p16 =
* x : o{~}0~ + zc
* y : o{~}1~ + zc

\\
\\
{float:left|border=2px solid black}
[!16a.bmp|width=480px!|AutoCAD Elbow Program]
[!16b.bmp|width=480px!|AutoCAD Elbow Program]
{float}
*bigunion* \- unites all the pieces drawn so the elbow will act as one unit, instead of three separate units.

bigunion <-\- bigunion{~}elbow~(p1,p17,p18,R1,R2)

p1 =
* x : o{~}0~
* y : o{~}1~
* z : o{~}2~

p17 =
* x : o{~}0~ + ElbowRadius(2*pipe{~}inr~ND)
* y : o{~}1~ \- SocketDepth(2*pipe~inr~ ND)
* z : o{~}2~

p18 =
* x : o{~}0~ \- SocketDepth(2*pipe~inr~ND)
* y : o{~}1~ + ElbowRadius(2*pipe{~}inr~ND)
* z : o{~}2~

R1 = ElbowRadius(2*pipe{~}inr~ND)

R2 = outerraduis(2*pipe{~}inr~ND)
\\
\\