Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
roryaronson committed Nov 23, 2024
1 parent fadde4d commit 82c7da3
Showing 1 changed file with 119 additions and 115 deletions.
234 changes: 119 additions & 115 deletions frontend/three_d_garden/bot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -579,55 +579,57 @@ export const Bot = (props: FarmbotModelProps) => {
]}
rotation={[Math.PI / 2, 0, 0]} />
<Group name={"ccVertical"}>
{config.kitVersion === "v1.7" ? (
range((zAxisLength - 350) / 200).map((i) => (
<Mesh key={i}
{config.kitVersion == "v1.7"
? (
range((zAxisLength - 350) / 200).map((i) => (
<Mesh key={i}
position={[
threeSpace(x + 20, bedLengthOuter) + bedXOffset,
threeSpace(y + 55, bedWidthOuter) + bedYOffset,
zZero + zDir * z + i * 200 + 125,
]}
rotation={[0, 0, Math.PI / 2]}
scale={1000}
geometry={ccVertical.nodes[PartName.ccVertical].geometry}>
<MeshPhongMaterial color={"silver"} />
</Mesh>
))
)
: (
<Mesh
position={[
threeSpace(x + 20, bedLengthOuter) + bedXOffset,
threeSpace(y + 55, bedWidthOuter) + bedYOffset,
zZero + zDir * z + i * 200 + 125,
threeSpace(y + 35, bedWidthOuter) + bedYOffset,
zZero + zDir * z + 125,
]}
rotation={[0, 0, Math.PI / 2]}
scale={1000}
geometry={ccVertical.nodes[PartName.ccVertical].geometry}>
<MeshPhongMaterial color={"silver"} />
rotation={[0, 0, 0]}
geometry={new THREE.ExtrudeGeometry(
(() => {
const shape = new THREE.Shape();
shape.moveTo(0, 0);
shape.lineTo(0, 20);
shape.lineTo(15, 20);
shape.lineTo(20, 1.5);
shape.lineTo(28.5, 1.5);
shape.lineTo(28.5, -61);
shape.lineTo(24, -63);
shape.lineTo(24, -61.5);
shape.lineTo(27, -60);
shape.lineTo(27, 0);
shape.lineTo(0, 0);
return shape;
})(),
{
depth: zAxisLength - 350,
bevelEnabled: false,
},
)}
>
<MeshPhongMaterial color={"white"}
opacity={0.8}
transparent={true} />
</Mesh>
))
) : (
<Mesh
position={[
threeSpace(x + 20, bedLengthOuter) + bedXOffset,
threeSpace(y + 35, bedWidthOuter) + bedYOffset,
zZero + zDir * z + 125,
]}
rotation={[0, 0, 0]}
geometry={new THREE.ExtrudeGeometry(
(() => {
const shape = new THREE.Shape();
shape.moveTo(0, 0);
shape.lineTo(0, 20);
shape.lineTo(15, 20);
shape.lineTo(20, 1.5);
shape.lineTo(28.5, 1.5);
shape.lineTo(28.5, -61);
shape.lineTo(24, -63);
shape.lineTo(24, -61.5);
shape.lineTo(27, -60);
shape.lineTo(27, 0);
shape.lineTo(0, 0);
return shape;
})(),
{
depth: zAxisLength - 350,
bevelEnabled: false,
}
)}
>
<MeshPhongMaterial color={"white"}
opacity={0.8}
transparent={true} />
</Mesh>
)}
)}
</Group>
<Extrude name={"zCC"} visible={cableCarriers}
castShadow={true}
Expand Down Expand Up @@ -688,15 +690,15 @@ export const Bot = (props: FarmbotModelProps) => {
[0, 0, -200],
config.kitVersion == "v1.7"
? [
threeSpace(x + 80, bedLengthOuter) + bedXOffset,
threeSpace(y + 100, bedWidthOuter) + bedYOffset,
zZero + zDir * z + 245,
]
threeSpace(x + 80, bedLengthOuter) + bedXOffset,
threeSpace(y + 100, bedWidthOuter) + bedYOffset,
zZero + zDir * z + 245,
]
: [
threeSpace(x + 35, bedLengthOuter) + bedXOffset,
threeSpace(y, bedWidthOuter) + bedYOffset,
zZero + zDir * z + 245,
],
threeSpace(x + 35, bedLengthOuter) + bedXOffset,
threeSpace(y, bedWidthOuter) + bedYOffset,
zZero + zDir * z + 245,
],
), 20, 5, 8]}>
<MeshPhongMaterial
color={"white"}
Expand All @@ -714,15 +716,15 @@ export const Bot = (props: FarmbotModelProps) => {
position={
config.kitVersion == "v1.7"
? [
threeSpace(x + 12, bedLengthOuter) + bedXOffset,
threeSpace(y + 55, bedWidthOuter) + bedYOffset,
zZero + zDir * z + 490,
]
threeSpace(x + 12, bedLengthOuter) + bedXOffset,
threeSpace(y + 55, bedWidthOuter) + bedYOffset,
zZero + zDir * z + 490,
]
: [
threeSpace(x + 2, bedLengthOuter) + bedXOffset,
threeSpace(y + 110, bedWidthOuter) + bedYOffset,
zZero + columnLength + 25,
]
threeSpace(x + 2, bedLengthOuter) + bedXOffset,
threeSpace(y + 110, bedWidthOuter) + bedYOffset,
zZero + columnLength + 25,
]
} />
<Group name={"camera"}
rotation={[Math.PI, 0, 0]}
Expand Down Expand Up @@ -801,60 +803,62 @@ export const Bot = (props: FarmbotModelProps) => {
<MeshPhongMaterial color={"white"} map={aluminumTexture} side={DoubleSide} />
</Extrude>
<Group name={"ccHorizontal"}>
{config.kitVersion === "v1.7" ? (
range((botSizeY - 10) / 300).map((i) => (
<Mesh key={i}
{config.kitVersion == "v1.7"
? (
range((botSizeY - 10) / 300).map((i) => (
<Mesh key={i}
position={[
threeSpace(x - 28, bedLengthOuter) + bedXOffset,
threeSpace(50 + i * 300, bedWidthOuter) + bedYOffset,
columnLength + 60,
]}
rotation={[Math.PI / 2, 0, 0]}
scale={1000}
geometry={ccHorizontal.nodes[PartName.ccHorizontal].geometry}>
<MeshPhongMaterial color={"silver"} />
</Mesh>
))
)
: (
<Mesh
position={[
threeSpace(x - 28, bedLengthOuter) + bedXOffset,
threeSpace(50 + i * 300, bedWidthOuter) + bedYOffset,
-(threeSpace(20, bedWidthOuter) + bedYOffset),
columnLength + 60,
]}
rotation={[Math.PI / 2, 0, 0]}
scale={1000}
geometry={ccHorizontal.nodes[PartName.ccHorizontal].geometry}>
<MeshPhongMaterial color={"silver"} />
</Mesh>
))
) : (
<Mesh
position={[
threeSpace(x - 28, bedLengthOuter) + bedXOffset,
-(threeSpace(20, bedWidthOuter) + bedYOffset),
columnLength + 60,
]}
rotation={[Math.PI / 2, 0, 0]}
geometry={new THREE.ExtrudeGeometry(
(() => {
const shape = new THREE.Shape();
geometry={new THREE.ExtrudeGeometry(
(() => {
const shape = new THREE.Shape();

shape.moveTo(0, 0);
shape.lineTo(0, 20);
shape.lineTo(-40, 20);
shape.lineTo(-41, 22.5);
shape.lineTo(-42.5, 22.5);
shape.lineTo(-41.5, 18.5);
shape.lineTo(-30, 18.5);
shape.lineTo(-25, 0);
shape.lineTo(0, 0);
return shape;
})(),
{
depth: botSizeY - 30,
bevelEnabled: false,
}
)}
>
<MeshPhongMaterial color={"white"}
opacity={0.8}
transparent={true} />
</Mesh>
)}
shape.moveTo(0, 0);
shape.lineTo(0, 20);
shape.lineTo(-40, 20);
shape.lineTo(-41, 22.5);
shape.lineTo(-42.5, 22.5);
shape.lineTo(-41.5, 18.5);
shape.lineTo(-30, 18.5);
shape.lineTo(-25, 0);
shape.lineTo(0, 0);
return shape;
})(),
{
depth: botSizeY - 30,
bevelEnabled: false,
},
)}
>
<MeshPhongMaterial color={"white"}
opacity={0.8}
transparent={true} />
</Mesh>
)}
</Group>
<Extrude name={"yCC"} visible={cableCarriers}
castShadow={true}
args={[
ccPath(botSizeY, y + 40, 70),
{ steps: 1, depth: config.kitVersion === "v1.7" ? 60 : 40, bevelEnabled: false },
{ steps: 1, depth: config.kitVersion == "v1.7" ? 60 : 40, bevelEnabled: false },
]}
position={[
threeSpace(x - 28, bedLengthOuter) + bedXOffset,
Expand Down Expand Up @@ -934,19 +938,19 @@ export const Bot = (props: FarmbotModelProps) => {
<Group name={"buttons"}
position={[0, 0, 130]}>
{(
config.kitVersion === "v1.7"
config.kitVersion == "v1.7"
? [
{ position: -60, color: IColor.estop.on },
{ position: -30, color: IColor.unlock.on },
{ position: 0, color: IColor.blank.on },
{ position: 30, color: IColor.blank.on },
{ position: 60, color: IColor.blank.on },
]
{ position: -60, color: IColor.estop.on },
{ position: -30, color: IColor.unlock.on },
{ position: 0, color: IColor.blank.on },
{ position: 30, color: IColor.blank.on },
{ position: 60, color: IColor.blank.on },
]
: [
{ position: -30, color: IColor.estop.on },
{ position: 0, color: IColor.unlock.on },
{ position: 30, color: IColor.blank.on },
]
{ position: -30, color: IColor.estop.on },
{ position: 0, color: IColor.unlock.on },
{ position: 30, color: IColor.blank.on },
]
).map(button => {
const { position, color } = button;
const btnPosition = position;
Expand Down

0 comments on commit 82c7da3

Please sign in to comment.