Files
modeling-app/public/kcl-samples/car-wheel-assembly/main.kcl
2025-06-24 16:01:36 -04:00

51 lines
1.0 KiB
Plaintext

// Car Wheel Assembly
// A car wheel assembly with a rotor, tire, and lug nuts.
// Set units
@settings(defaultLengthUnit = in, kclVersion = 1.0)
// Import parts
import "car-wheel.kcl" as carWheel
import "car-rotor.kcl" as carRotor
import "brake-caliper.kcl" as brakeCaliper
import "lug-nut.kcl" as lugNut
import "car-tire.kcl" as carTire
// Import parameters
import * from "parameters.kcl"
// Place the car rotor
rotor = carRotor
|> translate(x = 0, y = 0.5, z = 0)
// Place the car wheel
carWheel
// Place the lug nuts
lgnut = lugNut
|> patternCircular3d(
arcDegrees = 360,
axis = [0, 1, 0],
center = [0, 0, 0],
instances = lugCount,
rotateDuplicates = false,
)
// Place the brake caliper
cal = brakeCaliper
|> translate(x = 0, y = 0.5, z = 0)
// Place the car tire
carTire
fn animate(step: number(_)) {
angle = 0.6deg
rotate(rotor, pitch = angle)
rotate(lgnut, pitch = angle)
rotate(cal, pitch = angle)
rotate(carWheel, pitch = angle)
rotate(carTire, pitch = angle)
return 0
}