2022-11-06 01:33:32 +01:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
value: true
|
|
|
|
});
|
2024-02-09 11:34:23 +01:00
|
|
|
exports.process = exports["default"] = exports.TYPE = void 0;
|
2022-11-06 01:33:32 +01:00
|
|
|
var TYPE = 'VERTEX';
|
|
|
|
exports.TYPE = TYPE;
|
2024-02-09 11:34:23 +01:00
|
|
|
var ensureFaces = function ensureFaces(entity) {
|
|
|
|
entity.faces = entity.faces || [];
|
|
|
|
if ('x' in entity && !entity.x) delete entity.x;
|
|
|
|
if ('y' in entity && !entity.y) delete entity.y;
|
|
|
|
if ('z' in entity && !entity.z) delete entity.z;
|
|
|
|
};
|
2022-11-06 01:33:32 +01:00
|
|
|
var process = function process(tuples) {
|
|
|
|
return tuples.reduce(function (entity, tuple) {
|
|
|
|
var type = tuple[0];
|
|
|
|
var value = tuple[1];
|
|
|
|
switch (type) {
|
|
|
|
case 10:
|
|
|
|
entity.x = value;
|
|
|
|
break;
|
|
|
|
case 20:
|
|
|
|
entity.y = value;
|
|
|
|
break;
|
|
|
|
case 30:
|
|
|
|
entity.z = value;
|
|
|
|
break;
|
|
|
|
case 42:
|
|
|
|
entity.bulge = value;
|
|
|
|
break;
|
2024-02-09 11:34:23 +01:00
|
|
|
case 71:
|
|
|
|
ensureFaces(entity);
|
|
|
|
entity.faces[0] = value;
|
|
|
|
break;
|
|
|
|
case 72:
|
|
|
|
ensureFaces(entity);
|
|
|
|
entity.faces[1] = value;
|
|
|
|
break;
|
|
|
|
case 73:
|
|
|
|
ensureFaces(entity);
|
|
|
|
entity.faces[2] = value;
|
|
|
|
break;
|
|
|
|
case 74:
|
|
|
|
ensureFaces(entity);
|
|
|
|
entity.faces[3] = value;
|
|
|
|
break;
|
2022-11-06 01:33:32 +01:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return entity;
|
|
|
|
}, {});
|
|
|
|
};
|
|
|
|
exports.process = process;
|
|
|
|
var _default = {
|
|
|
|
TYPE: TYPE,
|
|
|
|
process: process
|
|
|
|
};
|
|
|
|
exports["default"] = _default;
|