Passing parameters to SphereGeometry: explicit is OK; in "{...}" form not OK

This line works correctly:
const beadGeometry = new THREE.SphereGeometry( 10, 32, 16 );

This line does not:
const beadGeometry = new THREE.SphereGeometry( {
radius: 10, widthSegments: 32, heightSegments: 16
} );

It creates this error message:
THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The “position” attribute is likely to have NaN values.

I would appreciate comments.
Thanks

i have docs open when i use three: three.js docs also always npm install @types/three even if you don’t use typescript, it gives your IDE the ability to have contextual information, auto correction and types on hover. you get a crash because you’re giving spheregeometry wrong input.

“wrong input”?
The values are the same, just delivered two different ways. The “{ … }” construct works just fine, for example with my material declaration:

const beadMaterial = new THREE.MeshPhongMaterial( {
color: 0xFFFF00, // ‘Phong’ material properties
emissive: 0x000000, // intrinsic ‘glow’ as in sun, light bulb…
specular: 0x111111, // reflectivity? default dark gray
shininess: 0.5, // range: 0, 100
flatShading: false,
wireframe: false,
transparent: false, // ‘Material’ properties
opacity: 1.0, // range: 0, 1
} );

i linked threejs docs, click it, it explains all.

class SphereGeometry extends BufferGeometry {
  constructor(radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI) {
    ...

it does not matter what another class does, meshphongmaterial is meshphongmaterial and spheregeometry is spheregeometry. spheregeometry doesn’t want an object, it wants arguments. you feed it an object it crashes, doesn’t really need a debate. :smiley:

OK, I give up. I am well aware of all the official documentation and much appreciate the parallel Fundamentals series. I generally have multiple threejs tabs open while banging away at the editor.

I just had this eerie feeling (false memory?) that the means of passing parameters into a new Geometry would follow the options for new Material. Hey, they’re just two ways of mapping values into the parameter space.

I started this project quite some time ago and, coming back to threejs, I notice considerable restructuring of the documentation. It appears all the Geometries are based on BufferGeometry which is maybe a new thing compared to my old work and crap memory.

yeah lots of things have changed, geometry going out was a big one.