2025-03-06 18:01:24 -05:00
// Pipe and Flange Assembly
// A crucial component in various piping systems, designed to facilitate the connection, disconnection, and access to piping for inspection, cleaning, and modifications. This assembly combines pipes (long cylindrical conduits) with flanges (plate-like fittings) to create a secure yet detachable joint.
2025-03-19 23:49:06 -04:00
// set units
2025-03-06 18:01:24 -05:00
@settings(defaultLengthUnit = in)
2025-03-19 23:49:06 -04:00
// import constants
2025-03-26 08:53:34 -07:00
import * from "globals.kcl"
2025-03-19 23:49:06 -04:00
// import parts
2025-03-26 08:53:34 -07:00
import flange from "68095k348-flange.kcl"
import gasket from "9472k188-gasket.kcl"
import washer from "98017a257-washer.kcl"
import bolt from "91251a404-bolt.kcl"
import hexNut from "95479a127-hex-nut.kcl"
import pipe from "1120t74-pipe.kcl"
2025-03-19 23:49:06 -04:00
// place flanges
flange()
flange()
|> rotate(axis = [0, 1, 0], angle = 180)
2025-03-30 10:06:36 -07:00
|> translate(x = 0, y = 0, z = flangeBackHeight * 2 + gasketThickness)
2025-03-19 23:49:06 -04:00
// place gasket between the flanges
gasket()
2025-03-30 10:06:36 -07:00
|> translate(x = 0, y = 0, z = -flangeBackHeight - gasketThickness)
2025-03-19 23:49:06 -04:00
// place eight washers (four front, four back)
washer()
2025-03-30 10:06:36 -07:00
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = flangeBaseThickness)
2025-03-26 08:53:34 -07:00
|> patternCircular3d(
%,
instances = 4,
axis = [0, 0, 1],
center = [0, 0, 0],
arcDegrees = 360,
rotateDuplicates = false,
)
|> patternLinear3d(
%,
instances = 2,
distance = -(flangeBaseThickness * 2 + flangeBackHeight * 2 + gasketThickness + washerThickness),
axis = [0, 0, 1],
)
2025-03-19 23:49:06 -04:00
// place four bolts
bolt()
2025-03-30 10:06:36 -07:00
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = flangeBaseThickness + washerThickness)
2025-03-19 23:49:06 -04:00
|> rotate(roll = 90, pitch = 0, yaw = 0)
2025-03-26 08:53:34 -07:00
|> patternCircular3d(
%,
instances = 4,
axis = [0, 0, 1],
center = [0, 0, 0],
arcDegrees = 360,
rotateDuplicates = false,
)
2025-03-19 23:49:06 -04:00
// place four hex nuts
hexNut()
2025-03-30 10:06:36 -07:00
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = -(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + washerThickness + hexNutThickness))
2025-03-26 08:53:34 -07:00
|> patternCircular3d(
%,
instances = 4,
axis = [0, 0, 1],
center = [0, 0, 0],
arcDegrees = 360,
rotateDuplicates = false,
)
2025-03-19 23:49:06 -04:00
// place both pieces of pipe
pipe()
2025-03-26 08:53:34 -07:00
|> rotate(
%,
roll = -90,
pitch = 0,
yaw = 0,
)
|> translate(
2025-03-30 10:06:36 -07:00
%,
x = 0,
y = 0,
z = flangeBaseThickness + flangeFrontHeight - 0.5,
global = true,
2025-03-26 08:53:34 -07:00
)
2025-03-19 23:49:06 -04:00
pipe()
2025-03-26 08:53:34 -07:00
|> rotate(
%,
roll = 90,
pitch = 0,
yaw = 0,
)
|> translate(
2025-03-30 10:06:36 -07:00
%,
x = 0,
y = 0,
z = -(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + flangeFrontHeight - 0.5),
global = true,
2025-03-26 08:53:34 -07:00
)