Generative Components Principles Aug 2010 Volker Mueller Research

  • Slides: 87
Download presentation
Generative. Components Principles Aug. 2010 Volker Mueller Research Director

Generative. Components Principles Aug. 2010 Volker Mueller Research Director

Based on Ben Doherty’s “generative components theoretical frameworks the stuff you need to know”

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.

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

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,

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

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 GCCoordinate. System. 6 | WWW. BENTLEY. COM

Inputs 7 | WWW. BENTLEY. COM

Inputs 7 | WWW. BENTLEY. COM

comfortable here? image: Ben Doherty @ notionparallax. co. uk 8 | 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

…and here? image: Ben Doherty @ notionparallax. co. uk 9 | WWW. BENTLEY. COM

 image: Ben Doherty @ notionparallax. co. uk 10 | WWW. BENTLEY. COM brilliant!

image: Ben Doherty @ notionparallax. co. uk 10 | WWW. BENTLEY. COM brilliant!

So, what about here? They are pretty much the same! 11 | WWW. BENTLEY.

So, what about here? They are pretty much the same! 11 | WWW. BENTLEY. COM

Almost anything can go into this box. 5 Value Single values are easy to

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

Almost anything can go into this box. 5 Value Single values are easy to

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

BODMAS B ( ) Brackets first O Orders (Powers, Roots) DM / * Division

BODMAS B ( ) Brackets first O Orders (Powers, Roots) DM / * Division and Multiplication (left to right) AS + - Addition and Subtraction (left to right) Power: xy Root: 2 3 14 | WWW. BENTLEY. COM Pow(x, y) expl. x½ Pow(x, 0. 5) x Sqrt(x) x Pow(x, (1/3))

BODMAS B Brackets first O Orders (Powers, Roots) DM Division and Multiplication (left to

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

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 15 / 3 + 2 =7 (15 / 3) + 2 =7 16 | WWW. BENTLEY. COM IN COMPUTING, THERE ARE NEVER TOO MANY ROUND BRACKETS

5 Value 5+2 Simple expression Sin(5) Function (1/Sin(5)) + 90 Complex expression dave Named

5 Value 5+2 Simple expression Sin(5) Function (1/Sin(5)) + 90 Complex expression dave Named variable dave*2 Expression with named variable 17 | WWW. BENTLEY. COM dave = 8 Once a variable is defined (named) it can take on a value and be used in place of a value. Dave <> dave

This circle’s radius is defined using a single value. That is how you’d expect

This circle’s radius is defined using a single value. That is how you’d expect it to work from experience. 5 18 | WWW. BENTLEY. COM

This circle’s radius is defined using a list. Lists are really where the power

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

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

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,

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} [0] [1] [2] [3] [4] [5] [6] dave[4] = ? dave[4] = ‘E’ 22 | WWW. BENTLEY. COM Then we can refer to any item of that list individually by its index. Remember to count indices from 0.

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

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

0 24 | WWW. BENTLEY. COM

0 24 | WWW. BENTLEY. COM

Point A point is 0 dimensional. It has no size, volume, nothing. We use

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 Coordinate. System symbol. 25 | WWW. BENTLEY. COM

Point Its handles allow moving it using constraints. Moves can be constrained to the

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

1 27 | WWW. BENTLEY. COM

1 27 | WWW. BENTLEY. COM

Line If we have 2 points, there is a line that runs through them.

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

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

BSpline. Curve The math behind splines is complicated, but the geometric description is actually

BSpline. Curve 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

2 31 | WWW. BENTLEY. COM

2 31 | WWW. BENTLEY. COM

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

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

BSpline. Surfaces are in the class of 2 d objects, even though they can

BSpline. Surfaces are in the class of 2 d objects, even though they can exist in a 3 d space.

3 34 | WWW. BENTLEY. COM

3 34 | WWW. BENTLEY. COM

Solid There are lots of ways of making solids, but they are the only

Solid There are lots of ways of making solids, but they are the only truly 3 d objects in GC, as they have volume. That is not to say that the rest of the things are not 3 d, it is just a technical geometry distinction.

3>2>1 We can reduce dimensions, too. Solids intersected with a plane or surface produce

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 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

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

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!

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

Objects 41 | WWW. BENTLEY. COM

Almost everything we have seen so far is an object. Including input variables. dave

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

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

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. left. Leg. foot. shoesize = 9. 5 double some. right. Leg. foot. shoewidth = “wide” some. car. Driving. Licence = true object property dot operator 44 | WWW. BENTLEY. COM string bool(ean)

Types 45 | WWW. BENTLEY. COM

Types 45 | WWW. BENTLEY. COM

Data come in different kinds, like freight on a train. Each kind of freight

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

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

“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 Coordinate. System

GC Classes = Feature Types (selection) Point GC’s feature type point Plane Coordinate. System GC’s combination of point, directions, planes Direction GC’s “ray” Line Curve more general than Line, Arc, BSpline. Curve BSpline. Surface Solid User defined 49 | WWW. BENTLEY. COM You can define your own feature types

In GC, classes are called Feature Types. For GC features the behavior is mostly

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

Each Update Method has its specific inputs. How do we know what to enter in each input box? input. Name: type What is (repl. )? What is an “IPoint”? 51 | WWW. BENTLEY. COM

(repl. ) Replication One of the powers in GC 52 | 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

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. ) 2 54 | WWW. BENTLEY.

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

XTranslation: double (repl. ) {2, 4, 6, 8} [0] [1] [2] [3] YTranslation: double

XTranslation: double (repl. ) {2, 4, 6, 8} [0] [1] [2] [3] YTranslation: double (repl. ) 2 55 | WWW. BENTLEY. COM [0] [1] [2] [3]

XTranslation: double (repl. ) {2, 4, 6, 8} [0] [1] [2] [3] YTranslation: double

XTranslation: double (repl. ) {2, 4, 6, 8} [0] [1] [2] [3] YTranslation: double (repl. ) {2, 4, 6, 8} [0] [1] [2] [3] 56 | WWW. BENTLEY. COM [0] [1] [2] [3]

XTranslation: double (repl. ) {2, 4, 6, 8, 10, 12} [0] [1] [2] [3]

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. Option. Corresponding. Indexing 57 | WWW. BENTLEY. COM

XTranslation: double (repl. ) [0][3] [1] [3] [2] [3] [3] [4] [3] [5] [3]

XTranslation: double (repl. ) [0][3] [1] [3] [2] [3] [3] [4] [3] [5] [3] [0][2] [1] [2] [2] [3] [2] [4] [2] [5] [2] [0][1] [1] [2] [1] [3] [1] [4] [1] [5] [1] [0][0] [1] [0] [2] [0] [3] [0] [4] [0] [5] [0] {2, 4, 6, 8, 10, 12} [0] [1] [2] [3] [4] [5] YTranslation: double (repl. ) {2, 4, 6, 8} [0] [1] [2] [3] Toggle Replication. Option. All. Combinations 58 | WWW. BENTLEY. COM

Observations: As in the geometry itself, there is dimensionality in the data, too. 1

Observations: As in the geometry itself, there is dimensionality in the data, too. 1 singleton Point 0 d 1 repl. parameter 1 d 2 repl. parameters AND Corresponding. Indexing 1 d 2 repl. parameters AND All. Combinations 2 d 3 repl. parameters AND All. Combinations 3 d n repl. parameters AND All. Combinations nd 59 | WWW. BENTLEY. COM

Observations: Lists use nested Curly Brackets {} to indicate dimensionality of their nesting (property:

Observations: Lists use nested Curly Brackets {} to indicate dimensionality of their nesting (property: List. Rank). 0 d a 1 1 d {a 1, a 2, a 3} 2 d {{a 1, a 2, a 3}, {b 1, b 2}, {c 1, c 2, c 3, c 4}} 3 d {{{a 1, a 2, a 3, a 4, a 5}, {b 1, b 2}}, {{{c 1, c 2, c 3}, {d 1, d 2, d 3, d 4, d 5, d 6}}, {{{e 1}, {f 1, f 2}, {g 1, g 2}}, {{{h 1, h 2, h 3, h 4}, {i 1, i 2, i 3}, {j 1, j 2}}} 60 | WWW. BENTLEY. COM

Type Casting and Interfaces *) Also courtesy of dot Net Framework, Microsoft 61 |

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,

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

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. Coordinate. System is

Plane is like a Point because of X, Y, Z location. Coordinate. System 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

Relationships 65 | WWW. BENTLEY. COM

Generally we are much less interested in numeric descriptions of where things are, and

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

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

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

Spaces 69 | WWW. BENTLEY. COM

Cartesian space Unless you are a quantum physicist or a theoretical mathematician, 3 dimensional

Cartesian space Unless you are a quantum physicist or a theoretical mathematician, 3 dimensional 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 2 d space, i. e. on a plane,

In Euclidian space (originally defined in 2 d 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) 2 d “spaces”. In 3 d,

On the surface, Euclidian (top) and non-Euclidian (bottom) 2 d “spaces”. In 3 d, 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. Line. End. Point T = 1. 0

Parameter Space This is an embedded space. Line. End. Point T = 1. 0 T = 0. 35 Line. Start. Point T = 0. 0 From within the line the universe only extends as far as the end of the line. This space is defined as 1 unit (of self), regardless of its size externally. The parameter is the T value 73 | WWW. BENTLEY. COM

T = 1. 0 T = 0. 75 T = 0. 25 T =

T = 1. 0 T = 0. 75 T = 0. 25 T = 0. 0 74 | WWW. BENTLEY. COM T = 0. 5 While on a Line the T-parameter space is homogenous, this is not the case for BSpline. Curves. T = 0. 5 is not necessarily the geometric centre, it is the parametric centre. Parametric distances between control points are equal, if they are equally weighted…

The analog is true for surfaces, with the 2 d parameter space being a

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

A UV coordinate tuple {0. 2, 0. 7} can be sampled into an XYZ

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. By. Parameters On. Surface(). 0 U = 1. 0 0. UV = {0. 2, 0. 7} XYZ = {70, 3. 969} V = 1. 0 0 0 76 | WWW. BENTLEY. COM 0. = 0 = V = U U 0. U = 1. One way to think about how UV parametric space deals 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.

There also update methods using cylindrical or spherical coordinate systems. These are handy for

There 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

Multiple Spaces 78 | WWW. BENTLEY. COM

Radius = x * val T=x 79 | WWW. BENTLEY. COM By using parallel

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

Spline Geometry 80 | WWW. BENTLEY. COM

Spline Geometry 80 | WWW. BENTLEY. COM

Splines are very ‘cool’, but they are not easily buildable; therefore, contractors and manufacturers

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

P 1 linear degree = 1 order = 2 P 1 P 0 Q

P 1 linear degree = 1 order = 2 P 1 P 0 Q 0 t’ Q 1 t’ P 0 t’ Q 0 t’ quadratic degree = 2 order = 3 P 1 P 3 Q 1 P 2 t’ R 1 t’ t’ R 0 cubic degree = 3 order = 4 P 0 P 1 Q 0 t’ t’ R 0 S 0 Q 2 t’ Q 1 P 2 t’ R 1 S 1 P 0 R 2 t’ Q 2 t’ P 2 82 | WWW. BENTLEY. COM P 3 t’ Q 3 quadric degree = 4 P 4 order = 5 The order of a B-spline refers to how many control points each segment looks to for it’s shape, i. e. the minimum number of points for a B -spline of degree (order - 1). An order 2 B-spline is a straight line (degree 1). The degree of a B-spline indicates the highest exponent in the system of equations. These diagrams explain the construction of Bezier curves.

The third order spline is tangent to all of the segments of the control

The third order spline is tangent to all of the segments of the control frame. 4 th and 5 th are less easy to visualize in their construction. 5 4 3 2 83 | WWW. BENTLEY. COM

Some Recommended Reading 84 | WWW. BENTLEY. COM

Some Recommended Reading 84 | WWW. BENTLEY. COM

85 | WWW. BENTLEY. COM

85 | WWW. BENTLEY. COM

THANKS TO Ben Doherty at MANY notionparallax. co. uk for the idea & approach,

THANKS TO Ben Doherty at MANY 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

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