Modeling using equations.

Type the model

my_model(x[3],a[1]){
my_model = 1-(x[1]/3)2 -(x[2]/5)2 -(x[3]/7)2;
}
polygonize, and then change the half-axes (values 3, 5, 7).

Learning set-theoretic operations
- making a cube as intersection of 6 half-spaces put in one half space at a time.

my_model(x[3], a[1])
{
xx = (x[1]+3) & (3-x[1]);
yy = (x[2]+3) & (3-x[2]);
zz = (x[3]+3) & (3-x[3]);
my_model = xx & yy & zz;
}


OR -------------------------------------------------------


my_model(x[3], a[1])
{

my_model =

3 - x[1] & -- x座標から3離れたところにある平面
3 + x[1] & -- x座標から-3離れたところにある平面
3 - x[2] & -- y座標から3離れたところにある平面
3 + x[2] & -- y座標から-3離れたところにある平面
3 - x[3] & -- z座標から3離れたところにある平面
3 + x[3]; -- z座標から-3離れたところにある平面

}


Learning set-theoretic operations 
between a sphere (ball) and a cube.


my_model(x[3], a[1])
{
array center[3];
center = [0,0,0];
sp = hfSphere(x,center,4);
xx = (x[1]+3) & (3-x[1]);
yy = (x[2]+3) & (3-x[2]);
zz = (x[3]+3) & (3-x[3]);
cube = xx & yy & zz;
my_model = cube | sp;
}

This is union.
Change the last line to the intersection:
my_model = cube & sp;
and then to the subtraction:
my_model = cube \ sp;
then change grid to 77,77,77 to make a nice cube with a spherical hole.

OR ------------------------------------------------------

my_model(x[3], a[1])
{
array vertex[3];
--座標を入れるための変数

vertex = [-2, -2, -2];
--箱の角の座標を(x, y, z) = (-2, -2, -2)とする

block = hfBlock(x, vertex, 4, 4, 4);
--hfBlockを使って箱を作る

my_model = block;
}

End