Closed olson-sean-k closed 7 years ago
A unit sphere is a sphere of radius 1. The diameter is 2, so it exactly matches Cube
behavior.
In my opinion, the properties of a unit cube are much more useful than this relationship between the width of cubes and diameter of spheres. It's common to define spheres in terms of radii and cubes in terms of width, and it's generally useful to start with the multiplicative identity (lengths of one) of the unit shapes. Reconciling radius and width seems like an unrelated problem that depends very much on the application.
Yielding a unit cube kind of inverts this relationship between cubes and spheres. Today, cubes contain the unit sphere, but the unit sphere would (more or less) contain unit cubes. It's not clear to me that one of these relationships is more useful than the other.
Said another way, I find it surprising that for spheres 2r = 2
but for cubes 2w = 4
. Cubes are not "normalized".
the properties of a unit cube are much more useful than this relationship between the width of cubes and diameter of spheres
Would you have an example use case where the 1x1x1 cube would have a benefit?
Yielding a unit cube kind of inverts this relationship between cubes and spheres. Today, cubes contain the unit sphere, but the unit sphere would (more or less) contain unit cubes. It's not clear to me that one of these relationships is more useful than the other.
Agreed.
It's common to define spheres in terms of radii and cubes in terms of width
Yes, but that's not dominant. It's also common to define cubes (or rectangles, for the matter) in terms of extents (which are half of the sizes) whenever the origin being put at the center makes sense. Even the viewport setup on PS4, for example, is done with extents, even though it's not obvious as to why they couldn't go base + full size instead.
, and it's generally useful to start with the multiplicative identity (lengths of one) of the unit shapes. Said another way, I find it surprising that for spheres 2r = 2 but for cubes 2w = 4. Cubes are not "normalized".
Cube extents, very much like sphere radius, are multiplicative identities, so they make sense on the cube at least for consistency, if nothing else.
Would you have an example use case where the 1x1x1 cube would have a benefit?
I suppose the only real benefit is (arguably) intuitiveness. It's particularly compelling if an application is only concerned with cubes, because defining cubes in terms of unit spheres (or some other primitive) isn't too helpful then. For my application, I must first scale the cube mesh generated by genmesh
into a typical unit cube. I may be biased since I'm dealing exclusively with cubes at the moment.
I was initially surprised by the width of the generated cube, but as you've pointed out one could choose any basis for defining a cube (extent or even radius as a relation to the L-inf unit sphere), so my surprise may have just stemmed from an assumption that the basis of cubes would be their widths.
Cube extents, very much like sphere radius, are multiplicative identities, so they make sense on the cube at least for consistency, if nothing else.
Agreed. The basis for genmesh
cubes is the radius (half-width), and that makes no less sense than width or extent. I'm wondering if that's as generally useful as using width instead though.
Thanks for discussing. :-)
@olson-sean-k my pleasure! Closing the issue then, please feel free to revive it if needed.
Cube
generates a cube centered at the origin with sides of length two. Just asSphere
generates a unit sphere, maybeCube
should generate a unit cube with sides of length one?