Fix translate scale & better docs (#6053)
* change translate & scale to be better & docs Signed-off-by: Jess Frazelle <github@jessfraz.com> * autocomplete Signed-off-by: Jess Frazelle <github@jessfraz.com> * gen std Signed-off-by: Jess Frazelle <github@jessfraz.com> * kcl-samples Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -12,7 +12,7 @@ import "car-tire.kcl" as carTire
|
||||
import lugCount from "globals.kcl"
|
||||
|
||||
carRotor
|
||||
|> translate(translate = [0, 0.5, 0])
|
||||
|> translate(x = 0, y = 0.5, z = 0)
|
||||
carWheel
|
||||
lugNut
|
||||
|> patternCircular3d(
|
||||
@ -23,5 +23,5 @@ lugNut
|
||||
rotateDuplicates = false,
|
||||
)
|
||||
brakeCaliper
|
||||
|> translate(translate = [0, 0.5, 0])
|
||||
|> translate(x = 0, y = 0.5, z = 0)
|
||||
carTire
|
||||
|
@ -19,27 +19,27 @@ import pipe from "1120t74-pipe.kcl"
|
||||
flange()
|
||||
flange()
|
||||
|> rotate(axis = [0, 1, 0], angle = 180)
|
||||
|> translate(translate = [
|
||||
0,
|
||||
0,
|
||||
flangeBackHeight * 2 + gasketThickness
|
||||
])
|
||||
|> translate(
|
||||
x = 0,
|
||||
y = 0,
|
||||
z = flangeBackHeight * 2 + gasketThickness,
|
||||
)
|
||||
|
||||
// place gasket between the flanges
|
||||
gasket()
|
||||
|> translate(translate = [
|
||||
0,
|
||||
0,
|
||||
-flangeBackHeight - gasketThickness
|
||||
])
|
||||
|> translate(
|
||||
x = 0,
|
||||
y = 0,
|
||||
z = -flangeBackHeight - gasketThickness
|
||||
)
|
||||
|
||||
// place eight washers (four front, four back)
|
||||
washer()
|
||||
|> translate(translate = [
|
||||
mountingHolePlacementDiameter / 2,
|
||||
0,
|
||||
flangeBaseThickness
|
||||
])
|
||||
|> translate(
|
||||
x = mountingHolePlacementDiameter / 2,
|
||||
y = 0,
|
||||
z = flangeBaseThickness
|
||||
)
|
||||
|> patternCircular3d(
|
||||
%,
|
||||
instances = 4,
|
||||
@ -57,11 +57,11 @@ washer()
|
||||
|
||||
// place four bolts
|
||||
bolt()
|
||||
|> translate(translate = [
|
||||
mountingHolePlacementDiameter / 2,
|
||||
0,
|
||||
flangeBaseThickness + washerThickness
|
||||
])
|
||||
|> translate(
|
||||
x = mountingHolePlacementDiameter / 2,
|
||||
y = 0,
|
||||
z = flangeBaseThickness + washerThickness,
|
||||
)
|
||||
|> rotate(roll = 90, pitch = 0, yaw = 0)
|
||||
|> patternCircular3d(
|
||||
%,
|
||||
@ -74,11 +74,11 @@ bolt()
|
||||
|
||||
// place four hex nuts
|
||||
hexNut()
|
||||
|> translate(translate = [
|
||||
mountingHolePlacementDiameter / 2,
|
||||
0,
|
||||
-(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + washerThickness + hexNutThickness)
|
||||
])
|
||||
|> translate(
|
||||
x = mountingHolePlacementDiameter / 2,
|
||||
y = 0,
|
||||
z = -(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + washerThickness + hexNutThickness),
|
||||
)
|
||||
|> patternCircular3d(
|
||||
%,
|
||||
instances = 4,
|
||||
@ -97,13 +97,11 @@ pipe()
|
||||
yaw = 0,
|
||||
)
|
||||
|> translate(
|
||||
%,
|
||||
translate = [
|
||||
0,
|
||||
0,
|
||||
flangeBaseThickness + flangeFrontHeight - 0.5
|
||||
],
|
||||
global = true,
|
||||
%,
|
||||
x = 0,
|
||||
y = 0,
|
||||
z = flangeBaseThickness + flangeFrontHeight - 0.5,
|
||||
global = true,
|
||||
)
|
||||
|
||||
pipe()
|
||||
@ -114,11 +112,9 @@ pipe()
|
||||
yaw = 0,
|
||||
)
|
||||
|> translate(
|
||||
%,
|
||||
translate = [
|
||||
0,
|
||||
0,
|
||||
-(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + flangeFrontHeight - 0.5)
|
||||
],
|
||||
global = true,
|
||||
%,
|
||||
x = 0,
|
||||
y = 0,
|
||||
z = -(flangeBackHeight * 2 + gasketThickness + flangeBaseThickness + flangeFrontHeight - 0.5),
|
||||
global = true,
|
||||
)
|
||||
|
@ -20,51 +20,36 @@ body()
|
||||
|
||||
// import the antenna
|
||||
antenna()
|
||||
|> translate(translate = [-width / 2 + .45, -0.10, height / 2])
|
||||
|> translate(x = -width / 2 + .45, y = -0.10, z = height / 2)
|
||||
|
||||
// import the case
|
||||
case()
|
||||
|> translate(translate = [0, -1, 0])
|
||||
|> translate(x = 0, y = -1, z = 0)
|
||||
|
||||
// import the talk button
|
||||
talkButton()
|
||||
|> translate(translate = [width / 2, -thickness / 2, .5])
|
||||
|> translate(x = width / 2, y = -thickness / 2, z = .5)
|
||||
|
||||
// import the frequency knob
|
||||
knob()
|
||||
|> translate(translate = [
|
||||
width / 2 - 0.70,
|
||||
-thickness / 2,
|
||||
height / 2
|
||||
])
|
||||
|> translate(
|
||||
x = width / 2 - 0.70,
|
||||
y = -thickness / 2,
|
||||
z = height / 2
|
||||
)
|
||||
|
||||
// import the buttons
|
||||
button()
|
||||
|> translate(translate = [
|
||||
-(screenWidth / 2 + tolerance),
|
||||
-1,
|
||||
screenYPosition
|
||||
])
|
||||
button()
|
||||
|> translate(translate = [
|
||||
-(screenWidth / 2 + tolerance),
|
||||
-1,
|
||||
screenYPosition - buttonHeight - (tolerance * 2)
|
||||
])
|
||||
button()
|
||||
|> rotate(
|
||||
%,
|
||||
roll = 0,
|
||||
pitch = 180,
|
||||
yaw = 0,
|
||||
)
|
||||
|> translate(
|
||||
translate = [
|
||||
screenWidth / 2 + tolerance,
|
||||
-1,
|
||||
screenYPosition - buttonHeight
|
||||
],
|
||||
global = true,
|
||||
x = -(screenWidth / 2 + tolerance),
|
||||
y = -1,
|
||||
z = screenYPosition
|
||||
)
|
||||
button()
|
||||
|> translate(
|
||||
x = -(screenWidth / 2 + tolerance),
|
||||
y = -1,
|
||||
z = screenYPosition - buttonHeight - (tolerance * 2)
|
||||
)
|
||||
button()
|
||||
|> rotate(
|
||||
@ -74,10 +59,21 @@ button()
|
||||
yaw = 0,
|
||||
)
|
||||
|> translate(
|
||||
translate = [
|
||||
screenWidth / 2 + tolerance,
|
||||
-1,
|
||||
screenYPosition - (buttonHeight * 2) - (tolerance * 2)
|
||||
],
|
||||
x = screenWidth / 2 + tolerance,
|
||||
y = -1,
|
||||
z = screenYPosition - buttonHeight,
|
||||
global = true,
|
||||
)
|
||||
button()
|
||||
|> rotate(
|
||||
%,
|
||||
roll = 0,
|
||||
pitch = 180,
|
||||
yaw = 0,
|
||||
)
|
||||
|> translate(
|
||||
x = screenWidth / 2 + tolerance,
|
||||
y = -1,
|
||||
z = screenYPosition - (buttonHeight * 2) - (tolerance * 2),
|
||||
global = true,
|
||||
)
|
||||
|
Reference in New Issue
Block a user