Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Represent a spherical cap in 3D graphics
ResourceFunction["SphericalCap"][] represents a hemisphere. | |
ResourceFunction["SphericalCap"][p] represents a spherical cap with protrusion p. | |
ResourceFunction["SphericalCap"][p,prop] returns a given property prop. |
"Surface" | BSplineSurface expression; default property |
"Function" | explicit function corresponding to the BSplineSurface expression |
"Formula" | explicit formula corresponding to the BSplineSurface expression |
"ControlPoints" | control points of BSplineSurface expression |
"Weights" | weights of BSplineSurface expression |
"Properties" | list of all properties |
Show a hemisphere:
In[1]:= | ![]() |
Out[1]= | ![]() |
Show a spherical cap:
In[2]:= | ![]() |
Out[2]= | ![]() |
Apply styling:
In[3]:= | ![]() |
Out[3]= | ![]() |
Spherical caps with different protrusion parameters:
In[4]:= | ![]() |
Out[4]= | ![]() |
As the parameter approaches -1, the cap approaches the unit sphere:
In[5]:= | ![]() |
Out[5]= | ![]() |
List all available properties:
In[6]:= | ![]() |
Out[6]= | ![]() |
By default, the "Surface" property is returned:
In[7]:= | ![]() |
Out[7]= | ![]() |
Retrieve the control points of the spline surface for a symbolic protrusion:
In[8]:= | ![]() |
Out[8]= | ![]() |
Retrieve the weights of the spline surface:
In[9]:= | ![]() |
Out[9]= | ![]() |
Get the function internally used by the spline surface:
In[10]:= | ![]() |
Out[11]= | ![]() |
Plot the function for a specific protrusion parameter:
In[12]:= | ![]() |
Out[12]= | ![]() |
Consider only a part of the surface:
In[13]:= | ![]() |
Out[15]= | ![]() |
In[16]:= | ![]() |
Out[16]= | ![]() |
Get the corresponding formula in formal variables x and y:
In[17]:= | ![]() |
Out[18]= | ![]() |
Create a bowl of water graphic:
In[19]:= | ![]() |
Out[20]= | ![]() |
Show a spherical lens:
In[21]:= | ![]() |
Out[22]= | ![]() |
Obtain a spherical cap using Ball and ClipPlanes:
In[23]:= | ![]() |
Out[23]= | ![]() |
Obtain a spherical cap using SphericalPlot3D:
In[24]:= | ![]() |
Out[24]= | ![]() |
Represent a flat 3D disk:
In[25]:= | ![]() |
Out[25]= | ![]() |
Compare with the resource function Disk3D:
In[26]:= | ![]() |
Out[26]= | ![]() |
Despite the stark similarity, the underlying spline surfaces differ substantially:
In[27]:= | ![]() |
Out[27]= | ![]() |
In[28]:= | ![]() |
Out[28]= | ![]() |
Move, scale, and rotate the cap:
In[29]:= | ![]() |
Out[30]= | ![]() |
A spherical cap returned by SphericalCap satisfies the equation for a shifted (unit) sphere:
In[31]:= | ![]() |
Out[34]= | ![]() |
Artefacts occur at poles:
In[35]:= | ![]() |
Out[35]= | ![]() |
Increase the rendering parameter for spline surfaces to mitigate the artefacts:
In[36]:= | ![]() |
Out[36]= | ![]() |
The protrusion parameter cannot be set exactly to -1:
In[37]:= | ![]() |
Out[37]= | ![]() |
For such a case, use Ball instead:
In[38]:= | ![]() |
Out[38]= | ![]() |
Bubbles made by a bubble wand:
In[39]:= | ![]() |
Out[40]= | ![]() |
Visualize the control points:
In[41]:= | ![]() |
Out[42]= | ![]() |
Visualize the weights:
In[43]:= | ![]() |
Out[44]= | ![]() |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License