<commit_before><html>
<head>

  <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r69/three.js"></script>
  <script src="//js.leapmotion.com/leap-0.6.4.js"></script>
  <script src="//js.leapmotion.com/leap-plugins-0.1.10.min.js"></script>
  <script src="javascript/lib/OrbitControls.js"></script>

  <script src="javascript/lib/three.MeshCorners.js"></script>
  <script src="javascript/lib/three.MeshIntersection.js"></script>

  <script src="javascript/lib/leap.proximity.js"></script>

  <style>
    body {
      margin: 0;
    }
  </style>

</head>
<body>

</body>

<script>

  // Set up plugins

  Leap.loop()
      .use('boneHand', {
        targetEl: document.body,
        opacity: 0.3,
        jointColor: new THREE.Color(0xffffff)
      })
      .use('proximity');


  // Set up scene

  var scene = Leap.loopController.plugins.boneHand.scene;
  var camera = Leap.loopController.plugins.boneHand.camera;

  var plane = new THREE.Mesh(
    new THREE.PlaneGeometry(80,80),
    new THREE.MeshPhongMaterial({wireframe: false})
  );


  plane.scale.set(2,2,2);
  plane.position.set(0,200,-100);

  camera.lookAt( plane.position );

  var lineGeometry = new THREE.Geometry();
  lineGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, -300 ) );

  var line = new THREE.Line(
    lineGeometry,
    new THREE.LineBasicMaterial({ color: 0x0000ff })
  );

  var sphere = new THREE.Mesh(
    new THREE.SphereGeometry(15, 32, 32),
    new THREE.MeshPhongMaterial
  );

  scene.add(plane);
  scene.add(line);
  scene.add(sphere);

  var cornerSpheres = [];
  for (var i = 0; i < 5; i++){
    cornerSpheres[i] = new THREE.Mesh(
      new THREE.SphereGeometry(15, 32, 32),
      new THREE.MeshPhongMaterial
    );

    scene.add(cornerSpheres[i]);
  }

  var axisHelper = new THREE.AxisHelper( 100 );
  scene.add( axisHelper );

  var controls = new THREE.OrbitControls( camera );

  // Set up interactions


  Leap.loopController.on('frame', function(frame){

    if (!frame.hands.length > 0) return;

    for (var i = 0; i < frame.hands.length && i < 2; i++) {

      lineGeometry.vertices[i].fromArray(frame.hands[i].palmPosition);

    }

    lineGeometry.verticesNeedUpdate = true;<commit_msg>Tidy proximity test/example<commit_after><html>
<head>

  <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r69/three.js"></script>
  <script src="//js.leapmotion.com/leap-0.6.4.js"></script>
  <script src="//js.leapmotion.com/leap-plugins-0.1.10.min.js"></script>
  <script src="javascript/lib/OrbitControls.js"></script>

  <script src="javascript/lib/three.MeshCorners.js"></script>
  <script src="javascript/lib/three.MeshIntersection.js"></script>
  <script src="javascript/lib/three.PointOverlap.js"></script>

  <script src="javascript/lib/leap.proximity.js"></script>

  <style>
    body {
      margin: 0;
    }
  </style>

</head>
<body>

<ul>
  <li>Seems to be not leaving the region correctly.</li>
</ul>

</body>

<script>

  // Set up plugins

  Leap.loop()
    .use('boneHand', {
      targetEl: document.body,
      opacity: 0.3,
      jointColor: new THREE.Color(0xffffff)
    })
    .use('proximity');


  // Set up scene

  var scene = Leap.loopController.plugins.boneHand.scene;
  var camera = Leap.loopController.plugins.boneHand.camera;
  camera.position.set( 0, 800, 500 );


  var plane = new THREE.Mesh(
    new THREE.PlaneGeometry(80,80),
    new THREE.MeshPhongMaterial({wireframe: false})
  );


//  plane.scale.set(2,2,2);
  console.log(plane.scale);
  plane.position.set(0,200,-100);

  camera.lookAt( plane.position );

  var lineGeometry = new THREE.Geometry();
  lineGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, -300 ) );

  var line = new THREE.Line(
    lineGeometry,
    new THREE.LineBasicMaterial({ color: 0x0000ff })
  );

  var sphere = new THREE.Mesh(
    new THREE.SphereGeometry(15, 32, 32),
    new THREE.MeshPhongMaterial
  );

  scene.add(plane);
  scene.add(line);
  scene.add(sphere);

  var cornerSpheres = [];
  for (var i = 0; i < 5; i++){
    cornerSpheres[i] = new THREE.Mesh(
      new THREE.SphereGeometry(15, 32, 32),
      new THREE.MeshPhongMaterial
    );

    scene.add(cornerSpheres[i]);
  }

  var axisHelper = new THREE.AxisHelper( 100 );
  scene.add( axisHelper );

  var controls = new THREE.OrbitControls( camera );

  // Set up interactions


  Leap.loopController.on('frame', function(frame){

    if (!frame.hands.length > 0) return;

    var hand = frame.hands[0];
    if (!hand) return;
    lineGeometry.vertices[0].fromArray(hand.indexFinger.tipPosition);
    lineGeometry.vertices[1].fromArray(hand.thumb.tipPosition);

    lineGeometry.verticesNeedUpdate = true;
{'fraction_non_alphanumeric': 0.1615581098339719, 'fraction_numerical': 0.0280970625798212, 'mean_word_length': 3.256340579710145, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1025442', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1627, 'n_words': 314}