build/module/lib/geometries/HollowCylinderGeometry.js
/**
 * Generates a Primitive from the specified options.
 * @hidden
 */
Generates a Primitive from the specified options.
@hidden
Generates a Primitive from the specified options . @hidden
function hollowCylinderPrimitive(options) {
    if (options === void 0) { options = { kind: 'HollowCylinderGeometry' }; }
    var axis = (typeof options.axis === 'object') ? Vector3.copy(options.axis) : e2;
    var meridian = (typeof options.meridian === 'object') ? Vector3.copy(options.meridian).normalize() : e3;
    var outerRadius = (typeof options.outerRadius === 'number') ? options.outerRadius : 1.0;
    var innerRadius = (typeof options.innerRadius === 'number') ? options.innerRadius : 0.5;
    var sliceAngle = (typeof options.sliceAngle === 'number') ? options.sliceAngle : 2 * Math.PI;
    var walls = new CylindricalShellBuilder();
    walls.height.copy(axis);
    walls.cutLine.copy(meridian).normalize().scale(outerRadius);
    walls.clockwise = true;
    walls.sliceAngle = sliceAngle;
    walls.offset.copy(axis).scale(-0.5);
    var outerWalls = walls.toPrimitive();
    walls.cutLine.normalize().scale(innerRadius);
    walls.convex = false;
    var innerWalls = walls.toPrimitive();
    var ring = new RingBuilder();
    ring.e.copy(axis).normalize();
    ring.cutLine.copy(meridian);
    ring.clockwise = true;
    ring.innerRadius = innerRadius;
    ring.outerRadius = outerRadius;
    ring.sliceAngle = sliceAngle;
    ring.offset.copy(axis).scale(0.5);
    var cap = ring.toPrimitive();
    ring.e.scale(-1);
    ring.clockwise = false;
    ring.offset.copy(axis).scale(-0.5);
    var base = ring.toPrimitive();
    return reduce([outerWalls, innerWalls, cap, base]);
}
function hollowCylinderPrimitive ( options ) { if ( options === void 0 ) { options = { kind : 'HollowCylinderGeometry' } ; } var axis = ( typeof options . axis === 'object' ) ? Vector3 . copy ( options . axis ) : e2 ; var meridian = ( typeof options . meridian === 'object' ) ? Vector3 . copy ( options . meridian ) . normalize ( ) : e3 ; var outerRadius = ( typeof options . outerRadius === 'number' ) ? options . outerRadius : 1.0 ; var innerRadius = ( typeof options . innerRadius === 'number' ) ? options . innerRadius : 0.5 ; var sliceAngle = ( typeof options . sliceAngle === 'number' ) ? options . sliceAngle : 2 * Math . PI ; var walls = new CylindricalShellBuilder ( ) ; walls . height . copy ( axis ) ; walls . cutLine . copy ( meridian ) . normalize ( ) . scale ( outerRadius ) ; walls . clockwise = true ; walls . sliceAngle = sliceAngle ; walls . offset . copy ( axis ) . scale ( - 0.5 ) ; var outerWalls = walls . toPrimitive ( ) ; walls . cutLine . normalize ( ) . scale ( innerRadius ) ; walls . convex = false ; var innerWalls = walls . toPrimitive ( ) ; var ring = new RingBuilder ( ) ; ring . e . copy ( axis ) . normalize ( ) ; ring . cutLine . copy ( meridian ) ; ring . clockwise = true ; ring . innerRadius = innerRadius ; ring . outerRadius = outerRadius ; ring . sliceAngle = sliceAngle ; ring . offset . copy ( axis ) . scale ( 0.5 ) ; var cap = ring . toPrimitive ( ) ; ring . e . scale ( - 1 ) ; ring . clockwise = false ; ring . offset . copy ( axis ) . scale ( - 0.5 ) ; var base = ring . toPrimitive ( ) ; return reduce ( [ outerWalls , innerWalls , cap , base ] ) ; }
Generates a Primitive from the specified options.
Generates a Primitive from the specified options .
// Multiple builders each provide a Primitive. // A Primitive will typically correspond to one index buffer and several attribute buffers. // The Primitives are merged into a single Primitive for efficiency.