Geometric Programming for Computer-Aided Design

10
Geometric Programming for Computer-Aided Design Alberto Paoluzzi Dip. Informatica e Automazione, Universit`a Roma Tre, Rome Italy with contributions from Valerio Pascucci Center for Applied Scientific Computing, L. Livermore National Laboratory, California Michele Vicentino WIND Telecomunicazioni Spa, Fraud Management System, Rome Claudio Baldazzi Saritel Spa, Internet Platforms for Service Providers, Pomezia, Rome and Simone Portuesi Dip. Informatica e Automazione, Universit`a Roma Tre, Rome JOHN WILEY & SONS Chichester . New York . Brisbane . Toronto . Singapore

Transcript of Geometric Programming for Computer-Aided Design

Geometric Programmingfor Computer-Aided Design

Alberto PaoluzziDip. Informatica e Automazione, Universita Roma Tre, Rome Italy

with contributions from

Valerio PascucciCenter for Applied Scientific Computing, L. Livermore National Laboratory, California

Michele VicentinoWIND Telecomunicazioni Spa, Fraud Management System, Rome

Claudio BaldazziSaritel Spa, Internet Platforms for Service Providers, Pomezia, Rome

and

Simone PortuesiDip. Informatica e Automazione, Universita Roma Tre, Rome

JOHN WILEY & SONSChichester . New York . Brisbane . Toronto . Singapore

Contents

Preface xviiBook roadmap xviiiAcknowledgements xix

I Programming and Geometry xxi

1 Introduction to FL and PLaSM 11.1 Introduction to symbolic design programming 2

1.1.1 Computational model 31.2 Getting started with PLaSM 4

1.2.1 Installing the language 41.2.2 Using the language 6

1.3 Programming at Function Level 101.3.1 Elements of FL syntax 101.3.2 Combining forms and functions 11

1.4 Basics of PLaSM programming 151.4.1 Expressions 151.4.2 User-defined functions 161.4.3 Built-in functions 17

1.5 Geometric operators 231.5.1 Pre-defined geometric operators 23

1.6 Examples 371.6.1 First programs 371.6.2 Further examples 411.6.3 Virtual Manhattan 431.6.4 Virtual skyscraper 451.6.5 Roof of S. Stefano Rotondo 46

1.7 Annotated references 47

2 Geometric programming 512.1 Basic programming 51

2.1.1 Some operations on numbers 522.1.2 Set operations 592.1.3 Vector and matrix operations 61

viii CONTENTS

2.1.4 String and character operations 642.1.5 Other examples 672.1.6 Pipeline paradigm 72

2.2 Basic geometric programming 732.2.1 Primitive shapes 732.2.2 Non-primitive shapes (simplicial maps) 76

2.3 Assembling shapes 842.3.1 Primitive alignments 842.3.2 Relative arrangements 86

2.4 Examples 882.4.1 Parametric nut stack 882.4.2 Hierarchical temple 89

3 Elements of linear algebra 953.1 Vector spaces 95

3.1.1 Bases and coordinates 973.1.2 PLaSM representation of vectors 97

3.2 Affine spaces 993.2.1 Operations on vectors and points 1003.2.2 Positive, affine and convex combinations 1003.2.3 Linear, affine and convex independence 1023.2.4 Convex coordinates 1043.2.5 Euclidean spaces 106

3.3 Linear transformations and tensors 1083.3.1 Tensor operations 1093.3.2 Coordinate representation 1123.3.3 PLaSM matrix representation 1133.3.4 Determinant and inverse 1183.3.5 Orthogonal tensors 1193.3.6 PLaSM representation of tensors 120

4 Elements of polyhedral geometry 1234.1 Basic concepts 1234.2 Convex sets 125

4.2.1 Positive, affine and convex hulls 1254.2.2 Support, separation, extreme points 1294.2.3 Duality 1304.2.4 Boundary structure 132

4.3 Polyhedral sets 1334.3.1 Extremal points 1334.3.2 Double description 134

4.4 Polytopes 1354.4.1 Examples of polytopes 1354.4.2 Faces of polytopes 1404.4.3 Projection 142

4.5 Simplicial complexes 1444.5.1 Definitions 144

CONTENTS ix

4.5.2 Linear d-Polyhedra 1474.5.3 Fractal d-simplex 148

4.6 Polyhedral complexes 1494.6.1 Schlegel diagrams 152

4.7 Nef polyhedra 1534.7.1 Locally adjoined pyramids 1544.7.2 Faces of Nef polyhedra 156

4.8 Linear programming 1564.8.1 Geometry of linear programming 1584.8.2 Simplex method 1584.8.3 Some polyhedral algorithms 161

4.9 Examples 1634.9.1 Platonic solids 163

4.10 References 168

5 Elements of differential geometry 1695.1 Curves 169

5.1.1 Variable-free notation 1705.1.2 Reparametrization 1745.1.3 Orientation 175

5.2 Differentiation 1765.2.1 Real-valued maps of a real variable 1765.2.2 Vector-valued maps of a real variable 1805.2.3 Real-valued maps of several real variables 1835.2.4 Vector-valued maps of several real variables 1865.2.5 Generalized implementation 188

5.3 Fields and differential operators 1895.3.1 Gradient 1895.3.2 Divergence and Laplacian 1915.3.3 Curl 1925.3.4 Gradient, divergence and curl of a 3D field 192

5.4 Differentiable manifolds 1945.4.1 Charts and atlases 1955.4.2 Differentiable manifolds 1955.4.3 Tangent spaces and maps 198

5.5 Derivatives of a curve 1985.6 Examples 2005.7 Intrinsic properties of a surface 205

5.7.1 First fundamental form 2085.7.2 Second fundamental form 2105.7.3 Gauss curvature 211

5.8 Examples 2125.8.1 Color map of the Gauss curvature field 212

x CONTENTS

II Graphics 215

6 Affine transformations 2176.1 Preliminaries 217

6.1.1 Transformations 2176.1.2 Points and vectors 2186.1.3 Orientations and rotations 2196.1.4 Homogeneous coordinates 219

6.2 2D Transformations 2216.2.1 Translation 2216.2.2 Scaling 2246.2.3 Reflection 2266.2.4 Rotation 2276.2.5 Shearing 2326.2.6 Generic transformation 2336.2.7 Tensor properties 2346.2.8 Fixed point transformations 236

6.3 3D Transformations 2376.3.1 Elementary transformations 2376.3.2 Rotations 2406.3.3 Rotations about affine axes 2436.3.4 Algebraic properties of rotations 243

6.4 PLaSM implementation 2466.4.1 Pre-defined affine tensors 2466.4.2 User-defined affine tensors 249

6.5 Examples 2506.5.1 Modeling applied 3D vectors and reference frames 250

7 Graphic primitives 2577.1 Some background 257

7.1.1 GKS 2577.1.2 PHIGS 2597.1.3 Open GL 2607.1.4 Open INVENTOR 2617.1.5 VRML 2627.1.6 Java 3D 263

7.2 Basic primitives 2657.2.1 Points 2657.2.2 Polyline 2667.2.3 Polymarker 2697.2.4 Text 2727.2.5 Triangle strip 2777.2.6 Triangle fan 2797.2.7 Quadrilateral mesh 281

7.3 Quotient set of polylines 2847.3.1 Basic definitions 2857.3.2 Interpolation of shapes 291

CONTENTS xi

7.3.3 Shape compatibility 2957.3.4 Shape resemblance 298

7.4 Examples 2997.4.1 Quadrilateral array with holes 300

7.5 Annotated references 302

8 Hierarchical structures 3038.1 Hierarchical graphs 303

8.1.1 Local coordinates and modeling transformation 3048.2 Hierarchical structures 305

8.2.1 Hierarchical structures in PLaSM 3068.2.2 Assembly using global coordinates 3078.2.3 Assembly with local coordinates 308

8.3 Traversal 3088.4 Implementations 310

8.4.1 Structure network in PHIGS 3108.4.2 Hierarchical scene graph in VRML 311

8.5 Examples 3158.5.1 Living room modeling 3158.5.2 Body model 3208.5.3 Umbrella modeling (1): structure 3238.5.4 Tree diagrams 3258.5.5 Array of aligned graphics symbols 328

9 Graphic pipelines 3339.1 2D pipeline 333

9.1.1 Coordinate systems 3339.1.2 Normalization and device transformations 3359.1.3 Window-viewport mapping 336

9.2 3D pipeline 3399.2.1 View model 3409.2.2 Coordinate systems 3419.2.3 Transformations of coordinates 3429.2.4 View orientation 3449.2.5 View mapping 3459.2.6 Perspective transformation 3509.2.7 Workstation transformation 351

9.3 Other implementations 3539.3.1 Scalable vector graphics (SVG) 3559.3.2 Open Inventor camera model 3579.3.3 Java 3D viewing model 357

9.4 Examples 3599.4.1 PHIGS! pipeline display 3599.4.2 VRML camera implementation 361

10 Viewing and rendering 36710.1 View-model 367

xii CONTENTS

10.1.1 View parameters 36910.1.2 View volume 370

10.2 Taxonomy of projections 37110.2.1 Perspective 37110.2.2 Parallel 374

10.3 Hidden-surface removal 38210.3.1 Introduction 38210.3.2 Pre-processing 38310.3.3 Scene coherence 38610.3.4 Back-to-front and front-to-back 39210.3.5 Binary Space Partition 39210.3.6 HSR algorithms in image-space 396

10.4 Illumination models 39810.4.1 Diffuse light 40010.4.2 Specular reflection 401

10.5 Color models 40410.6 Shading models 41210.7 VRML rendering 416

10.7.1 Illumination 41710.7.2 Color 42010.7.3 Shading 42110.7.4 Textures 42310.7.5 PLaSM lighting 42410.7.6 PLaSM texturing 426

10.8 Examples 43310.8.1 Orthogonal projection on any viewplane 43310.8.2 Model of example house 43310.8.3 Cell extraction 43510.8.4 Exploded views 43710.8.5 Standard view models 437

10.9 Annotated references 438

III Modeling 439

11 Parametric curves 44111.1 Curve representations 44111.2 Polynomial parametric curves 444

11.2.1 Linear curves 44611.2.2 Quadratic curves 44811.2.3 Cubic curves 44911.2.4 Higher-order Bezier curves 455

11.3 Polynomial splines 45911.3.1 Cubic cardinal splines 45911.3.2 Cubic uniform B-splines 46111.3.3 Non-uniform polynomial B-splines 46511.3.4 Multiresolution Bezier and B-splines 470

CONTENTS xiii

11.4 Rational curves and splines 47211.4.1 Rational Bezier curves 47311.4.2 NURBS 474

11.5 Examples 47811.5.1 Shape design with a NURB spline 47811.5.2 Umbrella modeling (2): curved rods 480

11.6 Splines implementation 48011.6.1 Cubic uniform splines 48111.6.2 Non-uniform B-splines 48611.6.3 Non-uniform rational B-splines 494

12 Parametric surfaces and solids 49712.1 Introduction 497

12.1.1 Parametric representation 49812.2 Notable surface classes 499

12.2.1 Profile product surfaces 49912.2.2 Ruled surfaces 50312.2.3 Cylinders and cones 505

12.3 Tensor product surfaces 50812.3.1 Bilinear and biquadratic surfaces 51112.3.2 Bicubic surfaces 51412.3.3 Fixed-degrees tensor product surfaces 52112.3.4 NURB surfaces 523

12.4 Higher-order tensor products 52312.4.1 Multivariate Bezier manifolds 523

12.5 Transfinite methods 52712.5.1 Rationale of the approach 52712.5.2 Univariate case 52912.5.3 Multivariate case 52912.5.4 Transfinite Bezier 53112.5.5 Transfinite Hermite 53312.5.6 Connection surfaces 53312.5.7 Coons’ surfaces 53612.5.8 Thin solids generated by surfaces 539

12.6 Examples 54012.6.1 Umbrella modeling (3): tissue canvas 54112.6.2 Helicoidal spiral volume 54312.6.3 Roof design for a sports building 54712.6.4 Constrained connection volume 548

13 Basic solid modeling 55513.1 Representation scheme 555

13.1.1 Definition and properties 55613.1.2 Taxonomy of representation schemes 559

13.2 Enumerative schemes 56013.2.1 Flat enumerative schemes 56013.2.2 Hierarchical enumerative schemes 562

xiv CONTENTS

13.3 Decompositive schemes 56313.3.1 Simplicial schemes 56413.3.2 Convex-cell partitioning and covering 564

13.4 Constructive Solid Geometry 56913.5 Boundary schemes 570

13.5.1 Adjacency and incidence relations 57213.5.2 Euler equation 57313.5.3 Edge-based schemes 57413.5.4 Facet-based schemes 57713.5.5 Mass and inertia properties 586

13.6 Examples 59213.6.1 Umbrella modeling (4): solid parts 592

14 Dimension-independent PLaSM operators 59514.1 Inside Hierarchical Polyhedral Complexes 59514.2 Boolean operations 600

14.2.1 Algorithm 60114.2.2 Optimizing by pruning and unpruning 61014.2.3 Interface to PLaSM operators 61114.2.4 Linear Programming implementation 61214.2.5 Boundary-to-interior operator 614

14.3 Dimension-independent integration 61714.3.1 Tensor of inertia 620

14.4 Generalized product of polyhedra 62214.4.1 Definitions 62314.4.2 Product of cell-decomposed polyhedra 62714.4.3 Intersection of extrusions 630

14.5 Skeleton extraction 63314.5.1 Algorithm 635

14.6 Extrusion, sweep, offset and Minkowski sum 63814.6.1 Background 63914.6.2 Unified approach 64014.6.3 Algorithms 641

14.7 Annotated references 648

15Motion modeling 64915.1 Degrees of freedom 64915.2 Configuration space 65315.3 Animation with PLaSM 655

15.3.1 Some definitions 65615.3.2 Generating flash animations 65615.3.3 Generating VRML animations 660

15.4 Motion coordination 66715.4.1 Non-linear animation 66715.4.2 Network programming 66915.4.3 Modeling and animation cycle 672

15.5 Extended Configuration Space 680

CONTENTS xv

15.5.1 Introduction 68015.5.2 Rationale of the method 68015.5.3 ECS algorithm 68115.5.4 Encoding degrees of freedom 68215.5.5 Computation of FP 686

15.6 Examples 68915.6.1 Umbrella modeling (5): animation 68915.6.2 Non-holonomic planar motion 69015.6.3 Anthropomorphic robot with 29 degrees of freedom 69315.6.4 Solving a 2D labyrinth 696

Appendix A Definition of MyFont 701

Appendix B PLaSM libraries 705B.1 Standard 705B.2 animation Library 719B.3 colors Library 720B.4 curves Library 723B.5 derivatives Library 724B.6 drawtree Library 725B.7 flash Library 726B.8 general Library 726B.9 myfont Library 729B.10 operations Library 730B.11 primitives Library 732B.12 shapes Library 735B.13 splines Library 737B.14 strings Library 739B.15 surfaces Library 739B.16 text Library 740B.17 transfinite Library 741B.18 vectors Library 741B.19 viewmodels Library 744

Appendix C 747REFERENCES 747

Index 759