User Tools

Site Tools


hyperfun:tut_set

Set-theoretic operations

Until now, we have used only one equation or the library function to model an object. But, it is not enough for complex objects. This page shows how to combine primitives to model more complex objects.

Suppose A is a blue box, B is a yellow sphere.

rbox.jpgrsphere.jpg
A B

Union A and B

Union A and B is described as A | B in HyperFun.

The lower figure is the result of A | B.

rbox.jpg | rsphere.jpgrunion.jpg

Intersection A and B

Intersection A and B is described as A & B in HyperFun. This operation removes all pieces that do NOT intersect.

The lower figure is the result of A & B.

rbox.jpg & rsphere.jpgrintersection.jpg

Subtraction B from A, A from B

Subtraction B from A or A from B is described as A \ B or B \ A respectively. Subtraction removes all intersecting parts of the objects.

The figures below are the result of A \ B and B \ A.

rbox.jpg \ rsphere.jpgrdifference1.jpg

rsphere.jpg \ rbox.jpgrdifference2.jpg

For example, making eyes is possible by using subtraction.

rface.jpg

Combination of union, intersection, and subtraction

In the right hand figures, we can see the frog being constructed using union and subtraction. Similarly, we can make complex objects from simple parts using set-theoretic operations. This process, is called CSG (Constructive Solid Geometry).

frog_face.jpg
part1.jpgpart2.jpgpart3.jpgpart4.jpgpart5.jpg

hyperfun/tut_set.txt · Last modified: 2023/12/19 03:07 by 127.0.0.1