Skip to content

Commit 0814d6f

Browse files
Adding pipe and tube manifold samples (#9115)
* Adding pipe and tube manifold samples * Update public/kcl-samples/tube-manifold/main.kcl ok fine Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
1 parent 8ca039b commit 0814d6f

22 files changed

+15924
-0
lines changed

public/kcl-samples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ When you submit a PR to add or modify KCL samples, images will be generated and
171171
[![pipe](screenshots/pipe.png)](pipe/main.kcl)
172172
#### [pipe-flange-assembly](pipe-flange-assembly/main.kcl) ([screenshot](screenshots/pipe-flange-assembly.png))
173173
[![pipe-flange-assembly](screenshots/pipe-flange-assembly.png)](pipe-flange-assembly/main.kcl)
174+
#### [pipe-manifold](pipe-manifold/main.kcl) ([screenshot](screenshots/pipe-manifold.png))
175+
[![pipe-manifold](screenshots/pipe-manifold.png)](pipe-manifold/main.kcl)
174176
#### [pipe-with-bend](pipe-with-bend/main.kcl) ([screenshot](screenshots/pipe-with-bend.png))
175177
[![pipe-with-bend](screenshots/pipe-with-bend.png)](pipe-with-bend/main.kcl)
176178
#### [poopy-shoe](poopy-shoe/main.kcl) ([screenshot](screenshots/poopy-shoe.png))
@@ -263,6 +265,8 @@ When you submit a PR to add or modify KCL samples, images will be generated and
263265
[![torus](screenshots/torus.png)](torus/main.kcl)
264266
#### [truss-structure](truss-structure/main.kcl) ([screenshot](screenshots/truss-structure.png))
265267
[![truss-structure](screenshots/truss-structure.png)](truss-structure/main.kcl)
268+
#### [tube-manifold](tube-manifold/main.kcl) ([screenshot](screenshots/tube-manifold.png))
269+
[![tube-manifold](screenshots/tube-manifold.png)](tube-manifold/main.kcl)
266270
#### [utility-sink](utility-sink/main.kcl) ([screenshot](screenshots/utility-sink.png))
267271
[![utility-sink](screenshots/utility-sink.png)](utility-sink/main.kcl)
268272
#### [v-block](v-block/main.kcl) ([screenshot](screenshots/v-block.png))

public/kcl-samples/manifest.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,16 @@
777777
"parameters.kcl"
778778
]
779779
},
780+
{
781+
"file": "main.kcl",
782+
"pathFromProjectDirectoryToFirstFile": "pipe-manifold/main.kcl",
783+
"multipleFiles": false,
784+
"title": "Pipe manifold",
785+
"description": "A manifold is a type of fitting that can be used to split or merge fluid flow in a system. Each port provides an attachment point for a threaded pipe fitting",
786+
"files": [
787+
"main.kcl"
788+
]
789+
},
780790
{
781791
"file": "main.kcl",
782792
"pathFromProjectDirectoryToFirstFile": "pipe-with-bend/main.kcl",
@@ -1237,6 +1247,16 @@
12371247
"main.kcl"
12381248
]
12391249
},
1250+
{
1251+
"file": "main.kcl",
1252+
"pathFromProjectDirectoryToFirstFile": "tube-manifold/main.kcl",
1253+
"multipleFiles": false,
1254+
"title": "Tube manifold",
1255+
"description": "A manifold is a type of fitting that can be used to split or merge fluid flow in a system. Clamped tubes are typically refered to by their inner diameters, so the fittings are parameterized by their outer diameters",
1256+
"files": [
1257+
"main.kcl"
1258+
]
1259+
},
12401260
{
12411261
"file": "main.kcl",
12421262
"pathFromProjectDirectoryToFirstFile": "utility-sink/main.kcl",
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Pipe manifold
2+
// A manifold is a type of fitting that can be used to split or merge fluid flow in a system. Each port provides an attachment point for a threaded pipe fitting
3+
4+
// Set units
5+
@settings(defaultLengthUnit = mm, experimentalFeatures = allow)
6+
7+
// Define parameters
8+
bodyWidth = 35
9+
inletDiameter = 12
10+
outletDiameter = 9
11+
outletSpacing = 25
12+
mountingHoleDiameter = 4.5
13+
14+
// Create the manifold body. Chamfer all edges
15+
body = startSketchOn(YZ)
16+
|> startProfile(at = [-bodyWidth / 2, -bodyWidth / 2])
17+
|> angledLine(angle = 0deg, length = bodyWidth, tag = $rectangleSegmentA001)
18+
|> angledLine(angle = segAng(rectangleSegmentA001) + 90deg, length = bodyWidth, tag = $seg03)
19+
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $seg01)
20+
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
21+
|> close()
22+
|> extrude(length = outletSpacing * 4, symmetric = true)
23+
|> chamfer(
24+
tags = [
25+
getCommonEdge(faces = [seg01, seg02]),
26+
getCommonEdge(faces = [seg03, seg01]),
27+
getCommonEdge(faces = [rectangleSegmentA001, seg02]),
28+
getCommonEdge(faces = [rectangleSegmentA001, seg03])
29+
],
30+
length = bodyWidth / 10,
31+
)
32+
// Create the inlet hole on the far side of the manifold
33+
inlet = hole::hole(
34+
body,
35+
face = END,
36+
cutAt = [0, 0],
37+
holeBottom = hole::flat(),
38+
holeBody = hole::blind(depth = outletSpacing * 3.9, diameter = inletDiameter),
39+
holeType = hole::simple(),
40+
)
41+
42+
// Place four outlet holes along the top of the manifold
43+
outlets = hole::holes(
44+
inlet,
45+
face = seg01,
46+
cutsAt = [
47+
[-outletSpacing / 2, 0],
48+
[outletSpacing / 2, 0],
49+
[outletSpacing * 1.5, 0],
50+
[-outletSpacing * 1.5, 0]
51+
],
52+
holeBottom = hole::flat(),
53+
holeBody = hole::blind(depth = bodyWidth / 2, diameter = outletDiameter),
54+
holeType = hole::simple(),
55+
)
56+
57+
// Create two diagonal spaced mounting thru holes on the side of the manifold
58+
mountingHoles = hole::holes(
59+
outlets,
60+
face = seg02,
61+
cutsAt = [
62+
[-bodyWidth / 4, -outletSpacing],
63+
[bodyWidth / 4, outletSpacing]
64+
],
65+
holeBottom = hole::flat(),
66+
holeBody = hole::blind(depth = bodyWidth * 1.1, diameter = mountingHoleDiameter),
67+
holeType = hole::simple(),
68+
)
69.3 KB
Loading
98.7 KB
Loading
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Tube manifold
2+
// A manifold is a type of fitting that can be used to split or merge fluid flow in a system. Clamped tubes are typically refered to by their inner diameters, so the fittings are parameterized by their outer diameters
3+
4+
// Set units
5+
@settings(defaultLengthUnit = in)
6+
7+
// Define parameters
8+
bodyDiameter = 5.8
9+
portDiameter = 2.8
10+
portCount = 4
11+
portSpacing = 5
12+
portHeight = 6
13+
wallThickness = 0.2
14+
beadDepth = 1
15+
beadRadius = 0.2
16+
17+
// Model the interior hole of the manifold ports
18+
hollowPort = startSketchOn(XY)
19+
|> circle(center = [0, 0], diameter = portDiameter - (2 * wallThickness))
20+
|> extrude(length = portHeight)
21+
22+
// Create the main body of the manifold and revolve
23+
body = startSketchOn(XY)
24+
|> startProfile(at = [portHeight, bodyDiameter / 2])
25+
|> xLine(length = -beadDepth)
26+
27+
// Add an SAE J1231 type 2 bead to seal a clamped tube connection
28+
|> arc(angleStart = 0deg, angleEnd = 180deg, radius = beadRadius)
29+
|> xLine(endAbsolute = -portCount * portSpacing)
30+
|> tangentialArc(angle = 90deg, radius = lastSegY())
31+
|> xLine(length = wallThickness)
32+
|> arc(angleStart = 180deg, angleEnd = 90deg, radius = bodyDiameter / 2 - wallThickness)
33+
|> xLine(endAbsolute = profileStartX())
34+
|> yLine(endAbsolute = profileStartY())
35+
|> close()
36+
|> revolve(axis = X)
37+
38+
// subtract an instance of the hollow port feature at each port location
39+
|> subtract(tools = clone(hollowPort)
40+
|> patternLinear3d(instances = portCount, distance = portSpacing, axis = [-1, 0, 0]))
41+
42+
// Trim the bottom of the ports so that they fit against the curved main body
43+
bodyCut = startSketchOn(YZ)
44+
|> circle(center = [0, 0], diameter = bodyDiameter)
45+
|> extrude(length = -portCount * portSpacing, bidirectionalLength = 5)
46+
47+
// Model a revolved port at each location. Each should have a single beaded connection
48+
ports = startSketchOn(YZ)
49+
|> startProfile(at = [0, portHeight])
50+
|> xLine(length = portDiameter / 2)
51+
|> yLine(length = -beadDepth)
52+
|> arc(angleStart = 90deg, angleEnd = -90deg, radius = beadRadius)
53+
|> yLine(endAbsolute = 0)
54+
|> xLine(endAbsolute = profileStartX())
55+
|> yLine(endAbsolute = profileStartY())
56+
|> close()
57+
|> revolve(axis = Y)
58+
|> subtract(tools = bodyCut)
59+
|> subtract(tools = hollowPort)
60+
|> patternLinear3d(instances = portCount, distance = portSpacing, axis = [-1, 0, 0])

0 commit comments

Comments
 (0)