UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
Representation of Curves
Generally shape representation have two uses
Analytic use.
Synthetic use.
In Analytical, representation are used analytically to describe
shapes that can be measured.
In synthetic, the designer interactively creates or modifies a
model of a shape, examining and improving the design until it is
acceptable.
Important properties for designing curves
Control Points:
Locate points through which the curve must pass the
points that control the curve shape.
Axis independence:
The shape of an object must not change when the control
points are measured in a different coordinate system.
Global or local control:
As a designer manipulates a control point, a curve may
change shape only in the region near the control point
or it may change shape throughout.
Variation diminishing property:
A curve that oscillates about its control points is
usually undesirable.
Variation diminishing curves tend to smooth out a
sequence of control points.
Versatility:
A curve representation that allows a limited variety of
shapes may frustrate (disturb) a designer.
The control of a curve representation, often by adding
or removing control points.
Order of continuity:
A complex shape is usually not modeled by a single
curve, but by several curves pieced together end to end.
When creating joints, the designer often wants to control
the order of continuity at the joint.
SYNTHETIC CURVES
Need of synthetic curves in design arises:
When a curve is represented by a collection of measured
data points and
When an existing curve must change to meet new design
requirements.
Data points are called control points for the curve.
Various continuity requirements can be specified at the data
points to impose degree of smoothness of the resulting curve.
Order of Continuity
The order of continuity becomes important when a complex
curve is modeled.
Zero order continuity (C0) yields a position continuous curve.
First (C1) and second (C2) order continuities imply slop and
curvature continuous curves respectively.
First order continuity Second order continuity
The type of input data and its influence on the control of the
resulting synthetic curve determine the use and effectiveness of the
curve in design.
Most commonly used Synthetic Curves
• Hermite Cubic Spline
– It passes through the control points.
– It has only upto C1 continuity.
• Bezier Curve
– It does not pass through the control points but only
approximates the trend.
– It also has only upto C1 continuity
• B-Spline Curve
– It is also most generally an approximator.
– It has upto C2 continuity.
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
Cubic Spline
Parametric spline curves are defined as
piecewise polynomial curves with a
certain order of continuity.
Parametric cubic splines are used to
interpolate to given data.
Cubic spline is determined by defining positions and tangent
vectors at the data points.
The parametric cubic spline connects two data points and utilizes a
cubic function.
Therefore four conditions (positions of the two end points and two
tangent vectors at the points) are required to determine the
coefficients of the equation.
Parametric equation of cubic spline is given by
Where u is the parameter and Ci is the polynomial coefficients
Expanded vector form of above equations is
In scalar form it can written as for x, y and z components
Matrix form it can be written as
The tangent vector to the curve at any point is given by
differentiating the equation with respect to ‘u’ to give
Inorder to find the coefficients Ci, consider the cubic spline curve with
two endpoints P0 and P1.
Applying the boundary conditions
Solving these four equations simultaneously for the coefficients gives
Substituting in the below equation and rearranging gives
are called geometric coefficients.
Tangent Vector becomes
The function of u called blending functions
Equation can be written in a matrix form as
Where is the Hermite matrix and V is the geometry vector.
The curve’s shape can be controlled by changing its endpoints or its
tangent vectors.
If the two end points are fixed in space, the designer can control the
shape of the spline by changing either the magnitudes or the direction
of the tangent vectors.
The use of the cubic splines in design applications is not popular
compared to Bezier or B-spline curves.
The control of the curve is not very obvious from the input data due
to its global control characteristics.
The order of the curve is always constant (cubic).
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
BEZIER CURVES
A Bezier curve is defined by a set of data points. The curve may
interpolate or extrapolate the data points.
Some CAD systems offer both options and others offer the
interpolation version only.
In both cases, the data points are used to control the shape of the
resulting curves.
Bezier curves and surfaces are credited to P. Bezier of the French
car firm Regie Renault who developed (1962) and used them in his
software system called UNISURF, which designers used to define
the outer panels of several Renault cars. These curves, known as
Bezier curves.
Only the first and the last control points or vertices of the
polygon actually lie on the curve.
The other vertices define the order, derivatives and shape of
the curve.
The curve is always tangent to the first and last polygon
segments.
The curve shape tends to follow the polygon shape.
BEZIER CURVE
The figure shows the order of defining the control points changes
the polygon definition, which changes the resulting curve shape.
The arrow shown on each curve shows its direction.
BEZIER CURVES FOR VARIOUS CONTROL POINTS
BEZIER CURVES FOR VARIOUS CONTROL POINTS
BEZIER CURVE
Mathematically for n+1 control points, the Bezier curve is defined by the
following polynomial of degree n:
Where P(u) is a point on the curve and Pi is a control point.
Bi,n are the Bernstein polynomials .
Characteristics of the Bezier Curve
The curve interpolates the first and last control points; that
is, it passes through P0 and Pn.
The curve is tangent to the first and last segments of the
polygon.
The curve is symmetric : the sequence of control points
defining the curve can be reversed without change of the curve
shape.
The curve shape can be modified by either changing one or
more vertices of its polygon.
A closed Bezier curve can simply be generated by closing its
characteristics polygon
Modifications of cubic Bezier Curve
CONVEX HULL OF A BEZIER CURVE
Bezier curve has the convex hull property.
A curve is said to have convex hull property if it is lies entirely
within the convex hull defined by the polygon vertices.
In a plane, the convex hull is a closed polygon and in 3D it is
a polyhedron.
The hull is formed by connecting the vertices of the
characteristic polygon.
This is a useful property for graphics functions such as
displaying or clipping the curve.
CONVEX HULL OF A BEZIER CURVE
Some Bezier Curves
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
B – Spline Curve
B-splines are a powerful tool for generating curves with many
control points and provide many advantages over Bezier curves.
A long, complicated curve can be specified as a single B-spline.
A curve designer has much flexibility in adjusting the curvature
of a B-spline curve.
B-splines can be designed with sharp bends and even corners.
B-spline curves can interpolate or approximate a set of given
data points.
B – Spline Curve
Properties of B-spline functions
The Characteristics of B- Spline Curve
The local control of the curve can be achived by changing the
position of a control points, using multiple control points by
placing several points at the same location, or by choosing a
different degree.
B-spline curve passes through the first and last control points P0
and Pn+1 and is tangent to the first and last segments of the
control polygon.
The Effect of Degree of B- Spline Curve on its shape
Increasing the degree of the curve tightens it. In general, the less
the degree, the closer the curve gets to the control points.
When k=1, a zero degree curve results. The curve then becomes the
control points themselves.
When k=2, the curve becomes the polygon segments themselves.
A second degree curve is always tangent to the midpoints of all the
internal polygon segments. This not in the case for other degrees.
Identical B-spline and Bezier Curves
If k equals the number
of control points, then
the resulting B-spline
curve becomes a Bezier
curve.
Multiple control points
induce regions of high
curvature of a B-spline
curve. This is useful
when creating sharp
corners in the curve.
Multiple Control point B-Spline curve
An Open B-spline curve with P0 and P5 coincident
In representing closed curves, closed polygons are used where the
first and last control points are connected by a polygon segment.
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
INTRODUCTION TO SURFACE MODELING
Surface modeling is required in Shape design and
representation of complex objects such as car, ship and
airplane bodies as well as castings.
Surface creation on existing CAD/CAM systems usually
requires wireframe entities as a start.
To create a surface model, the user begins by constructing
wireframe entities and then connecting them appropriately
with the proper surface entities.
A surface model of an object is a more complete and less
ambiguous representation than its wireframe model.
Mesh in Surface Models
Finer the mesh size of surface entities in a model, the longer the CPU
time to construct the entities and to update the graphics display and the
longer it takes to plot the surface model.
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
Surface Entities
Major surface entities provided by CAD/CAM systems.
1. Plane Surface
This is the simplest surface.
The plane surface can be used to generate cross sectional
views by intersecting a surface model with it.
2. Ruled (lofted )Surface
This is a linear surface. It interpolated linearly between two
boundary curves that define the surface (rails).
Rails can be any wireframe entity. This entity is ideal to
represent surfaces that do not have any twists or kinks.
3. Surface of revolution
This is an Axisymmetric surface that can model axisymmetric
objects. It is generated by rotating a planar wireframe entity
in space about the axis of symmetry a certain angle.
4. Tabulated Cylinder
This is a surface generated by translating a planar curve a
certain distance along a specified direction (axis of the
cylinder)
It is used to generate surfaces that have identical curved cross
sections.
5. Bezier Surface
This is a surface that approximates given input data.
Similar to Bezier curve, it does not pass through all given
data points.
It is a synthetic surface that permits, twists and kinks.
It allows only the global control of the surface.
6. B-spline surface
It is a synthetic surface, can approximate or interpolate
given input data.
It permits local control of the surface.
7. Coons Patch
Coons patch is used to create
surface using curves that form
closed boundaries.
8. Fillet surface
Surface that blends two surfaces
together.
9. Offset surface
Existing surface can be offset to create new ones
identical in shape but may have different dimensions.
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
SURFACE REPRESENTATION
There are several methods to fit nonparametric surfaces to a
given set of data points.
These fall into two categories. In the first, one equation is fitted
to pass through all the points while in the second the data points
are used to develop a series of surface patches that are
connected together with at least position and first derivative
continuity.
In both categories, the equation of the surface or surface patch
is given by
where P is the position vector of a point on the surface.
Point P on a nonparametric surface patch
The nonparametric surface representation suffers from all the
disadvantages, when compared with parametric surface representation,
that nonparametric curves suffers from when compared with parametric
curves.
However nonparametric surfaces do have some advantages when it
comes to solving surface interaction problems, but these advantages do
not warrant their use in CAD/CAM.
Parametric Representation of a three-dimensional surface
The parametric
representation of a
surface means a
continuous, vector
valued function P(u,v)
of two variables.
The function P(u,v) at
certain u and v values
is the point on the
surface at these values.
Two patch parametric surface
A patch is considered the basic mathematical element to model a
composite surface.
Some surfaces may consist of one patch only, while others may
be a few patches connected together.
Surface Composed of rectangular and triangular patches
The topology of a patch may be rectangular or triangular.
Analogous to curves, there are analytic and synthetic surfaces.
Analytic surfaces are based on wireframe entities and include
the plane surface, ruled surface, surface of revolution, and
tabulated cylinder.
Synthetic surfaces are formed from a given set of data points
or curves and include the Bicubic, Bezier, B-spline, and
Coons patches.
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
BEZIER SURFACE
An orderly set of data or control points is used to built a
topologically rectangular surface.
The surface equation can be written by
Where P (u,v) is any point on the
surface and Pij are the control points.
These points form the vertices of the
control or characteristic polyhedron
of the resulting Bezier surface.
The surface interpolates the four
corner control points.
Closed Bezier surface
Bezier surface possesses the convex hull property.
The convex hull in this case is the polyhedron formed by
connecting the furthest control points on the control polyhedron.
The shape of the Bezier surface can be modified by either
changing some vertices of its polyhedron or by keeping the
polyhedron fixed and specifying multiple coincident points of
some vertices.
A closed Bezier surface can be
generated by closing its polyhedron
or choosing coincident corner points.
COMPOSITE BEZIER SURFACE
A composite Bezier surface can have C0 or C1 continuity.
A positional continuity between, say two patches requires that the
common boundary curve between the two patches must have a
common boundary polygon between the two characteristic
polyhedrons.
For tangent continuity across the boundary, the segments, attached
to the common boundary polygon, of one patch polyhedron must be
collinear with the corresponding segments of the other patch
polyhedron.
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
B- Spline Surface
A rectangular set of data points creates the surface.
This set forms the vertices of the characteristic polyhedron that
approximates and controls the shape of the resulting surface.
A B-spline surface can approximate or interpolate the vertices of
the polyhedron.
The degree of the surface is independent of the number of control
points and continuity is automatically maintained throughout the
surface.
As a result, surface interactions can easily be managed.
A B-spline surface defined by (n+1)x (m+1) array of control points.
B- Spline Surface
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
Solid Modeling-Introduction
Solid Modeling (Volumetric modeling) techniques begun to develop in the late
1960s and early 1970s.
It is developed to eliminate all kinds of ambiguities in representation and
manipulations of the objects.
The completeness of the information contained in a solid model allows
the automatic production of realistic images of a shape.
The model can also serve as a means of geometric input for finite element
analysis or even manufacturing tasks as the generation of instructions for
numerically controlled machining.
It produces accurate designs
It provides complete three dimensional definition. It improves the
quality of the design
It improves visualization. It has potential for functional automation and
integration.
76
• Are a more complete representation than its surface model.
• Contain geometric data as well as topological information unlike
wireframes or surfaces.
77
Use of Solid Modeling in design and manufacturing increasing due
to
Reduced computing costs
Fast computing hardware
Improved user interface
Software improvements
Solid modeling is the solution to automating and integrating
design and manufacturing.
The complete definition of part shape through solid models is a key
to CIM.
Solid modeling store more information than wire frame or
surface modelers.
Geometry and Topology in Solid Models
• The data base for a solid
model should have two types
of information.
• The first is the metric or
geometric data which relate
to the 3D coordinate
positions of the object in
space.
• Second is the connectivity or topological data which relate
objects with each other.
• Both information are necessary, as different shapes can result with
Same geometry- different topology
Different geometry-same topology
Geometry and Topology in Solid Models
• The geometry is the actual
dimensions that define the entities
of the object.
• The length of lines L1, L2, L3 and
the angles between the lines, and
the radius R and the center P1 of
the half circle.
• Topology is the connectivity of the object entities.
• L1 shares a vertex with L2 and C1 , L2 shares a vertex with L1 and L3,
L3 shares a vertex with L2 and C1, L1 and L3 do not overlap, and P1 lies
outside the object.
80
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
Solid Entities
Primitives (building blocks) are simple basic shapes and are
considered the solid modeling entities which can be combined by a
mathematical set of Boolean operations to create the solid.
The most common primitives are:-
Block
Cylinder
Cone
Sphere
Wedge
Torus
A primitives requires a set of location data, a set of geometric
data and a set of orientation data.
Primitives are usually translated or rotated to position and
oriented properly before applying Boolean operations.
82
Various Solid Modeling Primitives
83
Most Common Primitives
84
Solid Models-Primitives Approach
• Using primitive approach, one can construct the solid model of the object by
dividing it into blocks and cylinders.
85
Solid Models-Features Approach
• In feature approach the designer can create different cross sections and
extrude them.
86
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
Primitives
Two or more primitives can be combined to form the desired solid.
The relationships between primitives are achieved via Boolean
operations.
Boolean operations are
Union
Intersection
Difference
88
Boolean Operations of a Block A and Cylinder B
89
90
Solid Modeling using 3D Primitives
91
Various representation schemes
The nine solid representation schemes are
Half-spaces
Boundary Representation (B-rep)
Constructive Solid Geometry (CSG)
Sweeping
Analytical Solid Modeling (ASM)
Cell decomposition
Spatial enumeration
Octree encoding and
Primitive instancing
Algorithms
Representation of solids are built and invoked
via algorithms (processors)
Algorithm is a procedure that takes certain
input and produces a desired output.
Three types of algorithms
a: data → rep (algorithm a is defined as
taking data and producing representation) –
these algorithms build, maintain and manage
representations.
a: rep → data (compute property values - by
taking a representation and producing data)
– application algorithms belong to this type.
a: rep→rep (take representations and
produce representations) – algorithm that
converts CSG to B-rep.
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
Boundary Representation (B-rep)
• It is based on the topological notion that a physical
object is bound by a set of faces.
• A boundary model comprised of faces, vertices and
edges linked together.
• Each face is bounded by edges and each edge is
bounded by vertices.
• The database of a B-rep model consists of both the
geometry as well as the topology of the object.
• Topology – by Euler operations.
• Geometry- by Euclidean calculations.
• Euler operations - to create, manipulate and edit the faces,
edges and vertices.
• Geometry – includes coordinates of vertices, rigid motion
and transformation (translation, rotation) and metric
information (distances, angles, areas, volumes).
• Geometry and topology are interrelated and cannot be
separated.
• The primitives used by the B-rep system are faces, edges
and vertices.
Basic Elements of B-rep
• Primitives are used to create both polyhedral as well as
curved objects.
• A polyhedral object consists of planar faces (or sides)
connected by straight (linear) edges, which in turn are
connected at the vertices.
• A curved object is like a polyhedron but with curved faces
and edges
Classification of Polyhedral objects
Simple Polyhedron (no inner loops, holes or handles)
Polyhedrons with inner loops.
Polyhedrons that have holes but not through holes.
Polyhedrons with handles or genus
Types of polyhedral objects
Object Faces Edges Vertices Inner Bodies Genus
No (F) (E) (V) Loop (B) (G)
(L)
4 1 6 12 8 0 1 0
2 5 8 5 0 1 0
3 10 24 16 0 1 0
4 16 36 24 2 1 0
5 11 24 16 1 1 0
6 12 24 16 0 2 0
5 7 10 24 16 2 1 1
8 20 48 32 4 1 1
9 14 36 24 2 1 1
8 9
1 7
2 3
Euler’s Law
• Any polyhedron that satisfies the following equation has a
valid topology
F E V L 2( B G)
• Any open surface objects satisfies the following equation
F E V L B G
F = number of faces E = number of edges
V = number of vertices L = Faces inner loops
B = number of bodies G = number of genus (handles)
Open Polyhedral Objects
Exact B-rep of a cylinder and a sphere
Approximate B-rep or Faceted B-rep
Curved face is divided
into planar facets.
Faceted cylinder is
generated by rotating a
line incrementally about
the axis.
General data structure for B-rep
It should have both
topological and
geometrical information.
Lists for bodies, faces,
loops, edges and vertices
are generated and stored in
tables.
Boundary Model of Solid S
Rotational Sweep Boundary Model
Advantages of B-rep
It is very appropriate to construct solid models of unusual
shapes that are difficult to build using primitives.
e.g., Aircraft and Automobile body
It is relatively simple to convert a B-rep model into a
wireframe model because the model’s boundary definition is
similar to the wireframe definition.
Disadvantage
The disadvantage of B-rep is that it requires large amounts of
storage because it stores the definition of the model boundaries.
B-rep do not have a CSG compatible user interface.
UNIT
2
Representation of curves - Hermite cubic spline
curve, Bezier curve, B-spline curves, Surface
Modeling – Surface Entities, Representation of
Surface, Bezier Surface, B-Spline Surface and
Coons Surface. Solid Modeling - Solid Entities,
Solid Representation, Boundary Representation
(B-Rep), Sweeps Representation, Constructive
Solid Geometry (CSG).
Constructive Solid Geometry (CSG)
CSG and B-rep schemes are very popular schemes and best
understood representations so far.
CSG representations are easy to create, store and easy to check
for validity.
A CSG model is based on the topological notion
physical object can be divided into a set of primitives
(basic elements or shapes)
and that can be combined in a certain order following a
set of rules (Boolean operations) to form the object.
Each primitive is bounded by a set of surfaces, it is combined via
a boundary evaluation process to form the boundary of the object.
TYPES OF CSG SCHEMES
There are two main types of CSG schemes:
r-sets: Based on bounded solid primitives.
Non r-sets: Based on generally unbounded half spaces.
(lower level primitives)
Half-spaces
It is a basic representation scheme for bounded solids. By
combining half-spaces (using set operations) in a building
block fashion, various solids can be constructed.
Half spaces are usually unbounded geometric entities.
Bounded and Unbounded Primitives
The solid model is represented by three bounded primitives and
seven half spaces
Data Base of CSG
• The Database of CSG model stores its topology and
geometry.
• Topology is created via regularized set (Boolean)
operations that combine primitives.
• The geometry stored in the database of a CSG model
includes configuration parameters of its primitives and
rigid motion and transformation.
• Data structures of CSG representations are based on the
concept of graphs and trees.
Graph
• A graph is defined as a set of nodes connected by a set of
branches or lines.
• Each branch in a graph is specified by a pair of nodes.
• The set of nodes is A, B, C , D, E , F , G
• The set of branches or pairs is
A, B , A, C , B, C , B, E , B, F , B, G , C , D, C , E
These pairs are unordered, that is,
no relation exist between the
elements of each pair.
Pair A, B can also be B, A
Directed Graph or Digraph
Pairs of nodes that make up the branches are ordered pairs
Branches have directions and
arrows going from one node
to another.
The tail of each arrow
represents the first node in the
pair and its head represents the
second node.
The set of ordered pairs are
A, B , A, C , C , B , B, E , F , B , B, G, D, C, E, C
Path in Digraph
Each node in digraph has an
Indegree (number of arrow heads entering the
node)
Outdegree (number of arrow tails leaving the
node)
Path (sequence of nodes)
Node B has an indegree of 3 and an outdegree of 2 while node D has a
zero indegree and an outdegree of 1.
Each node in a digraph belongs to a path.
The path from node A to node G is A, B, G or A, C, B, G.
If the start and end nodes of a path are the same, the path is a cycle.
If a graph contains a cycle, it is cyclic; otherwise it is acyclic.
Tree
• A tree is defined as an acyclic digraph in which only a single
node, called the root, has a zero indegree and every other
node has an indegree of one.
• This implies that any node in the tree except the root has
predecessor or ancestors.
Node A is the root of the tree
and nodes E, F, G have node
B as their predecessor.
If the descendants of each
node are in order, then the tree
is an ordered one.
Binary and Inverted Binary Tree
• If the ordered tree has two descendants, the tree is called a
binary tree.
Any node in a tree that does not have
descendants, that is, with an out degree
equal to zero, is called a leaf node
(D,E,F,G).
Any node that does have descendants
(out degree greater than zero) is an
interior node (B,C).
If the arrow directions in a binary
tree are reversed such that every node,
except the root, in the tree has an out
degree of 1 and the root has a zero out
degree, the tree is called an inverted
binary tree.
Sub-Tree
Every node of a tree (T) is a root of another tree, called a sub tree
of T, contained in the original tree T.
The tree consists of seven nodes with
A as its root.
Its left sub tree is rooted at B and its
right sub tree is rooted at C.
The absence of a branch indicates an
empty sub tree.
The binary tree rooted at the leaves D,
E, F, G have empty left and right
sub trees.
Typical solid and its primitives
A block and a cylinder primitive are enough to create CSG model of the solid.
• A user can construct the CSG model using the following steps:
B1= block positioned properly
B2= block positioned properly
B3= block
B4= B3 moved properly in X direction
C1= cylinder positioned properly
C2= C1 moved properly in X direction
C3= cylinder positioned properly
C4= C3 moved properly in X direction
S1 B1 U *B3
S 2 S1 U *C1
S3 S 2 U *C3
S 4 B2 U *B4
S5 C2 U *S 4
S6 C4 U *S5
S S3 U *S6
CSG graph
S1 B1 U *B3
S 2 S1 U *C1
S3 S 2 U *C3
S 4 B2 U *B4
S5 C2 U *S 4
S6 C4 U *S5
S S3 U *S6
Data structure of a Primitive solid
• Create the CSG model of solid S as shown in the figure
Constructive Solid Geometry