download
raw
760 Bytes
import { Path } from '../extras/core/Path.js';
import { LatheGeometry } from './LatheGeometry.js';
class CapsuleGeometry extends LatheGeometry {
constructor( radius = 1, length = 1, capSegments = 4, radialSegments = 8 ) {
const path = new Path();
path.absarc( 0, - length / 2, radius, Math.PI * 1.5, 0 );
path.absarc( 0, length / 2, radius, 0, Math.PI * 0.5 );
super( path.getPoints( capSegments ), radialSegments );
this.type = 'CapsuleGeometry';
this.parameters = {
radius: radius,
length: length,
capSegments: capSegments,
radialSegments: radialSegments,
};
}
static fromJSON( data ) {
return new CapsuleGeometry( data.radius, data.length, data.capSegments, data.radialSegments );
}
}
export { CapsuleGeometry };

Xet Storage Details

Size:
760 Bytes
·
Xet hash:
8074c1376f5e5237b4117b1fea816e5e322626d7ff543299cecc8afc1a9b00df

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.