point and clickify flange assembly

This commit is contained in:
Kurt Hutten Irev-Dev
2025-05-30 17:24:57 +10:00
parent 80e3dc9095
commit ab966423ac
6 changed files with 98 additions and 121 deletions

View File

@ -7,17 +7,13 @@
// Import parameters
import pipeInnerDiameter, pipeOuterDiameter, pipeLength from "parameters.kcl"
// Create a function to make the pipe. Export
export fn pipe() {
// Create the pipe base
pipeBase = startSketchOn(XZ)
|> circle(%, center = [0, 0], radius = pipeOuterDiameter / 2)
|> extrude(%, length = pipeLength)
// Extrude a hole through the length of the pipe
pipe = startSketchOn(pipeBase, face = END)
startSketchOn(pipeBase, face = END)
|> circle(center = [0, 0], radius = pipeInnerDiameter / 2)
|> extrude(%, length = -pipeLength)
|> appearance(color = "#a24ed0")
return pipe
}

View File

@ -7,8 +7,6 @@
// Import parameters
import pipeDiameter, mountingHoleDiameter, mountingHolePlacementDiameter, flangeDiameter, flangeTotalThickness, flangeBackHeight, flangeFrontHeight, flangeBaseThickness, flangeBackDiameter, flangeFrontDiameter from "parameters.kcl"
// Create a function to create the flange. We must create a function since we are using multiple flanges.
export fn flange() {
// Sketch the mounting hole pattern
mountingHoles = startSketchOn(XY)
|> circle(%, center = [0, mountingHolePlacementDiameter / 2], radius = mountingHoleDiameter / 2)
@ -35,10 +33,7 @@ export fn flange() {
|> extrude(%, length = flangeFrontHeight)
// Create the circular cut in the center for the pipe
pipeCut = startSketchOn(flangeFront, face = END)
startSketchOn(flangeFront, face = END)
|> circle(%, center = [0, 0], radius = pipeDiameter / 2)
|> extrude(%, length = -flangeTotalThickness)
|> appearance(%, color = "#bab0b0")
return pipeCut
}

View File

@ -7,8 +7,6 @@
// Import parameters
import boltDiameter, boltLength, boltHeadLength, boltHeadDiameter, boltHexDrive, boltHexFlatLength, boltThreadLength from "parameters.kcl"
// Create a function to make a the bolt
export fn bolt() {
// Create the head of the cap screw
boltHead = startSketchOn(XZ)
|> circle(center = [0, 0], radius = boltHeadDiameter / 2, tag = $topEdge)
@ -30,10 +28,7 @@ export fn bolt() {
|> extrude(length = -boltHeadLength * 0.75)
// create the body of the bolt
boltBody = startSketchOn(boltHead, face = END)
startSketchOn(boltHead, face = END)
|> circle(center = [0, 0], radius = boltDiameter / 2, tag = $filletEdge)
|> extrude(length = boltLength)
|> appearance(color = "#4dd043", metalness = 90, roughness = 90)
return boltBody
}

View File

@ -7,8 +7,6 @@
// Import parameters
import hexNutDiameter, hexNutFlatToFlat, hexNutThickness, hexNutFlatLength from "parameters.kcl"
// Create a function to make the hex nut. Must be a function since multiple hex nuts are used
export fn hexNut() {
// Create the base of the hex nut
hexNutBase = startSketchOn(XY)
|> startProfile(at = [
@ -24,10 +22,7 @@ export fn hexNut() {
|> extrude(length = hexNutThickness)
// Create the hole in the center of the hex nut
hexNut = startSketchOn(hexNutBase, face = END)
startSketchOn(hexNutBase, face = END)
|> circle(center = [0, 0], radius = hexNutDiameter / 2)
|> extrude(%, length = -hexNutThickness)
|> appearance(%, color = "#4edfd5")
return hexNut
}

View File

@ -7,8 +7,6 @@
// Import parameters
import washerInnerDia, washerOuterDia, washerThickness from "parameters.kcl"
// Create a function to make the washer. Must be a function since multiple washers are used.
export fn washer() {
// Create the base of the washer
washerBase = startSketchOn(XY)
|> circle(center = [0, 0], radius = washerOuterDia / 2)
@ -20,5 +18,3 @@ export fn washer() {
|> extrude(%, length = -washerThickness)
|> appearance(%, color = "#ee4f4f")
return washer
}

View File

@ -9,16 +9,19 @@ import * from "parameters.kcl"
// Import parts
import "9472k188-gasket.kcl" as gasket
import flange from "68095k348-flange.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"
import "68095k348-flange.kcl" as flange
import "98017a257-washer.kcl" as washer
import "91251a404-bolt.kcl" as bolt
import "95479a127-hex-nut.kcl" as hexNut
import "1120t74-pipe.kcl" as pipe
// Place flanges
flange()
flange()
|> rotate(axis = [0, 1, 0], angle = 180)
// Place flange clone
rotate(
clone(flange),
roll = 180,
pitch = 0,
yaw = 0,
)
|> translate(x = 0, y = 0, z = flangeBackHeight * 2 + gasketThickness)
// Place gasket between the flanges
@ -26,7 +29,7 @@ gasket
|> translate(x = 0, y = 0, z = -flangeBackHeight - gasketThickness)
// Place eight washers (four front, four back)
washer()
washer
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = flangeBaseThickness)
|> patternCircular3d(
%,
@ -44,7 +47,8 @@ washer()
)
// Place four bolts
bolt()
bolt
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = flangeBaseThickness + washerThickness)
|> rotate(roll = 90, pitch = 0, yaw = 0)
|> patternCircular3d(
@ -57,7 +61,7 @@ bolt()
)
// Place four hex nuts
hexNut()
hexNut
|> translate(x = mountingHolePlacementDiameter / 2, y = 0, z = -(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + washerThickness + hexNutThickness))
|> patternCircular3d(
%,
@ -69,9 +73,8 @@ hexNut()
)
// Place both pieces of pipe
pipe()
|> rotate(
%,
rotate(
pipe,
roll = -90,
pitch = 0,
yaw = 0,
@ -83,16 +86,13 @@ pipe()
z = flangeBaseThickness + flangeFrontHeight - 0.5,
global = true,
)
pipe()
|> rotate(
%,
roll = 90,
rotate(
clone(pipe),
roll = 180,
pitch = 0,
yaw = 0,
)
|> translate(
%,
x = 0,
y = 0,
z = -(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + flangeFrontHeight - 0.5),