MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / STL

Function STL

data/scripts/examples/Heightmap.js:416–431  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

414 }
415
416 function STL() {
417 let src = [];
418 src.push(`solid heightmap`);
419 for (let index of cells) {
420 src.push(`facet normal 0 0 0`);
421 src.push(` outer loop`);
422 for (let i of index) {
423 let [x, y, z] = positions[i];
424 src.push(` vertex ${z * scale.z} ${x * scale.x} ${y * scale.y}`);
425 }
426 src.push(` endloop`);
427 src.push(`endfacet`);
428 }
429 src.push(`endsolid heightmap`);
430 return src.join('\n');
431 }
432
433 app.createDialog('Error').addLabel(path ? `Exported ${path}` : `Could not save ${fileName}`);
434

Callers

nothing calls this directly

Calls 2

joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected