Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.each(json, function (i, row) {
- // Coordenadas X
- var xcoor = row.xcoor;
- if (xcoor.indexOf('=') !== -1)
- xcoor = xcoor.split("=")[1];
- xcoor = xcoor.replace("{", "").replace("}", "");
- var xcoor_array = xcoor.split(',');
- // Coordenadas Y
- var ycoor = row.ycoor;
- if (ycoor.indexOf('=') !== -1)
- ycoor = ycoor.split("=")[1];
- ycoor = ycoor.replace("{", "").replace("}", "");
- var ycoor_array = ycoor.split(',');
- // Coordenadas Z
- var zcoor = row.zcoor;
- if (zcoor.indexOf('=') !== -1)
- zcoor = zcoor.split("=")[1];
- zcoor = zcoor.replace("{", "").replace("}", "");
- var zcoor_array = zcoor.split(',');
- // LANTA - A
- //4 threads and let's aggregate our individual thread results into one final output
- var params = {
- 'array': xcoor_array,
- 'array_y': ycoor_array,
- 'array_z': zcoor_array,
- 'value_llantaB': value_llantaB,
- 'row': row
- };
- hamsters.run(params, function() {
- var arr = params.array;
- var arr_y = params.array_y;
- var arr_z = params.array_z;
- arr.forEach(function(item, index) {
- if (item != "NULL") {
- if (arr_y[index] != "NULL") {
- error = 0;
- is_polygon = true;
- rtn.data.push({
- x: parseFloat(item / 100),
- y: parseFloat(arr_y[index] / 100),
- z: parseFloat(arr_z[index] / 100),
- equipo: params.row.equipo
- });
- }
- }
- });
- }, function(output) {
- output.forEach(function (item) {
- if (isPointInPolygon(polygon, point = {x: item.x, y: item.y})) {
- console.log('x:', item.x, 'y:', item.y, 'inside: ', isPointInPolygon(polygon, point = {x: item.x, y: item.y}));
- lineasCompactacion(item.x, item.y, item.equipo, "A");
- }
- });
- }, 4, true);
- });
- if (arrayPuntosLlantas_A.length > 1) {
- console.log('Get points from Coords');
- obtainPointsFromCoords(arrayPuntosLlantas_A);
- } else {
- console.log('There is no points in array:', arrayPuntosLlantas_A.length)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement