You are on page 1of 87

GenerativeComponents

Principles
Aug. 2010

Volker Mueller
Research Director
Based on Ben Doherty’s
“generative components
theoretical frameworks
the stuff you need to know”
www.notionparallax.co.uk
Grounding in Space
one fixed point in space
with orientation etc.

3 | WWW.BENTLEY.COM
Theoretical
geometry gives us
an infinite universe
to work in. There is
no concept of up, or
of where we are in a
finite sense.
To make this work
for us, we pick a
spot and call it the
‘origin’.

4 | WWW.BENTLEY.COM
The way of
describing space
that is most
common is the
Cartesian grid
({X,Y,Z} triples)
The positive part of
the Z axis can be
considered ‘up’, as
is the convention in
building design.

5 | WWW.BENTLEY.COM
Thus we have an
origin (location) and
3 axes that define…
3 planes that are all
at 90 degrees to
each other.
(The yellow line
indicates the currently
active plane).

This is a GC-
CoordinateSystem.

6 | WWW.BENTLEY.COM
Inputs

7 | WWW.BENTLEY.COM
comfortable here?

image: Ben Doherty @ notionparallax.co.uk

8 | WWW.BENTLEY.COM
…and here?

image: Ben Doherty @ notionparallax.co.uk

9 | WWW.BENTLEY.COM
 brilliant!

image: Ben Doherty @ notionparallax.co.uk

10 | WWW.BENTLEY.COM
So, what about
here?

They are pretty


much the same!

11 | WWW.BENTLEY.COM
Almost anything can
go into this box.
Single values are
5 Value easy to understand.

Simple Simple computations


5+2 expression are easy, too.
Scientific calculator
Sin(5) Function stuff can be found in
the function list.

fx
12 | WWW.BENTLEY.COM
Almost anything can
go into this box.
Single values are
5 Value easy to understand.
Simple computations
5+2
Simple
expression are easy, too.
Scientific calculator
Sin(5) Function stuff can be found in
the function list.
Complex
(1/Sin(5)) + 90 expression Compound
statements follow
BODMAS

13 | WWW.BENTLEY.COM
BODMAS

B ( ) Brackets first
O Orders (Powers, Roots)
DM / * Division and Multiplication (left to right)
AS + - Addition and Subtraction (left to right)

Power: xy  Pow(x,y) expl. x½  Pow(x,0.5)


2
Root: x  Sqrt(x)
3
x  Pow(x,(1/3))

14 | WWW.BENTLEY.COM
BODMAS

B Brackets first
O Orders (Powers, Roots)
DM Division and Multiplication (left to right)
AS Addition and Subtraction (left to right)

15 / (3 + 2) =?
15 / 3 + 2 =?
(15 / 3) + 2 =?

15 | WWW.BENTLEY.COM
BODMAS

B Brackets first
O Orders (Powers, Roots)
DM Division and Multiplication (left to right)
AS Addition and Subtraction (left to right)

15 / (3 + 2) =3
IN COMPUTING, THERE
15 / 3 + 2 =7 ARE NEVER TOO MANY
(15 / 3) + 2 =7 ROUND BRACKETS

16 | WWW.BENTLEY.COM
5 Value dave = 8

5+2
Simple
expression
Once a variable is
defined (named) it
Sin(5) Function
can take on a value
and be used in place
Complex
of a value.
(1/Sin(5)) + 90 expression
Dave <> dave

dave Named variable

Expression with
dave*2 named variable
17 | WWW.BENTLEY.COM
This circle’s radius
is defined using a
single value.
That is how you’d
expect it to work
from experience.

18 | WWW.BENTLEY.COM
This circle’s radius
is defined using a
list.
Lists are really
where the power of
GC kicks in.

{3,4,4.5,5}

19 | WWW.BENTLEY.COM
Type
{,,,,,,} ‘Curly Brackets’ { }
to define a list.
Things in a list are
indexed from 0.

[0] [1] [2] [3] [4]


Indexing uses
‘Square Brackets’ [ ]
List length counts
how many items are
in the list, starting
with 1 (here it is 5).

20 | WWW.BENTLEY.COM
Lists can have empty
containers (null).

[0] [1] [2] [3] [4]

Lists can be of
different types.

21 | WWW.BENTLEY.COM
If we declare a
variable called
‘dave’ as a list
having the contents
{A,B,C,D,E,F,G}
dave = {A,B,C,D,E,F,G} Then we can refer
to any item of that
[0] [1] [2] [3] [4] [5] [6] list individually by
its index.
Remember to count
dave[4] = ? indices from 0.

dave[4] = ‘E’

22 | WWW.BENTLEY.COM
Changing Dimensions
…increasing and reducing geometric dimensionality

23 | WWW.BENTLEY.COM
24 | WWW.BENTLEY.COM
Point
A point is 0
dimensional.
It has no size,
volume, nothing.
We use a symbol for
it, so that we can
see it.
The Point symbol is
different from the
CoordinateSystem
symbol.

25 | WWW.BENTLEY.COM
Point
Its handles allow
moving it using
constraints.
Moves can be
constrained to the
X,Y, and Z axes,
respectively.
Using the angular
handles moves are
constrained to the
respective planes.

26 | WWW.BENTLEY.COM
27 | WWW.BENTLEY.COM
Line
If we have 2 points,
there is a line that
runs through them.
Strictly, lines are
infinite, and line
segments are
bounded, but
common usage
refers to bounded
segments as lines.

28 | WWW.BENTLEY.COM
Arc, Curves
…are a bit more
complicated to
define.

29 | WWW.BENTLEY.COM
BSplineCurve
The math behind
splines is
complicated, but the
geometric
description is
actually quite easy.
This is one of the
reasons why they
are used frequently.

30 | WWW.BENTLEY.COM
31 | WWW.BENTLEY.COM
Plane
3 points define a
plane.
Planes are infinite.

32 | WWW.BENTLEY.COM
BSplineSurface
Surfaces are in the
class of 2d objects,
even though they
can exist in a 3d
space.
34 | WWW.BENTLEY.COM
Solid
There are lots of
ways of making
solids, but they are
the only truly 3d
objects in GC, as
they have volume.
That is not to say that
the rest of the things
are not 3d, it is just a
technical geometry
distinction.
3>2>1
We can reduce
dimensions, too.
Solids intersected
with a plane or
surface produce a
closed curve.
3>2>1
Surfaces intersected
with a plane or
surface produce an
open curve
(usually).
3>2>1>0
Curve to curve
intersections
produce points.
Be careful of extra
points!
Circles and other
curves are known
for this problem.
3>2>1>0
Curve curve
intersections
produce points.
Be careful of extra
points!
Circles are classic
for this problem.
3>2>1>0
Curve curve
intersections
produce points.
Be careful of extra
points!
Or no points!
Circles are classic
for this problem.
Objects

41 | WWW.BENTLEY.COM
Almost everything
we have seen so far
is an object.
Including input
variables.

dave = 8

In computing,
objects are not
equal.
They have Type.

42 | WWW.BENTLEY.COM
Properties
Courtesy of dot Net Framework, Microsoft

43 | WWW.BENTLEY.COM
Objects have properties
they can be values, or sub-objects
either way, they have a type
the ”dot” operator accesses an object’s properties
Type
some.name = “john” string
some.leftLeg.foot.shoesize = 9.5 double
some.rightLeg.foot.shoewidth = “wide” string
some.carDrivingLicence = true bool(ean)

object property
dot operator
44 | WWW.BENTLEY.COM
Types

45 | WWW.BENTLEY.COM
Data come in
different kinds, like
freight on a train.
Each kind of freight
requires a matching
kind of freight car.
Computers are
similarly picky, they
only deal with what
they have been
prepared to handle.
So a type is a kind,
a breed, a species,
a flavor of data.

46 | WWW.BENTLEY.COM
Object-oriented computing implements the idea
that data and their methods, the pieces of
program that manipulate these data, are bundled
in packages.
The general term for this is Class, i.e. a Class is a
data type that includes the methods.
Methods determine how objects behave.
We’ll ignore for now other characteristics of OOPS.

47 | WWW.BENTLEY.COM
“Simple” Variable Types (selection)

bool (Boolean) Answer to a logical question (true, false)


int (integer) Whole numbers (0, 5, -4, 1000, -500)
double Real or decimal numbers(0.5, -7.8 ,15.0, 158.5436)
string Some text (“hello world”, “450”, “dave”)

48 | WWW.BENTLEY.COM
GC Classes = Feature Types (selection)

Point GC’s feature type point


Plane
CoordinateSystem GC’s combination of point, directions, planes
Direction GC’s “ray”
Line
Curve more general than Line, Arc, BSplineCurve
BSplineSurface
Solid
User defined You can define your own feature types

49 | WWW.BENTLEY.COM
In GC, classes are
called Feature
Types.
For GC features the
behavior is mostly
generative. It is
important to us how
a feature gets first
generated and
subsequently
updated.
For simplicity, GC
calls these methods
Update Methods.

50 | WWW.BENTLEY.COM
Each Update Method
has its specific
inputs.
How do we know
what to enter in
each input box?

inputName: type

What is (repl.)?
What is an “IPoint”?

51 | WWW.BENTLEY.COM
(repl.)  Replication
One of the powers in GC

52 | WWW.BENTLEY.COM
This circle’s radius
is defined using a
list.

{3,4,4.5,5}

1 radius  1 circle
4 radii  4 circles
= replication
(repl.) = replicatable

53 | WWW.BENTLEY.COM
XTranslation: double (repl.)

2
YTranslation: double (repl.)

54 | WWW.BENTLEY.COM
XTranslation: double (repl.)

{2,4,6,8}
[0] [1] [2] [3] [0] [1] [2] [3]

YTranslation: double (repl.)

55 | WWW.BENTLEY.COM
XTranslation: double (repl.)

{2,4,6,8}
[0] [1] [2] [3] [0] [1] [2] [3]

YTranslation: double (repl.)

{2,4,6,8}
[0] [1] [2] [3]

56 | WWW.BENTLEY.COM
XTranslation: double (repl.)

{2,4,6,8,10,12}
[0] [1] [2] [3] [4] [5] [0] [1] [2] [3]

YTranslation: double (repl.)

{2,4,6,8}
[0] [1] [2] [3]

Toggle Replication
ReplicationOption.CorrespondingIndexing

57 | WWW.BENTLEY.COM
[0][3] [1] [3] [2] [3] [3] [3] [4] [3] [5] [3]

[0][2] [1] [2] [2] [2] [3] [2] [4] [2] [5] [2]

XTranslation: double (repl.)


[0][1] [1] [1] [2] [1] [3] [1] [4] [1] [5] [1]

{2,4,6,8,10,12}
[0] [1] [2] [3] [4] [5] [0][0] [1] [0] [2] [0] [3] [0] [4] [0] [5] [0]

YTranslation: double (repl.)

{2,4,6,8}
[0] [1] [2] [3]

Toggle Replication
ReplicationOption.AllCombinations

58 | WWW.BENTLEY.COM
Observations:
As in the geometry itself, there is dimensionality in the data,
too.
1 singleton Point  0d
1 repl. parameter  1d
2 repl. parameters AND CorrespondingIndexing  1d
2 repl. parameters AND AllCombinations  2d
3 repl. parameters AND AllCombinations  3d
n repl. parameters AND AllCombinations  nd

59 | WWW.BENTLEY.COM
Observations:
Lists use nested Curly Brackets {} to indicate dimensionality
of their nesting (property: List.Rank).
0d  a1
1d  {a1,a2,a3}
2d  {{a1,a2,a3},{b1,b2},{c1,c2,c3,c4}}
3d  {{{a1,a2,a3,a4,a5},{b1,b2}},
{{{c1,c2,c3},{d1,d2,d3,d4,d5,d6}},
{{{e1},{f1,f2},{g1,g2,g2}},
{{{h1,h2,h3,h4},{i1,i2,i3},{j1,j2}}}

60 | WWW.BENTLEY.COM
*)
Type Casting and Interfaces
*)
Also courtesy of dot Net Framework, Microsoft

61 | WWW.BENTLEY.COM
Object-oriented computing is very strict about
membership in a class or feature type.
However, you can sometimes stuff one data type
into another slot (casting) but the type is generally a
good hint as to what is required.
There are some specific casting functions.
In GC, casting works only for simple variable types,
not for feature types.

62 | WWW.BENTLEY.COM
Interfaces draw on
similar properties
and methods of
feature types to let
us use one feature
type in place of
another one.
This softens the
class boundaries for
more flexible
modeling options.
Interfaces are
prefixed with an “I”.

63 | WWW.BENTLEY.COM
Plane is like a Point
because of X,Y,Z
location.
CoordinateSystem is
like a Point because
of X,Y,Z location.
Plane is like a
Direction because of
Plane’s normal
vector.
Etc.

64 | WWW.BENTLEY.COM
Relationships

65 | WWW.BENTLEY.COM
Generally we are
much less
interested in
numeric
descriptions of
where things are,
and how big they
are.
We are much more
into relationships.
The coffee is
constrained in the
cup.

image: Ben Doherty @ notionparallax.co.uk

66 | WWW.BENTLEY.COM
In a normal CAD
program, even if we
put the coffee in the
place that is inside
the cup, it’s just
numerically defined
as being there.
If we move the cup
then the coffee
remains where it
was placed initially,
partially or entirely
outside the cup.

image: Ben Doherty @ notionparallax.co.uk

67 | WWW.BENTLEY.COM
In a relational
system, when we
move the cup, the
coffee moves.
In a relational
system we
build
relationships
and behaviors.

i.e. relations and


dependencies not
one-off specifics.
image: Ben Doherty @ notionparallax.co.uk

68 | WWW.BENTLEY.COM
Spaces

69 | WWW.BENTLEY.COM
Cartesian space
Unless you are a
quantum physicist
or a theoretical
mathematician,
3dimensional
Cartesian space is
all you will ever
need (almost).
Descartes added the
orthogonal
coordinate system
to the principled
Euclidian space.

70 | WWW.BENTLEY.COM
In Euclidian space
(originally defined in
2d space, i.e. on a
plane, eg. a sheet of
paper) there are
straight lines that
can be parallel.
In non-Euclidian
space (eg.the
surface of a
sphere), Euclidian
rules do not apply,
for example, there
are no straight lines
(but arcs, circles,
curves).

71 | WWW.BENTLEY.COM
On the surface,
Euclidian (top) and
non-Euclidian
(bottom)
2d “spaces”.

In 3d, these are


curved surfaces,
which would
peacefully coexist or
intersect with any
straight lines
through space…

72 | WWW.BENTLEY.COM
Parameter Space
This is an
embedded space.
From within the line
Line.EndPoint the universe only
T = 1.0 extends as far as
the end of the line.
T = 0.35
This space is
defined as 1 unit
Line.StartPoint (of self),
T = 0.0
regardless of its
size externally.
The parameter is
the T value

73 | WWW.BENTLEY.COM
While on a Line the
T-parameter space
is homogenous, this
T = 1.0
is not the case for
BSplineCurves.
T = 0.5 is not
necessarily the
T = 0.75 geometric centre, it
T = 0.5
is the parametric
T = 0.25
centre.
Parametric
distances between
T = 0.0
control points are
equal, if they are
equally weighted…

74 | WWW.BENTLEY.COM
The analog is true
for surfaces, with
the 2d parameter
space being a 1 by
1 “square”.
Instead of the
Cartesian 3d XYZ
coordinates they are
2d UV coordinates.

75 | WWW.BENTLEY.COM
A UV coordinate
tuple {0.2, 0.7} can
be sampled into an
XYZ coordinate
triplet {x,y,z}, for
example by placing
a
Point.ByParameters
OnSurface().
One way to think about how
UV = {0.2,0.7} UV parametric space deals
XYZ = {70,30,3.969} with distortion is to draw a
grid on a balloon and then
blow it up & squeeze it about
a bit. The grid changes shape,
but the relationships
(topology) stay the same.

76 | WWW.BENTLEY.COM
There are also
update methods
using cylindrical or
spherical coordinate
systems.
These are handy for
cylindrical and
spherical things, but
also for survey
data.

77 | WWW.BENTLEY.COM
Multiple Spaces

78 | WWW.BENTLEY.COM
By using parallel
representations of
Radius = x * val
your geometry it’s
T=x possible to build
control rigs,
analysis
dashboards,
alternative models
that exhibit different
behaviors, like
fabrication models,
etc.

79 | WWW.BENTLEY.COM
Spline Geometry

80 | WWW.BENTLEY.COM
Splines are very ‘cool’,
but they are not easily
buildable; therefore,
contractors and
manufacturers are a bit
worried about them.
Splines were developed
independently by a pair
of French automotive
engineers – Pierre
Étienne Bézier at
5 Renault and Paul de
4 Casteljau at Citroën –
3 working on early CAD
systems back in the
2
1960s.
They take some
understanding to do
them right!

81 | WWW.BENTLEY.COM
P1
linear
The order of a B-spline
degree = 1
refers to how many
order = 2
control points each
P1 segment looks to for it’s
P0
t’
shape, i.e. the minimum
Q1
quadratic number of points for a
degree = 2 B-spline of degree
Q0
t’
order = 3 (order - 1).
P0 t’
P1 An order 2 B-spline is a
P3 straight line (degree 1).
Q1P2 cubic
t’ R1
t’ t’ degree = 3 The degree of a B-spline
Q0 R0
t’ order = 4 indicates the highest
P0
exponent in the system
P1 Q2
t’
of equations.
P3
Q1 P2 t’ Q
t’ R 3 These diagrams explain
quadric
the construction of
t’ t’ 1
t’ S1
Q0 R0 S0
degree = 4
t’ P4 Bezier curves.
P0 R2 order = 5
t’
Q2
t’
P2
82 | WWW.BENTLEY.COM
The third order
spline is tangent to
all of the segments
of the control
frame.
4th and 5th are less
easy to visualize in
their construction.

5
4
3
2

83 | WWW.BENTLEY.COM
Some Recommended Reading

84 | WWW.BENTLEY.COM
85 | WWW.BENTLEY.COM
THANKS TO
MANY
Ben Doherty at
notionparallax.co.uk
for the idea & approach, > 65% of text, some imagery, etc.

86 | WWW.BENTLEY.COM
Questions?
Contact: volker.mueller@bentley.com

87 | WWW.BENTLEY.COM

You might also like