Visualisatie BMT Lecture overview Vector algorithms Tensor algorithms Modeling algorithms Algorithms - 2 Arjan Kok a.j.f.kok@tue.nl 1 2 Vector algorithms Vector 2 or 3 dimensional representation of direction and magnitude (e.g. speed, force) force = (1,1) speed = (3,2) force = (2,1) Vector algorithms Hedgehogs Warping Oriented glyphs Displacement plots Stream lines, streak lines Stream ribbons, stream surfaces force = (0, -0.5) 3 4 Move point or object over a small time step Velocity (vector) at position x: V(x) = dx/dt Displacement of point: dx = V(x)dt Position of point at time t: x(t) V(x(t))dt = t 0 Repeatedly displace points over many time steps 5 6 1
Give initial position x 0 (release point) Repeat Find cell (i, j, k) and offsets (r, s, t) for x (point location) Find velocity V(x) at x (interpolation) Compute next position (integration) t+ t x(t + t) = x(t) + V(x(t))dt for given time step t Until total time passed or new position is outside data set t Integration techniques Euler x(t+t) = x(t) + V(x(t)) t Runge-Kutta x(t+t) = x(t) + t /2 (V(x(t)) + V(x * (t+t))) x * (t+t) = x(t) + V(x(t)) t 7 8 Accuracy depends on: Step size t Accuracy of data set Accuracy of interpolation functions 9 10 Particle path Particle trace Trajectory of a single particle over time Path of one particle released at P at t = t 0 to t = t n Streak line Streakline Path of particles passing through one given fixed point P over a time interval Connection of all particles at time t i that have previously passed through point x i (e.g. source) P P t = t 0 t = t n t = t 0 t = t n 11 12 2
Stream line Streamline Curve in the flow field which at a particular time, in tangent to the velocity vector at all points along the curve. Demo http://widget.ecn.purdue.edu/~meapplet/java/flowvis/index.html P t = t 0 t = t n Unsteady flow: continuous changing given line exists only at one moment in time. 13 14 Streamlines Streamlines Visualization: Define starting points by creating rake (source of points) Draw stream lines Color lines according to some attribute Magnitude of vector Other scalar attributes 15 16 Stream ribbon Generate two adjacent streamlines Generate polygons by connecting point of both lines Shows twist (vorticity) and divergence (spread) Stream surface / stream tube Generate n streamlines passing starting at points on a curve (rake) Generate polygonal mesh by connecting adjacent streamlines Closed surface => streamtube 17 18 3
Streamtubes Tensor algorithms A tensor is a high dimensional quantity (in our case symmetric 3x3 matrices) Tensors describe e.g. the displacement and stress in a 3D material We must study the eigenvectors and eigenvalues of the matrix: Ax = x where A is tensor matrix and x its eigenvector det A I = 0 19 20 Tensor algorithms Tensor ellipsoids Express eigenvectors as: v i = i e i where e i is unit vector in direction eigenvalue and i eigenvalues Order eigenvalues such that 1 2 3 (major, medium and minor values) Define an ellipsoid The shape and orientation of the ellipsoid represent the relative size of the eigenvalues and the orientation of the eigenvectors Algorithm Position a sphere at the tensor location Rotate the sphere around its origin (using eigenvectors) Scale the sphere (using eigenvalues) 21 22 Tensor ellipsoids Tensor ellipsoids Point load applied to elastic material At the surface of material the ellipsiods flatten because there is no stress perpendicular to the surface (except at stress point itself) 23 24 4
Tensor hyperstreamlines Tensor hyperstreamlines Decompose tensor field into three vector fields defined by one of the eigenvectors Create a streamline through one of the vector fields Sweep an object (e.g. ellipse) along this streamline Use remaining vector fields to define major and minor axis of ellipse 25 26 Modeling algorithms Source objects Modeling algorithms Create or change dataset geometry or topology Algorithms on combined data Most general class of algorithms Modeling simple geometry Supporting geometry Data attribute creation Source objects can be used as procedures to create data attributes (e.g. a simulator) Attributes can be generated from a mathematical function => implicit functions 27 28 Implicit functions Implicit functions F(x, y, z) = c Examples: Sphere: F(x, y, z) = x 2 + y 2 + z 2 R 2 Plane: F(x, y, z) = Ax + By + Cz + D Implicit functions Properties of implicit functions Simple geometric description Easy definition to define common geometric shapes (spheres, planes, cylinders,..) Region separation Implicit functions separate 3D space F(x, y, z) < 0, F(x, y, z) = 0, F(x, y, z) > 0 Scalar generation Implicit functions convert position in space into scalar value c i = F(x i, y i, z i ) 29 30 5
Modeling objects Sample F on dataset and generate isosurface at contour value c i Combine implicit functions to create more complex objects using boolean operations (union, intersection, and difference F + G = min(f(x, y, z), G(x, y, z)) F * G = max(f(x, y, z), G(x, y, z)) F G = max(f(x, y, z), -G(x, y, z)) Modeling example f1 = (x-1.33) 2 + y 2 + z 2 0.5 2 f2 = (x-1.5) 2 + y 2 + (z-0.5) 2 0.25 2 f3 = f1 f2 f4 = y 2 + z 2 x 2 tan 2 (20) (+ intersection with 2 planes) f5 = f4 + f3 31 f1 f2 f3 f4 f5 32 Use of implicit data Selecting data Choosing cells and points that lie within a particular region of the dataset Data selection Algorithm For each cell in dataset Evaluate implicit function for all cell nodes A cell is selected if result has negative sign Selecting with sphere function 33 34 Data cutting Find dataset values on implicit surface Data cutting Algorithm For each cell in dataset Evaluate implicit function for all cell nodes A cell is cut if not all positive or negative Generate the isosurface f(x, y, z) =0 within cell Generate data attributes for isosurface by interpolation along cut edges 35 36 6
Data cutting Clipping Limit the data to be processed or displayed Usually with plane Data cutting with plane function 37 38 Clipping Algorithm Evaluate implicit function for all cell nodes If all positive => remove cells If all negative => copy cells Else Generate the isosurfaces f(x, y, z) =0 within cell and generate new cells. Generate data attributes for isosurface by interpolation along cut edges Glyphs A glyph is any object which is parameterized by some data May be positioned, oriented, scaled, deformed, colored,.. in response to data 39 40 Data extraction Data extraction Extract portions of data from dataset Techniques: Geometry extraction Thresholding Data extraction Geometry extraction Extracts data based on geometric or topological characteristics Select cells/nodes within specified range of ids Spatial extraction Define regions (e.g. by implicit function) See data selection Subsampling Select part of original data Only select every n-th data node Modifies topology of dataset 41 42 7
Data extraction Thresholding Extracts data based on attribute values Examples Select all nodes with scalar values within specified range Select all nodes with vector magnitude within specified range Probing Resampling method Create output dataset by sampling input dataset Get attributes for output dataset by interpolation from attributes of input dataset 43 44 Probing 45 8