MCPcopy
hub / github.com/evanw/csg.js / vertex

Function vertex

csg.js:217–226  ·  view source on GitHub ↗
(theta, phi)

Source from the content-addressed store, hash-verified

215 var stacks = options.stacks || 8;
216 var polygons = [], vertices;
217 function vertex(theta, phi) {
218 theta *= Math.PI * 2;
219 phi *= Math.PI;
220 var dir = new CSG.Vector(
221 Math.cos(theta) * Math.sin(phi),
222 Math.cos(phi),
223 Math.sin(theta) * Math.sin(phi)
224 );
225 vertices.push(new CSG.Vertex(c.plus(dir.times(r)), dir));
226 }
227 for (var i = 0; i < slices; i++) {
228 for (var j = 0; j < stacks; j++) {
229 vertices = [];

Callers 1

csg.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected