MCPcopy Index your code
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / mengerSpongeSplit

Function mengerSpongeSplit

assets/js/block_ninja.js:634–660  ·  view source on GitHub ↗
(o, s)

Source from the content-addressed store, hash-verified

632// o: Vector3D - Position of cube's origin (center).
633// s: Vector3D - Determines size of menger sponge.
634function mengerSpongeSplit(o, s) {
635 return [
636 // Top
637 { x: o.x + s, y: o.y - s, z: o.z + s },
638 { x: o.x + s, y: o.y - s, z: o.z + 0 },
639 { x: o.x + s, y: o.y - s, z: o.z - s },
640 { x: o.x + 0, y: o.y - s, z: o.z + s },
641 { x: o.x + 0, y: o.y - s, z: o.z - s },
642 { x: o.x - s, y: o.y - s, z: o.z + s },
643 { x: o.x - s, y: o.y - s, z: o.z + 0 },
644 { x: o.x - s, y: o.y - s, z: o.z - s },
645 // Bottom
646 { x: o.x + s, y: o.y + s, z: o.z + s },
647 { x: o.x + s, y: o.y + s, z: o.z + 0 },
648 { x: o.x + s, y: o.y + s, z: o.z - s },
649 { x: o.x + 0, y: o.y + s, z: o.z + s },
650 { x: o.x + 0, y: o.y + s, z: o.z - s },
651 { x: o.x - s, y: o.y + s, z: o.z + s },
652 { x: o.x - s, y: o.y + s, z: o.z + 0 },
653 { x: o.x - s, y: o.y + s, z: o.z - s },
654 // Middle
655 { x: o.x + s, y: o.y + 0, z: o.z + s },
656 { x: o.x + s, y: o.y + 0, z: o.z - s },
657 { x: o.x - s, y: o.y + 0, z: o.z + s },
658 { x: o.x - s, y: o.y + 0, z: o.z - s }
659 ];
660}
661
662
663

Callers 1

block_ninja.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected