1169 const width = channel.params.width;
1170 const height = channel.params.height;
1171 const flip = layer.params.flip;
1172 var z_offset = layer.params.z_offset;1173 const geom = TwoPointBoxFeature(start, end, width, height, flip, z_offset);
1174 const material = getFeatureMaterial(channel, layer);
1175 const mesh = new THREE.Mesh(geom, material);
1133 const radius2 = circleValve.params.radius2;
1134 const height = circleValve.params.height;
1135 const position = circleValve.params.position;
1136 var z_offset = layer.params.z_offset;1137 const flip = layer.params.flip;
1138 const geom = ConeFeature(position, radius1, radius2, height, flip, z_offset);
1139 const material = getFeatureMaterial(circleValve, layer);
1120 const radius2 = port.params.radius2;
1121 const height = port.params.height;
1122 const position = port.params.position;
1123 var z_offset = layer.params.z_offset;1124 const flip = layer.params.flip;
1125 const geom = ConeFeature(position, radius1, radius2, height, flip, z_offset);
1126 const material = getFeatureMaterial(port, layer);
1107 const radius2 = via.params.radius2;
1108 const height = via.params.height;
1109 const position = via.params.position;
1110 var z_offset = layer.params.z_offset;1111 const flip = layer.params.flip;
1112 const geom = ConeFeature(position, radius1, radius2, height, flip, z_offset);
1113 const material = getFeatureMaterial(via, layer);
766 if (mesh.geometry.morphTargets !== "undefined") {
767 var tempVector = new THREE.Vector4(morphVector.x, morphVector.y, morphVector.z);
768 } else {
769 var tempVector = new THREE.Vector4(vector.x, vector.y, vector.z); 770 }
771 tempVector.multiplyScalar(weights[k]);
772 // the inverse takes the vector into local bone space
The var
keyword is soft-deprecated, and should not be used to redeclare existing variables.
It is possible to re-declare the same variable using the var
keyword:
var a = 1;
var a = 10; // valid!
However, this can have unintentional side effects on the code:
var x = 10;
{
var x = 20;
}
console.log(x); // 20
var db = dbDriver.loadTables()
{
var db = db.get("usersId:1234") // bad practice!
}
// always use 'let' or 'const'
const db = dbDriver.loadTables();
{
const users = db.get("userId:1234") // avoid shadowing
}