2
$\begingroup$

A sphere is given by the graph of the equation $\lvert x\rvert^2+\lvert y\rvert^2+\lvert z\rvert^2=1$.

If you increase the exponents to something larger than 2, then the graph of the equation becomes more cubular, and is called a sphube, which is a 3D version of a squircle.

How do you use vector displacement to turn a cube into a mathematically precise sphube to the limits of numerical precision with volume half way between that of the cube and a sphere of the same size?

According to this article, the exponent should be 3.43184, but that number could be rounded off, and I need the exponent to have single-precision floating point precision.

$\endgroup$
5
  • 2
    $\begingroup$ Just out of interest: Why don't you just use the Round Cube from the Add Mesh Extra Objects? $\endgroup$
    – quellenform
    Aug 21, 2022 at 13:10
  • $\begingroup$ So are you just asking for a more precise exponent? $\endgroup$
    – J.G.
    Aug 21, 2022 at 15:59
  • $\begingroup$ @quellenform i noticed from his previous questions that it's out of curiousity, so not really related to a problem he needs solved. so using round cube is out of the question ;) $\endgroup$ Aug 21, 2022 at 16:05
  • 1
    $\begingroup$ If you goal is just more precision on the exponent, then this is a pure math question, not a blender question (ie suitable to a different SE site). If I understand the article you linked correctly, the code just above the block with the 3.43.. gives you the code to compute that number. So putting that code/ formula into a suitably mathy programming language will give you as much precision as you want. $\endgroup$
    – quarague
    Aug 21, 2022 at 17:39
  • $\begingroup$ @Harry McKenzie It is not only out of curiosity. $\endgroup$ Aug 21, 2022 at 22:29

2 Answers 2

5
$\begingroup$

I can't find a parametric expression for your surface: as far as I can see the sphube described in this paper is not the same as yours? (I could be mistaken)

Here's a shot at it in Geometry Nodes. The strategy is to create your object as an isosurface, (limited by the resolution of Blender's volumetrics) and then shrinkwrap a subdivided cube on to it for better topology:

enter image description here

There will be inaccuracies on the way, but maybe not effectively worse than placing the vertices of a polygonal mesh parametrically. Here, powers of 2, 3.43184, 20.

enter image description here

Blender 3.3b +

$\endgroup$
2
  • 1
    $\begingroup$ Thank you, but I do not how to do adaptive subdivision with geometry nodes. A reason I was asking about doing it with vector displacement is so I could use adaptive subdivision with the base geometry. $\endgroup$ Aug 21, 2022 at 21:32
  • $\begingroup$ @BlenderUser9000, I don't think procedurally-based adaptive subdiv is possible outside a Cycles render. (You could render the volume. there) Which means the geometry is not accessible. If you thought the sphube in the referenced paper was yours, we could go that way.. but still not strictly adaptive. What do you need this object/image for? $\endgroup$
    – Robin Betts
    Aug 21, 2022 at 22:10
0
$\begingroup$

If you are looking for an artistic rendition of cube transitioning to sphere, this can be done with shape keys. It is not mathematically precise though.

First, create a cube with a sphere inside it

Sphere inside Cube

Then use the shrink wrap modifier to wrap it to the sphere

enter image description here

Apply the modifier as a shape key, and you can use it to displace between the two.

enter image description here

$\endgroup$
1
  • 2
    $\begingroup$ I need the sphube to be mathematically precise to the limits of numerical precision. $\endgroup$ Aug 21, 2022 at 1:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .