kcl-samples → tire →
tire
KCL
// Tire
// A tire is a critical component of a vehicle that provides the necessary traction and grip between the car and the road. It supports the vehicle's weight and absorbs shocks from road irregularities.
// Define constants
const tireInnerDiameter = 482.6 // mm (19 in)
const tireOuterDiameter = 660.4 // mm (26 in)
const tireDepth = 280 // mm
const bendRadius = 40 // mm
const tireTreadWidth = 10 // mm
const tireTreadDepth = 10 // mm
const tireTreadOffset = 80 // mm
// Create the sketch of the tire
const tireSketch = startSketchOn("XY")
|> startProfileAt([tireInnerDiameter / 2, tireDepth / 2], %)
|> lineTo([tireOuterDiameter / 2 - bendRadius, tireDepth / 2], %, $edge1)
|> tangentialArc({
offset: -90,
radius: bendRadius,
}, %)
|> lineTo([tireOuterDiameter / 2, tireDepth/2 - tireTreadOffset], %)
|> line([-tireTreadDepth, 0], %)
|> line([0, -tireTreadWidth], %)
|> line([tireTreadDepth, 0], %)
|> lineTo([tireOuterDiameter / 2, -tireDepth/2 + tireTreadOffset + tireTreadWidth], %)
|> line([-tireTreadDepth, 0], %)
|> line([0, -tireTreadWidth], %)
|> line([tireTreadDepth, 0], %)
|> lineTo([tireOuterDiameter / 2, -tireDepth / 2 + bendRadius], %)
|> tangentialArc({
offset: -90,
radius: bendRadius,
}, %)
|> lineTo([tireInnerDiameter / 2, -tireDepth / 2], %, $edge2)
|> close(%)
// Revolve the sketch to create the tire
const tire = revolve({ axis: "Y" }, tireSketch)