```python
import sys
sys.path.append("..")
from gblend.geometry import *
from gblend.levels import *
from gblend.variables import x,y,z,rxy

import graphics.d3 as g3d
from sympy import pi
```


```python
t1 = RevolutionSurface3D(1/4-z**2-(rxy-2)**2)
t1.displace((x**2)/5+(y**2)/5)
t2 = RevolutionSurface3D(1/4-z**2-(rxy-2)**2)
t1.translate(-1,0,0)
t2.translate(1,0,0)


obj = t1 | t2
res = 120 # resolution for extracting mesh
sz = 5

ps, ts, ns, vals = geometry_level(obj,[-sz,sz,-sz,sz,-sz,sz], [res,res,res])
mesh = g3d.mesh3d(ps, ts)
seat_fig = g3d.get_figure([mesh])
seat_fig
```


```python
b1 = Ball3D(k=1/3)
b1.scale(1,1,.5)
b1.displace((x**2+y**2)/2)

b2 = Ball3D(k=1/3)
b2.scale(.6,.6,.6)
b2.translate(0,0,.5)

t1 = Torus3D(.3,2,k=3/4)
t1.rotate(1,0,0,pi/2)

obj = (b1-b2) | t1
res = 150 # resolution for extracting mesh
sz = 4

ps, ts, ns, vals = geometry_level(obj,[-sz,sz,-sz,sz,-sz,sz], [res,res,res])
mesh = g3d.mesh3d(ps, ts)
craddle_fig = g3d.get_figure([mesh])
craddle_fig
```


```python
#seat_fig.write_image("seat.png")
#craddle_fig.write_image("craddle.png")
```


```python
import math
```


```python
import sys
sys.path.append("..")
import gblend
import gblend.geometry
import gblend.levels
import gblend.variables
help(gblend.variables)
```

    Help on module gblend.variables in gblend:
    
    NAME
        gblend.variables - Some useful variables to define functions in 3-dimensional space
    
    DATA
        k = k
        rxy = rxy
        x = x
        y = y
        z = z
    
    FILE
        /Users/valeroc/Dropbox/MyProjects/geometry-blender/gblend/variables.py
    
    



```python

```


```python

```

27e319ffc437c4cc2a9fd233f70673572e0a751e
ipynb
Jupyter Notebook
demos/.ipynb_checkpoints/Gallery-checkpoint.ipynb
valerocar/geometry-blender
3604f9b5b63c12b8d648ceb63719a71c3d16e055
MIT
2021-04-24T19:55:02.000Z
2021-04-24T19:55:02.000Z
demos/.ipynb_checkpoints/Gallery-checkpoint.ipynb
valerocar/geometry-blender
3604f9b5b63c12b8d648ceb63719a71c3d16e055
MIT
demos/.ipynb_checkpoints/Gallery-checkpoint.ipynb
valerocar/geometry-blender
3604f9b5b63c12b8d648ceb63719a71c3d16e055
MIT
Qwen/Qwen-72B
1. YES
2. YES