Drawing hypergraphs using NURBS curves

Similar documents
08 - Designing Approximating Curves

Spline Morphing. CG software practical course in the IWR. Carl Friedrich Bolz. Carl Friedrich Bolz

Bézier Splines. B-Splines. B-Splines. CS 475 / CS 675 Computer Graphics. Lecture 14 : Modelling Curves 3 B-Splines. n i t i 1 t n i. J n,i.

A story about Non Uniform Rational B-Splines. E. Shcherbakov

Lecture IV Bézier Curves

CS 475 / CS Computer Graphics. Modelling Curves 3 - B-Splines

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

Roadmap for tonight. What are Bezier curves (mathematically)? Programming Bezier curves (very high level view).

Rational Bezier Curves

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

CS 465 Program 4: Modeller

Design considerations

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Parametric curves. Brian Curless CSE 457 Spring 2016

2D Spline Curves. CS 4620 Lecture 13

Need for Parametric Equations

Dgp _ lecture 2. Curves

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

NURBS: Non-Uniform Rational B-Splines AUI Course Denbigh Starkey

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

2D Spline Curves. CS 4620 Lecture 18

Computer Graphics. Curves and Surfaces. Hermite/Bezier Curves, (B-)Splines, and NURBS. By Ulf Assarsson

3D Modeling Parametric Curves & Surfaces

GL9: Engineering Communications. GL9: CAD techniques. Curves Surfaces Solids Techniques

Curve and Surface Basics

An introduction to interpolation and splines

Computer Graphics Curves and Surfaces. Matthias Teschner

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

(Spline, Bezier, B-Spline)

Intro to Modeling Modeling in 3D

ECE 600, Dr. Farag, Summer 09

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Generating Vectors Overview

MA 323 Geometric Modelling Course Notes: Day 21 Three Dimensional Bezier Curves, Projections and Rational Bezier Curves

Curves. Computer Graphics CSE 167 Lecture 11

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Flank Millable Surface Design with Conical and Barrel Tools

edunepal_info

Computergrafik. Matthias Zwicker. Herbst 2010

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

Representing Curves Part II. Foley & Van Dam, Chapter 11

Object Basics. Overview. Ellipse Command. Continued... X Commands. X System Variables

Splines. Connecting the Dots

A Curve Tutorial for Introductory Computer Graphics

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

Further Graphics. Bezier Curves and Surfaces. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

Shape Representation Basic problem We make pictures of things How do we describe those things? Many of those things are shapes Other things include

Curves and Surfaces. Shireen Elhabian and Aly A. Farag University of Louisville

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

End-Term Examination

Characterization of the Northwest Coast Native Art Ovoid

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

Advanced Texture-Mapping Curves and Curved Surfaces. Pre-Lecture Business. Texture Modes. Texture Modes. Review quiz

Surfaces for CAGD. FSP Tutorial. FSP-Seminar, Graz, November

CS-184: Computer Graphics

COMP3421. Global Lighting Part 2: Radiosity

To Do. Resources. Algorithm Outline. Simplifications. Advanced Computer Graphics (Spring 2013) Surface Simplification: Goals (Garland)

Curves and Surfaces 1

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

An introduction to NURBS

Curve Construction via Local Fitting

15.10 Curve Interpolation using Uniform Cubic B-Spline Curves. CS Dept, UK

Computational Geometry

GEOMETRIC LIBRARY. Maharavo Randrianarivony

Properties of Blending Functions

Curves and Surfaces Computer Graphics I Lecture 10

(Refer Slide Time: 00:02:24 min)

How to draw and create shapes

ME 111: Engineering Drawing. Geometric Constructions

Lecture 9: Introduction to Spline Curves

Fitting to a set of data. Lecture on fitting

Set 5, Total points: 100 Issued: week of

Introduction to the Mathematical Concepts of CATIA V5

Distance Functions 1

Curves and Surfaces Computer Graphics I Lecture 9

Rendering Curves and Surfaces. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

CS-184: Computer Graphics. Today

B-spline Curves. Smoother than other curve forms

Intro to Curves Week 1, Lecture 2

Computer Graphics I Lecture 11

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

Geometric Modeling of Curves

CS 450 Numerical Analysis. Chapter 7: Interpolation

4) Finish the spline here. To complete the spline, double click the last point or select the spline tool again.

LECTURE #6. Geometric Modelling for Engineering Applications. Geometric modeling for engineering applications

The figures below are all prisms. The bases of these prisms are shaded, and the height (altitude) of each prism marked by a dashed line:

Spline Methods Draft. Tom Lyche and Knut Mørken. Department of Informatics Centre of Mathematics for Applications University of Oslo

Keyword: Quadratic Bézier Curve, Bisection Algorithm, Biarc, Biarc Method, Hausdorff Distances, Tolerance Band.

B-Splines and NURBS Week 5, Lecture 9

Freeform Curves on Spheres of Arbitrary Dimension

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Analytic Geometry Vocabulary Cards and Word Walls Important Notes for Teachers:

Computer Graphics 1. Chapter 2 (May 19th, 2011, 2-4pm): 3D Modeling. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2011

Computer Graphics Spline and Surfaces

Parametric curves. Reading. Curves before computers. Mathematical curve representation. CSE 457 Winter Required:

Transcription:

Drawing hypergraphs using NURBS curves Ronny Bergmann Institute of Mathematics University of Lu beck presentation at the Kolloquium der Institute fu r Mathematik und Informatik November 25th, 2009

Content 1 Introduction 2 Representing periodic curves B-splines & NURBS Periodic NURBS 3 The hyperedge shape Definition Creation & validation 4 Summary R. Bergmann (University of Lübeck) Drawing Hypergraphs 2/ 23

Introduction Things done before As a student of computer science I thought about how to draw graphs. student research project: Gravel, an editor for graphs focus on scientific illustrations and convenient editing export especially for T E X (vector graphics) y y + 2 y y + 2 x + 2 x x + 2 x Figure: graph generated with Gravel, from Schiermeyer et al. R. Bergmann (University of Lübeck) Drawing Hypergraphs 3/ 23

Introduction What am I going to talk about? working on Gravel I noticed some other editors for graphs available none supported editing of hypergraphs drawing hyperedges with other tools no convenient editing diploma thesis about drawing and editing hypergraphs R. Bergmann (University of Lübeck) Drawing Hypergraphs 4/ 23

Drawing a hypergraph How do scientists usually draw hypergraphs? common drawing: the subset standard nodes are drawn as dots (as in graphs) usually nodes are placed first hyperedge is a subset of nodes drawn as a cloud surrounding all its nodes blackboard handle these smooth curves (on a computer) R. Bergmann (University of Lübeck) Drawing Hypergraphs 5/ 23

Requirements of curves...for drawing and editing of a hyperedge a curve representing a hyperedge should be numerically stable easy to create convenient and interactive editible, e.g. by affin-linear trasnformations edited just locally (if most of the curve is already done) periodic, so that it looks smooth, without rough edges outlines all nodes common in computer graphics: B-splines & NURBS but they are usually not periodic. R. Bergmann (University of Lübeck) Drawing Hypergraphs 6/ 23

B-splines definition a very short introduction of B-splines a B-spline curve B(u),u [a,b] consists of a polynomial degree d smoothness n + 1 control points P 0,...,P n form a knot vector (t i ) m i=0 with m = n + d + 1 (nondecreasing) recursive B-spline basis functions N i,d (u),i = 0,...,n piecewise nonnegative polynomial functions model distribution of the P i along the curve with those we get the B-spline curve B(u)= n i=0 N i,d (u)p i, u [t d,t m d ]=[a,b] R. Bergmann (University of Lübeck) Drawing Hypergraphs 7/ 23

B-splines Example a simple B-spline curve degree 3 n = 5 six control points knot vector (t i ) 9 i=0 = ( 0 0 0 0 1 3 2 3 1 1 1 1 ) P 3 P 4 P 0 = B(0) B ( ) 2 3 B ( ) 1 3 P 5 = B(1) P 1 P 2 P 1 has local influence: [t 1,t 5 )=[0, 2 3 ) R. Bergmann (University of Lübeck) Drawing Hypergraphs 8/ 23

B-splines properties nice features we obtain by using B-spline curves P 0 and P n are interpolated, if t 0 = t d = a and t m d = t m = b P i only has local influence to the curve Let p be the maximum multiplicity of a knot from t d+1 to t m d 1 B(u) is smooth, because it is d p-times differentiable try to reach p = 1! with B(u) get a curve that is numerical stable has easy computable derivatives is a piecewise polynomial But we can t form circles! R. Bergmann (University of Lübeck) Drawing Hypergraphs 9/ 23

NURBS Non Uniform Rational B-Splines additional weight w i > 0 for each control point P i different influence of each P i to the curve new NURBS basis functions R i,d (u), piecewise rational polynoms (based on knot vector and weights) with that modification NURBS curve C(u)= n R i,d (u)p i is a piecewise rational polynomial circles are possbile most important i=0 B-spline properties also apply for NURBS using B-spline algorithms by calculation in homogeneous coordinates R. Bergmann (University of Lübeck) Drawing Hypergraphs 10/ 23

NURBS example showing different influences of a control point to the curve variation of weight w 3 from the last example with w 3 = 2 (dotted line) w 3 = 1 (solid line) B-spline curve w 3 = 1 2 (dashed line) P 3 P 4 P 0 P 5 P 1 P 2 R. Bergmann (University of Lübeck) Drawing Hypergraphs 11/ 23

Periodic NURBS How do we model a shape with NURBS? idea: close the curve to a periodic one C (k) (a)=c (k) (b), k = 0,...,d p change definition of N i,d (u) repeat themselves periodically (shifted) change P i periodic sequence periodic curve no endpoint interpolation! all other properties remain. adapt algorithms, so they keep the curve periodic! R. Bergmann (University of Lübeck) Drawing Hypergraphs 12/ 23

Periodic NURBS example What does s shape look like? smooth curve surrounds exactely one area iff it is injective. P 0 = P 7 P 1 = P 8 P 2 = P 9 C(a)=C(b) degree 3 C (k) (a)=c (k) (b), k = 0,1,2 P 3 P 4 P 6 P 5 R. Bergmann (University of Lübeck) Drawing Hypergraphs 13/ 23

Periodic NURBS example What does s shape look like? smooth curve surrounds exactely one area iff it is injective. P 0 = P 7 P 6 P 1 = P 8 P 2 = P 9 P 4 P 3 degree 3 C (k) (a)=c (k) (b), k = 0,1,2 start/end could be moved anywhere if any point on the curve may be moved just the curve is needed in the GUI P 5 R. Bergmann (University of Lübeck) Drawing Hypergraphs 13/ 23

Algorithms for NURBS All your NURBS need are... these. with these (periodic) NURBS the following algorithms were implemented calculate C (k) (u),k = 0,...,m (k = 0 for drawing) extract arbitraty subcurve (ignoring start/end) affin linear transformations (affecting subcurve or whole curve) projection onto the curve (essential for interactive editing) moving arbitrary point on curve anywhere except for projection, all these algorithms are well known. small adjustments to fit periodic NURBS for projection: circular clipping algorithm (Chen et al., 2008) R. Bergmann (University of Lübeck) Drawing Hypergraphs 14/ 23

Drawing hypergraphs using NURBS curves Ronny Bergmann Institute of Mathematics University of Lu beck Excursion: Distance betwenn a point and a NURBS Curve

Extension II Distance between a point an a NURBS Curve Distance and projection on the NURBS Curve Projection means, for a NURBS curve C(u) (with control Points and weight P i,w i ) and a point p Compute the point C(û) with shortest distance to p The algorithm is important for interactive editing! (point inversion) It s idea is based on clipping using a circles around p, that get smaller and smaller R. Bergmann (University of Lübeck) Drawing Hypergraphs 2/ 5

Extension II Distance between a point an a NURBS Curve Main idea of the algorithm divide and conquer with Newton iteration main idea: circles around p of small radii, cut everything outside 1 Split the Curve into small parts (knot insertion beziér curves) 2 init circle around p running through C(a) or C(b) 3 For each part decide whether the part is outside the circle discard the part is inside the circle, then a) it has exactly one minimum Newton iteration new circle b) it has more than one split in the middle, use endpoints as new circle radii 4 among all local minima from the newton iteration is the global minimum R. Bergmann (University of Lübeck) Drawing Hypergraphs 3/ 5

Extension II Distance between a point an a NURBS Curve Looking at the distance calculating a function for the distance The product f (u)=(c(u) p)(c(u) p) T is the objective squared distance function. f (u) is a beziér curve iff C(u) is a beziér curve (K. Mørken,1991) degree of f (u): 2d f (u) has real valued control points! use f (u) to determine whether a curve is outise a circle around p (convex hull property) if the control points have one turning point (variation diminishing property) exactly one minimum R. Bergmann (University of Lübeck) Drawing Hypergraphs 4/ 5

Extension II Distance between a point an a NURBS Curve Projection example finding the shortest distance in a few slides P 0 C(u) At first: split Initial circle K 1 1 B 1 Circle K 2 discard B 1 2 B 2 is inside K 2 P 5 newton p C 3 new radius with p C p Figure: projection K 3 4 discard B 3, it is outside K 3 only one newton iteration result is p C R. Bergmann (University of Lübeck) Drawing Hypergraphs 5/ 5

Extension II Distance between a point an a NURBS Curve Projection example finding the shortest distance in a few slides K 1 B 3 At first: split Initial circle K 1 P 0 B 2 1 B 1 Circle K 2 discard B 1 2 B 2 is inside K 2 B 1 p Figure: projection P 5 newton p C 3 new radius with p C K 3 4 discard B 3, it is outside K 3 only one newton iteration result is p C R. Bergmann (University of Lübeck) Drawing Hypergraphs 5/ 5

Extension II Distance between a point an a NURBS Curve Projection example finding the shortest distance in a few slides K 1 B 3 At first: split Initial circle K 1 1 B 1 Circle K 2 P 0 B 2 K 2 discard B 1 2 B 2 is inside K 2 P 5 newton p C 3 new radius with p C B 1 p K 3 4 discard B 3, it is outside K 3 Figure: projection only one newton iteration result is p C R. Bergmann (University of Lübeck) Drawing Hypergraphs 5/ 5

Extension II Distance between a point an a NURBS Curve Projection example finding the shortest distance in a few slides K 1 B 3 At first: split Initial circle K 1 1 B 1 Circle K 2 P 0 B 2 K 2 discard B 1 2 B 2 is inside K 2 p C P 5 newton p C 3 new radius with p C B 1 p K 3 4 discard B 3, it is Figure: projection outside K 3 only one newton iteration result is p C R. Bergmann (University of Lübeck) Drawing Hypergraphs 5/ 5

Extension II Distance between a point an a NURBS Curve Projection example finding the shortest distance in a few slides K 1 B 3 At first: split Initial circle K 1 1 B 1 Circle K 2 P 0 B 2 K 2 discard B 1 2 B 2 is inside K 2 p C K 3 P 5 newton p C 3 new radius with p C B 1 p K 3 4 discard B 3, it is Figure: projection outside K 3 only one newton iteration result is p C R. Bergmann (University of Lübeck) Drawing Hypergraphs 5/ 5

Extension II Distance between a point an a NURBS Curve Projection example finding the shortest distance in a few slides K 1 B 3 At first: split Initial circle K 1 1 B 1 Circle K 2 P 0 B 2 K 2 discard B 1 2 B 2 is inside K 2 p C K 3 P 5 newton p C 3 new radius with p C B 1 p K 3 4 discard B 3, it is Figure: projection outside K 3 only one newton iteration result is p C R. Bergmann (University of Lübeck) Drawing Hypergraphs 5/ 5

Extension II Distance between a point an a NURBS Curve Projection example finding the shortest distance in a few slides K 1 B 3 At first: split Initial circle K 1 1 B 1 Circle K 2 P 0 B 2 K 2 discard B 1 2 B 2 is inside K 2 p C K 3 P 5 newton p C 3 new radius with p C B 1 p K 3 4 discard B 3, it is Figure: projection outside K 3 only one newton iteration result is p C R. Bergmann (University of Lübeck) Drawing Hypergraphs 5/ 5

The hyperedge shape What should a drawing of a hyperedge look like? Part I hypergraph H =(V,E ), with nodes v i V and hyperedges E i E P(V )\/0 E 5 E 1 E 4 v 2 v 3 v 4 v 5 E6 E v 2 7 types of shapes loops e.g. E 6 iff E = 2, simple curve joining the nodes, e.g. E 5 periodic curve enclosing only its nodes, e.g. E 3 v 1 E 3 v 6 v 8 Figure: a Gravel export of a hypergraph by C.Berge R. Bergmann (University of Lübeck) Drawing Hypergraphs 15/ 23

The hyperedge shape decorations What should a drawing of a hyperedge look like? Part II additional attributes for the curve of a shape solid, dashed, dotted,... line width color label (cf. last slide) and a margin δ : shortest distance from node borders of each v E to the curve with δ > 0 no node touches the curve with δ > α R + we have a margin inside the shape blackboard R. Bergmann (University of Lübeck) Drawing Hypergraphs 16/ 23

The hyperedge shape construction Creating a shape for an hyperedge. Using periodic NURBS curves, we can create shapes: circles interpolation through user defined points convex hull based on interpolation and margin and modify them globally or locally by scaling, rotation, translation move control points or positions on the curve replace parts R. Bergmann (University of Lübeck) Drawing Hypergraphs 17/ 23

The hyperedge shape validation Did you forget including a node? a hyperedge shape can be validated: Are all nodes v E inside the shape? Are all others outside? Is the margin big enough? some criteria can t be checked (up to now?) minimization of crossings simplicity and other aesthetic criteria R. Bergmann (University of Lübeck) Drawing Hypergraphs 18/ 23

Gravel editing graphs and hypergraphs So how can you use that now? all the presented elements are implemented in Gravel, an editor for graphs and hypergraphs R. Bergmann (University of Lübeck) Drawing Hypergraphs 19/ 23

Summary Everything in short again hyperedges in the subset standard require periodic curves using NURBS and their algorithms extended to periodic NURBS interactive editing hyperedge shape as formal definition of the hyperedge drawing easy creation and modification of a shape validation of the hyperedge shape (mostly) possible a first editor for hypergraphs R. Bergmann (University of Lübeck) Drawing Hypergraphs 20/ 23

future plans What s next? Gravel is available at gravel.darkmoonwolf.de (though in german only), the complete application is available as jar-file Mac OS X Application package source files future plans are internationalization (using Java i18n) an algorithm API for graph and hypergraph drawing algorithms educative presentations of well known algorithms stepwise execution of algorithms more basic shapes for hyperedges... R. Bergmann (University of Lübeck) Drawing Hypergraphs 21/ 23

One final example T E X-Export using a TikZ picture in LAT E X 4 3 11 10 2 8 5 7 1 6 9 Figure: A competition hypergraph from Sonntag and Teichert R. Bergmann (University of Lübeck) Drawing Hypergraphs 22/ 23

The End Thanks for your attention. Are there any questions? R. Bergmann (University of Lübeck) Drawing Hypergraphs 23/ 23