General Program Information
Wiki Markup |
---|
h1. General Program Information {float:left|border=2px solid black} [!1.bmp|width=580px480px!|AutoCAD Pipe Program] [!2.bmp|width=400px300px!|AutoCAD Elbow Program] Southwest Isometric View {float} \\ \\ h3. Input Definitions h5. Inputs Needed to Call the Elbow Function o - 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~ \- the inner radius of the elbow 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~) + ConRaduis(2*pipe{~}inr~) * y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) * z : o{~}2~ \- outerradius(2*pipe{~}inr~) + SocketDepth(2*pipe{~}inr~) p3 = * x : o{~}0~ * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) * z : o{~}2~ + outerradius(2*pipe{~}inr~) + SocketDepth(2*pipe{~}inr~) p4 = * x : o{~}0~ + ElbowRadius(2*pipe{~}inr~) + outerraduis(2*pipe{~}inr~) * y : o{~}1~ * z : o{~}2~ p5 = * x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~) - pipe{~}inr~ * y : o{~}1~ * z : o{~}2~ p6 = * x : o{~}0~ * y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~) - outerraduis(2*pipe{~}inr~) - zc * z : o{~}2~ \- ConRadius(2*pipe{~}inr~) p7 = * x : o{~}0~ + ElbowRadius(2*pipe{~}inr~) + outerraduis(2*pipe{~}inr~) + zc * y : o{~}1~ * z : o{~}2~ + ConRadius(2*pipe{~}inr~) p9 = * x : o{~}0~ * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) * z : o{~}2~ p10 = * x : o{~}0~ \- SocketDepth(2*pipe{~}inr~) * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) * z : o{~}2~ p11 = * x : o{~}0~ * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) - ConRaduis(2*pipe{~}inr~) * z : o{~}2~ p12 = * x : o{~}0~ \- SocketDepth(2*pipe{~}inr~) - zc * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) - outerraduis(2*pipe{~}inr~) * z : o{~}2~ p13 = * x : o{~}0~ + zc * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) + outerraduis(2*pipe{~}inr~) * z : o{~}2~ p14 = * x : o{~}0~ \- SocketDepth(2*pipe{~}inr~) * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) - ConRaduis(2*pipe{~}inr~) * 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~) * y : o{~}1~ \- SocketDepth(2*pipe{~}inr~) * z : o{~}2~ p18 = * x : o{~}0~ \- SocketDepth(2*pipe{~}inr~) * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) * z : o{~}2~ R1 = R2 = R3 = R4 = H1 = win1 = * x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~) - ConRaduis(2*pipe{~}inr~) + zc * y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~) - ConRaduis(2*pipe{~}inr~) + zc * z : o{~}2~ win2 = * x : o{~}0~ + ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) + zc * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) + 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 |
Input Definitions
Inputs Needed to Call the Elbow Function
o -The origin, the center of the radius of curvature of the elbow.
ND - The nominal diameter of the pipe. This value along with the pipe schedule is used to determine other actual dimensions of the elbow
EN - The enumerated pipe schedule type. Each schedule of pipe is represented by a specific number within our code.
Inputs Defined within the Elbow Function
p1 =
- x : o0
- y : o1
- z : o2
p2 =
- x : o0 - ElbowRadius(ND) - outerraduis(ND) - zc
- y : o1 - ElbowRadius(ND) - outerraduis(ND) - zc
- z : o2 - outerraduis(ND) - zc
p3 =
- x : o0
- y : o1 + ElbowRadius(ND) + outerraduis(ND) + zc
- z : o2 + outerraduis(ND) + zc
p4 =
- x : o0 + ElbowRadius(ND) + outerraduis(ND)
- y : o1
- z : o2
p5 =
- x : o0 - ElbowRadius(ND) - innerD(ND,EN)/2
- y : o1
- z : o2
p6 =
- x : o0
- y : o1 - ElbowRadius(ND) - outerraduis(ND) - zc
- z : o2 - ConRadius(ND)
p7 =
- x : o0 + ElbowRadius(ND) + outerraduis(ND) + zc
- y : o1
- z : o2 + ConRadius(ND)
p9 =
- x : o0
- y : o1 + ElbowRadius(ND)
- z : o2
p10 =
- x : o0 - SocketDepth(ND)
- y : o1 + ElbowRadius(ND)
- z : o2
p11 =
- x : o0
- y : o1 + ElbowRadius(ND) - ConRaduis(ND)
- z : o2
p12 =
- x : o0 - SocketDepth(ND) - zc
- y : o1 + ElbowRadius(ND) - outerraduis(ND)
- z : o2
p13 =
- x : o0 + zc
- y : o1 + ElbowRadius(ND) + outerraduis(ND)
- z : o2
p14 =
- x : o0 - SocketDepth(ND)
- y : o1 + ElbowRadius(ND) - ConRaduis(ND)
- z : o2
p15 =
- x : o0
- y : o1
p16 =
- x : o0 + zc
- y : o1 + zc
p17 =
- x : o0 + ElbowRadius(ND)
- y : o1 - SocketDepth(ND)
- z : o2
p18 =
- x : o0 - SocketDepth(ND)
- y : o1 + ElbowRadius(ND)
- z : o2
R1 = ElbowRadius(ND) : Radius of curvature of the elbow
R2 = outerraduis(ND) : Outer radius of the elbow
R3 = innerD(ND,EN)/2 : Inner radius of the elbow
R4 = ConRaduis(ND) : Outer radius of the socket
win1 =
- x : o0 - ElbowRadius(ND) - ConRaduis(ND) - zc
- y : o1 - ElbowRadius(ND) - ConRaduis(ND) - zc
- z : o2
win2 =
- x : o0 + ElbowRadius(ND) + ConRaduis(ND) + zc
- y : o1 + ElbowRadius(ND) + ConRaduis(ND) + zc
- z : o2
Note: zc corresponds to the zoom constant used within AutoCAD, defined by the basics file.
Technical Program Outline
Note: All coordinates are referenced in top view in the program unless otherwise specified
Wiki Markup |
---|
{float:left|border=2px solid black} [!3.bmp|width=580px480px!|AutoCAD Elbow Program] {float} *zoom{*}{*}{~}win{~}*\- zooms on a window space directly around where the elbow is to be drawn zoom{~}win~ <-\- zoom{~}wina~ |
zoomwin- zooms on a window space directly around where the elbow is to be drawn
zoomwin <-- zoomwina(win1,win2)
...
win1
...
=
...
- x
...
- : o0 - ElbowRadius(ND) - ConRaduis(ND) - zc
- y : o1 - ElbowRadius(ND) - ConRaduis(ND) - zc
- z : o2
win2 =
- x : o0 + ElbowRadius(ND) + ConRaduis(ND) + zc
- y : o1 + ElbowRadius(ND) + ConRaduis(ND) + zc
- z : o2
Wiki Markup |
---|
{ o{~}0~ \- ElbowRadius(2*pipe{~}inr~) - ConRaduis(2*pipe{~}inr~) + zc * y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~) - ConRaduis(2*pipe{~}inr~) + zc * z : o{~}2~ win2 = * x : o{~}0~ + ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) + zc * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) + zc * z : o{~}2~ \\ \\ {float:left|border=2px solid black} [!4b.bmp|width=600px480px!|AutoCAD Elbow Program] Top View [!5.bmp|width=600px480px!|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~ <-\- |
torusbig - Draws the larger torus, a 3 dimensional ring that creates the outer surface of the elbow
torusbig <-- torus(p1,R1,R2)
p1 = origin
R1 = Radius of curvature of the elbow
R2 = Outer radius of the elbow
Wiki Markup |
---|
{float:left|border=2px solid black} [! p1 = * x : o{~}0~ * y : o{~}1~ * z : o{~}2~ R1 = R2 = \\ \\ {float:left|border=2px solid black} [!6.bmp|width=640px480px!|AutoCAD Elbow Program] {float} * |
box1
...
-
...
draws
...
a
...
box
...
slightly
...
larger
...
than
...
the
...
torus,
...
in
...
all
...
dimensions
...
box1
...
<-
...
-
...
box(p2,p3)
...
p2
...
=
...
- x
...
- : o0 - ElbowRadius(ND) - outerraduis(ND) - zc
- y : o1 - ElbowRadius(ND) - outerraduis(ND) - zc
- z : o2 - outerraduis(ND) - zc
p3 =
- x : o0
- y : o1 + ElbowRadius(ND) + ConRaduis(ND)
- z : o2 + outerradius(ND) + SocketDepth(ND)
Wiki Markup |
---|
o{~}0~ \- ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) * y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) * z : o{~}2~ \- outerradius(2*pipe{~}inr~) + SocketDepth(2*pipe~inr~) p3 = * x : o{~}0~ * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) + ConRaduis(2*pipe{~}inr~) * z : o{~}2~ + outerradius(2*pipe{~}inr~) + SocketDepth(2*pipe{~}inr~) \\ \\ {float:left|border=2px solid black} [!7c.bmp|width=640px540px!|AutoCAD Elbow Program] *Before Subtract* [!7a.bmp|width=480px380px!|AutoCAD Elbow Program] *After Subtract* {float} * |
subtract1
...
- subtracts the left half of the large torus by using p4 to select the torus as the object to be subtracted from, and using the origin to select the box as the object to be subtracted.
subtract1<-- subtractD(p4,p1)
...
p4
...
=
...
- x
...
- :
...
- o
...
- 0 +
...
- ElbowRadius(ND) + outerraduis(ND)
- y : o1
- z : o2
p1 = origin
Wiki Markup |
---|
{2*pipe{~}inr~) + outerraduis(2*pipe{~}inr~) * 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=600px480px!|AutoCAD Elbow Program] {float} \*torus\*~small~\ - draws a smaller torus torus{~}small~ <-\- |
torussmall - draws a smaller torus
torussmall <-- torus(p1,R1,R3)
p1 = origin
R1 = Radius of curvature of the elbow
R3 = Inner radius of the elbow
Wiki Markup |
---|
{float:left| p1 = * x : o{~}0~ * y : o{~}1~ * z : o{~}2~ R1 = R3 = \\ \\ {float:left|border=2px solid black} [!8b.bmp|width=600px480px!|AutoCAD Elbow Program] *Before Subtract* [!9.bmp|width=480px400px!|AutoCAD Elbow Program] *After Subtract* {float} * |
subtract2
...
-
...
removes the smaller torus, making the large torus hollow by using p4 to select the large torus as the object to be subtracted from, and using p5 to select the smaller torus as the object to be subtracted.
subtract2 <-- subtractA(p4,p5)
...
p4
...
=
...
- x
...
- :
...
- o
...
- 0 +
...
- ElbowRadius(ND) + outerraduis(ND)
- y : o1
- z : o2
p5 =
- x : o0 - ElbowRadius(ND) - innerD(ND,EN)/2
- y : o1
- z : o2
Wiki Markup |
---|
{float:left2*pipe{~}inr~) + outerraduis(2*pipe{~}inr~) * y : o{~}1~ * z : o{~}2~ p5 = * x : o{~}0~ \- ElbowRadius(2*pipe{~}inr~) - pipe{~}inr~) * y : o{~}1~ * z : o{~}2~ \\ \\ {float:left|border=2px solid black} [!10.bmp|width=480px380px!|AutoCAD Elbow Program] {float} * |
box2
...
-
...
draws
...
a
...
box
...
over
...
the
...
lower
...
half
...
of
...
the
...
remaining
...
hollow torus
...
box2
...
<-
...
-
...
box(p6,p7)
...
p6
...
=
...
- x
...
- : o0
- y : o1 - ElbowRadius(ND) - outerraduis(ND) - zc
- z : o2 - ConRadius(ND)
p7 =
- x : o0 + ElbowRadius(ND) + outerraduis(ND) + zc
- y : o1
- z : o2 + ConRadius(ND)
Wiki Markup |
---|
o{~}0~ * y : o{~}1~ \- ElbowRadius(2*pipe{~}inr~) - outerraduis(2*pipe{~}inr~) - zc * z : o{~}2~ \- ConRadius(2*pipe{~}inr~) p7 = * x : o{~}0~ + ElbowRadius(2*pipe{~}inr~) + outerraduis(2*pipe{~}inr~) + zc * y : o{~}1~ * z : o{~}2~ + ConRadius(2*pipe{~}inr~) \\ \\ {float:left|border=2px solid black} [!11.bmp|width=480px380px!|AutoCAD Elbow Program] {float} * |
subtract3
...
- removes a portion of the hollow elbow by using p9 to select the hollow torus as the object to be subtracted from, and using the origin to select the box as the object to be subtracted.
subtract3 <-- subtractD(p9,p1)
p9 =
- x : o0
- y : o1 + ElbowRadius(ND)
- z : o2
p1 = origin
Wiki Markup |
---|
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~) * z : o{~}2~ p1 = * x : o{~}0~ * y : o{~}1~ * z : o{~}2~ \\ \\ {float:left|border=2px solid black} [!12.bmp|width=480px380px!|AutoCAD Elbow Program] [!12b.bmp|width=380px!|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
...
- : o0
- y : o1 + ElbowRadius(ND)
- z : o2
R4 = Outer radius of the socket
p10 =
- x : o0 - SocketDepth(ND)
- y : o1 + ElbowRadius(ND)
- z : o2
Wiki Markup |
---|
o{~}0~ * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) * z : o{~}2~ R4 = p10 = * x : o{~}0~ \- SocketDepth(2*pipe~inr~) * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) * z : o{~}2~ \\ \\ {float:left|border=2px solid black} [!13!13a.bmp|width=380px!|AutoCAD Elbow Program] [!13c.bmp|width=480px380px!|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
...
- : o0
- y : o1 + ElbowRadius(ND)
- z : o2
R2 = Outer raduis of elbow
p10 =
- x : o0 - SocketDepth(ND)
- y : o1 + ElbowRadius(ND)
- z : o2
Wiki Markup |
---|
o{~}0~ * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) * z : o{~}2~ R2 = p10 = * x : o{~}0~ \- SocketDepth(2*pipe~inr~) * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) * z : o{~}2~ \\ \\ {float:left|border=2px solid black} [!14a.bmp|width=380px!|AutoCAD Elbow Program] [!14.bmp|width=480px380px!|AutoCAD Elbow Program] Program] Southwest Isometric View {float} * |
subtract4
...
-
...
removes
...
the
...
smaller
...
cylinder,
...
creating
...
a
...
hollow
...
socket
...
at
...
the
...
end
...
of
...
the
...
elbow using p11 to select the region to subtract from, and using p12 and p13 to select the inner cylinder to be subtracted.
subtract4 <-- subtractH(p11,p12,p13)
...
p11
...
=
...
- x
...
- : o0
- y : o1 + ElbowRadius(ND) - ConRaduis(ND)
- z : o2
p12 =
- x : o0 - SocketDepth(ND) - zc
- y : o1 + ElbowRadius(ND) - outerraduis(ND)
- z : o2
p13 =
- x : o0 + zc
- y : o1 + ElbowRadius(ND) + outerraduis(ND)
- z : o2
Wiki Markup |
---|
o{~}0~ * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) - ConRaduis(2*pipe{~}inr~) * z : o{~}2~ p12 = * x : o{~}0~ \- SocketDepth(2*pipe~inr~) - zc * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) - outerraduis(2*pipe{~}inr~) * z : o{~}2~ p13 = * x : o{~}0~ + zc * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) + outerraduis(2*pipe{~}inr~) * z : o{~}2~ \\ \\ {float:left|border=2px solid black} [!15a15.bmp|width=480px380px!|AutoCAD Elbow Program] [!15b15a.bmp|width=480px380px!|AutoCAD Elbow Program] {float} * |
mirror
...
-
...
replicates
...
the
...
socket
...
drawn
...
onto
...
the
...
opposite
...
end of the elbow by selecting the hollow cylinder using p14, then reflecting it over a mirror line created using p15 and p16 to give the slope and direction of the mirror line.
mirror <-- mirrorA(p14,p15,p16)
...
p14
...
=
...
- x
...
- : o0 - SocketDepth(ND)
- y : o1 + ElbowRadius(ND) - ConRaduis(ND)
- z : o2
p15 =
- x : o0
- y : o1
p16 =
- x : o0 + zc
- y : o1 + zc
Wiki Markup |
---|
o{~}0~ \- SocketDepth(2*pipe~inr~) * y : o{~}1~ + ElbowRadius(2*pipe{~}inr~) - ConRaduis(2*pipe{~}inr~) * 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} [!16a16b.bmp|width=480px380px!|AutoCAD Elbow Program] [!16b16a.bmp|width=480px380px!|AutoCAD Elbow Program] Southwest Isometric View {float} * |
bigunion
...
- unites all the pieces drawn so the elbow will act as one unit, instead of three separate units.
bigunion <-- bigunionelbow(p1,p17,p18,R1,R2)
...
p1
...
= origin
p17 =
- x : o0 + ElbowRadius(ND)
- y : o1 - SocketDepth( ND)
- z : o2
p18 =
- x : o0 - SocketDepth(ND)
- y : o1 + ElbowRadius(ND)
- z : o2
R1 = Radius of curvature of the elbow
R2 = Outer radius of the elbow