Download presentation
Presentation is loading. Please wait.
1
Manifolds or why a cow is a sphere
Cindy Grimm Media and Machines Lab Department of Computer Science and Engineering Washington University in St. Louis
2
Overview What is a manifold? Constructive definition
Building a circle manifold Simple example showing concepts Using a manifold Surface modeling Applications Environment mapping Facial animation Image-based rendering Berkeley, 5/5/2005
3
What is a manifold? The world Overlap History: Mathematicians 1880’s
How to analyze complex shapes using simple maps Cartographers World atlas Informal definition Map world to pages Each page rectangular Every part of world on at least one page Pages overlap May not agree exactly Agree enough to navigate The world Overlap Berkeley, 5/5/2005
4
Traditional definition
A manifold M is an object that is locally Euclidean For every p in M Neighborhood U around p U maps to Rn No folding, tearing Technical note: M may be a surface embedded in Rm n is dimension of surface m >n M may be abstract (topological) 1D 2D Not manifold examples Berkeley, 5/5/2005
5
A mesh is manifold if… We can construct local maps around points:
Point is in face Point is on edge There are exactly two faces adjacent to each edge Point is on vertex The faces around a vertex v can be flattened into the plane without folding or tearing Vertices wi adjacent to v can be ordered w0,…,wn-1 such that the triangles wi,v,w(i+1)mod n all exist Can do on abstract or embedded mesh P 3D 2D P 2D 3D Berkeley, 5/5/2005
6
Traditional definition
Given: Manifold M Construct: Atlas A Chart Region Uc in M (open disk) Region c in Rn (open disk) Function ac taking Uc to c Atlas is collection of charts Every point in M in at least one chart Overlap regions Transition functions: yij = aj o ai-1 smooth M Berkeley, 5/5/2005
7
A circle manifold How to represent a circle? Problem:
All we have are Euclidean operations In R2, must project onto circle Solution: Represent circle as repeating interval [0,2p) Point q+2pk is same for all k integer (1,0) These are embeddings p This is not Berkeley, 5/5/2005
8
double GetTheta() const { return m_dTheta; }
/** A point on the circle, represented as an angle value from [0 to 2 pi). If the angle is * bigger (or smaller) it is shifted until it lies in the 0 to 2 pi range */ class CirclePoint { protected: double m_dTheta; public: double GetTheta() const { return m_dTheta; } CirclePoint( const double in_dTheta ) : m_dTheta( in_dTheta ) { while ( m_dTheta >= M_PI * 2.0 ) // Bring theta into the 0,2pi range m_dTheta -= 2.0 * M_PI; while ( m_dTheta < 0 ) m_dTheta += 2.0 * M_PI; } ~CirclePoint() {} }; /// Definition for S^1, an embedding of the circle class Circle { protected: public: Point2D operator()( const CirclePoint & in_circPt ) const { return Point2D( cos( in_circPt.GetTheta() ), sin( in_circPt.GetTheta() ) ); } Circle() { } ~Circle() { } }; (1,0) Berkeley, 5/5/2005
9
Chart on a circle Chart specification: Left and right ends of Uc
Counter-clockwise order to determine overlap region Co-domain c = (-1/2,1/2) Simplest form for ac Translate Center in [0,2p) Scale qR qc Uc -1/ /2 ( ) ( ) qL -1/2 1/2 qR qL Berkeley, 5/5/2005
10
Chart on a circle ( ) Chart specification: Alpha function
Sort point first Euclidean distance is topological distance Alpha inverse Point in [0,2p) ChartPoint Chart::Alpha( const CirclePoint &in_circpt ) const { const double dTheta = in_circpt.GetTheta(); double dThetaShift = dTheta; // Find the value for theta (+- 2 PI) that is closest to my chart center if ( fabs( dTheta - m_dThetaCenter ) <= M_PI ) { dThetaShift = dTheta; } else if ( fabs( (dTheta * M_PI) - m_dThetaCenter ) <= M_PI ) { dThetaShift = dTheta * M_PI; } else if ( fabs( (dTheta * M_PI) - m_dThetaCenter ) <= M_PI ) { dThetaShift = dTheta * M_PI; } else { assert( false ); } const double dT = (dThetaShift - m_dThetaCenter) * m_dScale; return ChartPoint( this, dT ); qc q ( ) q-2p CirclePoint Chart::AlphaInv( const double in_dT ) const { const double dTheta = in_dT / m_dScale + m_dThetaCenter; // Converts to 0,2pi range return CirclePoint( dTheta ); } Berkeley, 5/5/2005
11
Making a chart 2p qL qR 2p qR qL
const Chart *Atlas::AddChart( const CirclePoint &in_circptLeft, const CirclePoint &in_circptRight ) { double dThetaMid = 0.0; double dScale = 1.0; // Does not cross 0, 2pi boundary if ( in_circptLeft.GetTheta() < in_circptRight.GetTheta() ) { dThetaMid = 0.5 * ( in_circptLeft.GetTheta() + in_circptRight.GetTheta() ); dScale = 0.5 / (in_circptRight.GetTheta() - dThetaMid); } else { // Add 2pi to right end point dThetaMid = 0.5 * ( in_circptLeft.GetTheta() + in_circptRight.GetTheta() + 2.0*M_PI ); dScale = 0.5 / (in_circptRight.GetTheta() * M_PI - dThetaMid); } if ( dThetaMid >= 2.0 * M_PI ) dThetaMid -= 2.0 * M_PI; if ( fabs( dScale ) < 1e-16 ) return false; const Chart *opChart = new Chart( m_aopCharts.size(), dThetaMid, dScale ); m_aopCharts.push_back( opChart ); return opChart; qL qR 2p qL qR 2p Berkeley, 5/5/2005
12
An example circle atlas
atlas.AddChart( 0.0, M_PI ); atlas.AddChart( M_PI / 2.0, * M_PI / 2.0 ); atlas.AddChart( M_PI, * M_PI ); atlas.AddChart( 3.0 * M_PI / 2.0, 5.0 * M_PI / 2.0 ); Four charts Each covering ½ of circle Only 4 points not covered by two charts Check transition functions All translates Overlaps ½ of chart Chart 0 -1/2 1/2 Chart 1 Chart 2 Chart 3 Overlap regions Chart 0 Chart 1 Chart 2 Chart 3 1 Transition functions Berkeley, 5/5/2005
13
Why do I care? Applications: Joint angle, closed curve Advantages:
Can pretend everything is Euclidean Make chart that overlaps area of interest Scaled to fit Encapsulates 2p shift once and for all Use existing code as-is Derivatives all work (atlas is smooth) Can move calculation to overlapping chart No seams No boundary conditions Berkeley, 5/5/2005
14
Closed curve Create an embedding of the manifold Embed each chart
Standard R->R2 problem Blend between embeddings Berkeley, 5/5/2005
15
Joint angle example Reinforcement learning:
Swing pendulum until balanced Can apply angular force at each time step Goal Learn how to apply force from any position, velocity, to get to balanced state Manifold: Circle X R Function on manifold: force to apply Learn function on each chart Blend to get force Extend to two joints: Circle X circle X R X R Pendulum Berkeley, 5/5/2005
16
Writing functions on manifolds
Do it in pieces Write embed function per chart Can use any Rn technique Splines, RBFs, polynomials… Doesn’t have to be homogenous! Write blend function per chart k derivatives must go to zero by boundary Normalize to get partition of unity Spline functions get this for free Berkeley, 5/5/2005
17
Blend functions Define proto-blend function Defined on chart
Support equals chart Ck – use B-Spline basis function Cinf – use rational combination of exponentials Promote to function on manifold by setting to zero Normalized blend function Divide by sum Sum not zero by atlas covering property Only influenced by overlapping charts -1/2 1/2 Proto blend function -1/2 1/2 1 Normalized blend function Berkeley, 5/5/2005
18
Final embedding function
Embedding is weighted sum Generalization of splines Define using transition functions Derivatives Embed point in chart c Continuity is minimum continuity of constituent parts Berkeley, 5/5/2005
19
2D manifolds Sphere Point as x2 + y2 + z2 = 1
Latitude-longitude mappings Each chart ½ sphere (approx) Nice 6 chart partition Bounded by great arcs Polar projection Charts anywhere Center plus radius Berkeley, 5/5/2005
20
2D manifolds Torus Nine charts Each 2/3 of torus Torus as tiled plane
Specify 4 corners Ordering matters The plane tiled with copies of t. (0,0) (2p,2p ) t The nine charts relative to t. (0,0) (2p,2p ) Berkeley, 5/5/2005
21
2D manifolds Torus Overlaps May be more than one disjoint region
Chart i Chart j Berkeley, 5/5/2005
22
2D manifolds N-holed torus Hyperbolic disk tiled with 4n-sided polygon
Linear fractional transforms Well-defined inverse t t Berkeley, 5/5/2005
23
Hyperbolic disk Unit disk with hyperbolic geometry
Sum of triangle angles < 180 Angle is defined by tangents Lines are circle arcs Circles meet disk perpendicularly Berkeley, 5/5/2005
24
N-holed torus Why hyperbolic geometry? 4n-sided polygon
2 1 3 6 5 7 4 Why hyperbolic geometry? 4n-sided polygon Each paired edge creates loop One loop through hole One loop around Tiling Corners that meet at 2p/(4n) angles 1 6 5 4 3 2 7 Berkeley, 5/5/2005
25
N-holed atlas One chart for each element of polygon Face Edge
Two maps to center polygon Vertex 4n maps to center polygon 2 1 4 3 7 5 6 Berkeley, 5/5/2005
26
N-holed arbitrary charts
LFT specifies center and radius Data structures to keep track of which copies are overlapped Berkeley, 5/5/2005
27
Surface modeling applications
Parameterization Use correct topology No seams Well-defined overlaps Mip-mapping, texture transfer, fluid-flow, procedural textures Spherical cow Berkeley, 5/5/2005
28
Surface modeling applications
Surface reconstruction Choice of embedding function Spline, RBF, etc. Decide number of charts Fit each chart individually No boundary constraints Original mesh Ear Spline Base Tail RBF Mesh in 1-1 correspondence with manifold Berkeley, 5/5/2005
29
Surface modeling applications
Consistent parameterizations Selected points on both meshes Parameterize both so points match Fit surface Right (reflected) Source meshes (David Laidlaw, Brown University) Left Fitted surfaces Berkeley, 5/5/2005
30
Surface modeling Making new models
Start with manifold of correct topology User creates sketch (mesh) Embed mesh in topology Creates atlas Use mesh geometry to create chart embeddings Berkeley, 5/5/2005
31
Surface modeling Editing models
Draw on surface to indicate locations for new charts Inverse function (embedding to manifold) well-defined Caveat: How do we ensure new charts “over-ride” old ones? Surface pasting or hierarchical editing Berkeley, 5/5/2005
32
Adding charts Adding new charts Option 1) Crank up blend function
Option 2) “Zero-out” blend functions in higher level Define masking function h for each level Berkeley, 5/5/2005
33
Other applications Environment mapping Parameterization of the sphere
Animation Configuration space is a manifold Image-based rendering Rotation and “push-broom” camera capture Goal is to find single image (manifold) Lining up images == finding transition functions Berkeley, 5/5/2005
34
Conclusion Manifolds:
Provide a natural way to partition complex surfaces Simple functions on Rn Maintain analytic properties “Moving” analysis (no seams!) Separate topology from geometry Adjacency relationships Consistent parameterizations Encapsulate non-Euclidean operations Closest point, geodesics, movement in domain Berkeley, 5/5/2005
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.