You are on page 1of 47

ME F318 Computer Aided Design

Lecture 9: Solids

BITS Pilani Dr. Amit R. Singh


Pilani Campus

1 / 47
Euler-Poincaré Formula

Euler-Poincaré formula is a “one-sided” test to check validity of a


solid.

2 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula

Euler-Poincaré formula is a “one-sided” test to check validity of a


solid.
Definition
V − E + F − (L − F ) − 2(S − G ) = 0

3 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula

Euler-Poincaré formula is a “one-sided” test to check validity of a


solid.
Definition
V − E + F − (L − F ) − 2(S − G ) = 0

V : Number of vertices L: Number of loops


E: Number of edges S: Number of shells
F : Number of faces G: Number of genus

4 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula (Contd.)

• Genus: “through” holes

5 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula (Contd.)

• Genus: “through” holes


• Shell: “internal voids” surrounded by a surface (which may
have holes!). The solid itself is counted as one shell. So
S ≥ 1.

6 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula (Contd.)

• Genus: “through” holes


• Shell: “internal voids” surrounded by a surface (which may
have holes!). The solid itself is counted as one shell. So
S ≥ 1.
• Loop: a “closed” chain of edges with at least one common
adjacent face.

7 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula Examples

1. Show that for a cube the formula should sum up to 0.

8 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula Examples

1. Show that for a cube the formula should sum up to 0.


2. Calculate the Euler-Poincaré sum for a cube with a blind
rectangular hole.

(Figures are from https://pages.mtu.edu/∼shene/COURSES/cs3621/NOTES/model/euler.html)

9 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula Examples

1. Show that for a cube the formula should sum up to 0.


2. Calculate the Euler-Poincaré sum for a cube with a blind
rectangular hole.

3. Calculate the Euler-Poincaré sum for a cube with a blind


rectangular hole.

(Figures are from https://pages.mtu.edu/∼shene/COURSES/cs3621/NOTES/model/euler.html)

10 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula Examples

Calculate the Euler-Poincaré sum for a cube with a through hole


and an internal cubical void.

(Figure is from https://pages.mtu.edu/∼shene/COURSES/cs3621/NOTES/model/euler.html)

11 / 47 BITS Pilani, Pilani Campus


Euler-Poincaré Formula Counter-example

We said that the Euler-Poincaré test is “one-sided”. Here is an


example of an invalid solid that satisfies the zero sum equation.

(Figure is from https://pages.mtu.edu/∼shene/COURSES/cs3621/NOTES/model/euler.html)

12 / 47 BITS Pilani, Pilani Campus


Counting Genus is Tricky

• Topology of a solid does not change if we twist, stretch, or


squash it without cutting or adding new parts.

13 / 47 BITS Pilani, Pilani Campus


Counting Genus is Tricky

• Topology of a solid does not change if we twist, stretch, or


squash it without cutting or adding new parts.
• We must employ the above operations to check whether a
hole is really a through hole to count genus.

14 / 47 BITS Pilani, Pilani Campus


Counting Genus is Tricky

• Topology of a solid does not change if we twist, stretch, or


squash it without cutting or adding new parts.
• We must employ the above operations to check whether a
hole is really a through hole to count genus.
• We should not do these operations for other items of the
Euler-Poincaré formula as they will certainly change the
number of faces, edges, etc.

15 / 47 BITS Pilani, Pilani Campus


Counting Genus – an example

Consider a sphere with three symmetric radial holes that meet at


the center.

In this and the following related figures, the internal section is


shown on the right.
(Figure is from https://pages.mtu.edu/∼shene/COURSES/cs3621/NOTES/model/euler.html)

16 / 47 BITS Pilani, Pilani Campus


Counting Genus – an example

We can squeeze the portion of sphere between the holes to make it


into a shell as shown below.

(Figure is from https://pages.mtu.edu/∼shene/COURSES/cs3621/NOTES/model/euler.html)

17 / 47 BITS Pilani, Pilani Campus


Counting Genus – an example

Next, we can expand the top hole till the sphere reduces to a disk!

So, what is the actual genus of this solid?


(Figure is from https://pages.mtu.edu/∼shene/COURSES/cs3621/NOTES/model/euler.html)

18 / 47 BITS Pilani, Pilani Campus


Euler Operators

• A set of operations that do not alter the Euler-Poincaré


relation.

19 / 47 BITS Pilani, Pilani Campus


Euler Operators

• A set of operations that do not alter the Euler-Poincaré


relation.
• Any topologically valid polyhedron can be constructed from
an initial polyhedron by a finite sequence of Euler operations.

20 / 47 BITS Pilani, Pilani Campus


Euler Operators

• A set of operations that do not alter the Euler-Poincaré


relation.
• Any topologically valid polyhedron can be constructed from
an initial polyhedron by a finite sequence of Euler operations.
• Examples of Euler operators:
• making an edge and a vertex
• deleting a face and an edge

21 / 47 BITS Pilani, Pilani Campus


Constructive Solid Geometry (CSG)

CSG is an alternative representation of solids. It consists of


• Primitives or building blocks: cube, triangular prism,
sphere, cylinder, cone, and torus

22 / 47 BITS Pilani, Pilani Campus


Constructive Solid Geometry (CSG)

CSG is an alternative representation of solids. It consists of


• Primitives or building blocks: cube, triangular prism,
sphere, cylinder, cone, and torus
• Geometric Transformations: scaling, translation, and
rotation

23 / 47 BITS Pilani, Pilani Campus


Constructive Solid Geometry (CSG)

CSG is an alternative representation of solids. It consists of


• Primitives or building blocks: cube, triangular prism,
sphere, cylinder, cone, and torus
• Geometric Transformations: scaling, translation, and
rotation
• Boolean operations: Union, Intersection, Difference

24 / 47 BITS Pilani, Pilani Campus


CSG Primitives

• The primitive solids are available in some “standard” form.

25 / 47 BITS Pilani, Pilani Campus


CSG Primitives

• The primitive solids are available in some “standard” form.


• For example, a sphere would have a unit radius and be
centered at the origin.

26 / 47 BITS Pilani, Pilani Campus


CSG Primitives

• The primitive solids are available in some “standard” form.


• For example, a sphere would have a unit radius and be
centered at the origin.
• Similarly, a cube could have its center at the origin and the
side-length may be a single unit.

27 / 47 BITS Pilani, Pilani Campus


CSG Primitives

• The primitive solids are available in some “standard” form.


• For example, a sphere would have a unit radius and be
centered at the origin.
• Similarly, a cube could have its center at the origin and the
side-length may be a single unit.
• The choice of the standard form may vary from one CAD
software to another.

28 / 47 BITS Pilani, Pilani Campus


CSG Expressions

To create a cube with a cubical through hole, the following


sequence of operations are needed:
1. Create cube 1, assuming that the standard form is centered at
the origin and has unit side length.

29 / 47 BITS Pilani, Pilani Campus


CSG Expressions

To create a cube with a cubical through hole, the following


sequence of operations are needed:
1. Create cube 1, assuming that the standard form is centered at
the origin and has unit side length.
2. Scale cube 1 in x and y directions so that side-length is two
units.

30 / 47 BITS Pilani, Pilani Campus


CSG Expressions

To create a cube with a cubical through hole, the following


sequence of operations are needed:
1. Create cube 1, assuming that the standard form is centered at
the origin and has unit side length.
2. Scale cube 1 in x and y directions so that side-length is two
units.
3. Create cube 2.

31 / 47 BITS Pilani, Pilani Campus


CSG Expressions

To create a cube with a cubical through hole, the following


sequence of operations are needed:
1. Create cube 1, assuming that the standard form is centered at
the origin and has unit side length.
2. Scale cube 1 in x and y directions so that side-length is two
units.
3. Create cube 2.
4. Take a difference of cube 1 and cube 2.

32 / 47 BITS Pilani, Pilani Campus


CSG Expressions

To create a cube with a cubical through hole, the following


sequence of operations are needed:
1. Create cube 1, assuming that the standard form is centered at
the origin and has unit side length.
2. Scale cube 1 in x and y directions so that side-length is two
units.
3. Create cube 2.
4. Take a difference of cube 1 and cube 2.
The above steps can also be written as an expression
difference( scale( cube(L=1), x=2, y=2 ), cube(L=1) )

33 / 47 BITS Pilani, Pilani Campus


CSG Tree

The expression on the previous slide can also be represented as a


tree.

We can, thus, represent a composite solid as a graph and save it to


a file.

34 / 47 BITS Pilani, Pilani Campus


An Open Ball

Definition
An open ball of radius r and center P(a, b, c) is the set of all
points that satisfy (x − a)2 + (y − b)2 + (z − c)2 < r 2 .

35 / 47 BITS Pilani, Pilani Campus


Some Set Theory...

Definition
Given a solid S, a point P is an interior point if there exists at least
one open ball of any radius r and center P that lies entirely in S.

The set of all interior points of a solid is called as the interior of


the solid, int(S).

36 / 47 BITS Pilani, Pilani Campus


Some Set Theory...

Definition
Given a solid S, a point P is an interior point if there exists at least
one open ball of any radius r and center P that lies entirely in S.

The set of all interior points of a solid is called as the interior of


the solid, int(S).

Definition
Given a solid S, a point P is an exterior point if there exists at
least one open ball of any radius r and center P that does not
intersect S.
The set of all exterior points of a solid is called as the exterior of
the solid, ext(S).

37 / 47 BITS Pilani, Pilani Campus


Some Set Theory...

Definition
The boundary of a solid S is the set of points that are neither in
the interior nor in the exterior of the solid. We will denote it as
b(S).

38 / 47 BITS Pilani, Pilani Campus


Some Set Theory...

Definition
The boundary of a solid S is the set of points that are neither in
the interior nor in the exterior of the solid. We will denote it as
b(S).

Definition
The closure of a solid S is the union of the interior and the
boundary of the solid. We will denote it as closure(S).

39 / 47 BITS Pilani, Pilani Campus


Regularized Boolean Operators

• We want the result of union, intersection, and difference


operations to be valid solids i.e. three-dimensional entities.

40 / 47 BITS Pilani, Pilani Campus


Regularized Boolean Operators

• We want the result of union, intersection, and difference


operations to be valid solids i.e. three-dimensional entities.
• What is the intersection of two equal cubes with two faces
touching each other? A face! It is not a valid solid.

41 / 47 BITS Pilani, Pilani Campus


Regularized Boolean Operators

• We want the result of union, intersection, and difference


operations to be valid solids i.e. three-dimensional entities.
• What is the intersection of two equal cubes with two faces
touching each other? A face! It is not a valid solid.
• ∪, ∩, and \ denote the usual set operations of union,
intersection, and difference.

42 / 47 BITS Pilani, Pilani Campus


Regularized Boolean Operators

• We want the result of union, intersection, and difference


operations to be valid solids i.e. three-dimensional entities.
• What is the intersection of two equal cubes with two faces
touching each other? A face! It is not a valid solid.
• ∪, ∩, and \ denote the usual set operations of union,
intersection, and difference.
• We will define regularized set operations using the symbols
+, ∧, and − for union, intersection, and difference
respectively.

43 / 47 BITS Pilani, Pilani Campus


Regularized Boolean Operations (contd.)

A + B = closure(int(A ∪ B))
A ∧ B = closure(int(A ∩ B))
A − B = closure(int(A \ B))

44 / 47 BITS Pilani, Pilani Campus


Regularized Boolean Operations (contd.)

A + B = closure(int(A ∪ B))
A ∧ B = closure(int(A ∩ B))
A − B = closure(int(A \ B))

How does this help?

45 / 47 BITS Pilani, Pilani Campus


Regularized Boolean Operations (contd.)

A + B = closure(int(A ∪ B))
A ∧ B = closure(int(A ∩ B))
A − B = closure(int(A \ B))

How does this help?


Hint: what is int(b(S))?

46 / 47 BITS Pilani, Pilani Campus


OpenSCAD

OpenSCAD is a great example of a CSG based 3D CAD Modeling


software.

47 / 47 BITS Pilani, Pilani Campus

You might also like