Files
modeling-app/public/kcl-samples/car-wheel-assembly/car-tire.kcl
Jonathan Tran 319c60d4fa BREAKING: Change tangential arc to keyword args (#6266)
* Change tangentialArc, tangentialArcTo, and tangentialArcToRelative to keyword args

* Change tangentialArc offset to angle and convert to kw arg calls

* Fix lints

* Fix sketch errors and all unit tests passing

* Fix tangentialArcTo calls in KCL samples

* Update tangentialArc in samples

* Update sim test output

* Fix formatting

* Fix mistake in merge

* Fix gear rack sample

* Update output after more samples fixes

* Update gear rack output

* Add end label to docs snippet

* Fix to not add endAbsolute for an arc with radius or angle arguments

* Update docs outputs

* Fix formatting

* Fix executor tests

* Fix formatting

* Fix bench input files

* Fix spelling

* Improve error messages

---------

Co-authored-by: Adam Chalmers <adam.chalmers@zoo.dev>
2025-04-11 14:17:20 -04:00

46 lines
1.5 KiB
Plaintext

// 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.
// Set units
@settings(defaultLengthUnit = in)
// Import parameters
import tireInnerDiameter, tireOuterDiameter, tireDepth, bendRadius, tireTreadWidth, tireTreadDepth, tireTreadOffset from "parameters.kcl"
// Create the sketch of the tire
tireSketch = startSketchOn(XY)
|> startProfileAt([tireInnerDiameter / 2, tireDepth / 2], %)
|> line(
endAbsolute = [
tireOuterDiameter / 2 - bendRadius,
tireDepth / 2
],
tag = $edge1,
)
|> tangentialArc(angle = -90, radius = bendRadius)
|> line(endAbsolute = [
tireOuterDiameter / 2,
tireDepth / 2 - tireTreadOffset
])
|> line(end = [-tireTreadDepth, 0])
|> line(end = [0, -tireTreadWidth])
|> line(end = [tireTreadDepth, 0])
|> line(endAbsolute = [
tireOuterDiameter / 2,
-tireDepth / 2 + tireTreadOffset + tireTreadWidth
])
|> line(end = [-tireTreadDepth, 0])
|> line(end = [0, -tireTreadWidth])
|> line(end = [tireTreadDepth, 0])
|> line(endAbsolute = [
tireOuterDiameter / 2,
-tireDepth / 2 + bendRadius
])
|> tangentialArc(angle = -90, radius = bendRadius)
|> line(endAbsolute = [tireInnerDiameter / 2, -tireDepth / 2], tag = $edge2)
|> close()
// Revolve the sketch to create the tire
revolve(tireSketch, axis = Y)
|> appearance(color = "#0f0f0f", roughness = 80)