VISUALIZING SURFACES

                       CS 519

Dr. Lawrence Angrave
Dr. Eric Shaffer
• Intuitively surface is a boundary of a solid
   – More formally:
     Orientable continuous 2D manifold embedded in R3
   – That’s probably overly restrictive

• Today we will look at
   – Sources of surface data
   – Surface representations
   – Common surface processing operations
     Sources of Surface Data
• Manual input…
• Writing a program to create the data
   – Procedural modeling
• Extraction from volume data
• Use of a modeling program
   – Can be surface or solid-based modeling
• Reconstruction from image data
   – Called photogrammetry
• From 3D scanning technology
  Extraction from volume data
• Volume data acquired via
   – Simulation
   – Scanning (MRI, CT-Scan, etc.)
• Algorithmically find surfaces of constant value
   – For MRI that would be density…
• We’ll talk more about this during
  the volume rendering lectures
       Moldeling Software
• Surface modeling
  – Generate a surface model for a simulation
  – Lots of options (Gridgen™, etc)
            Modeling Software
• Solid Modeling
   – CAD tools
   – Processes mimic machining (drilling, cutting).
• Typically have a faceter that converts solid model to
• Interactive visualization requires fast rendering
   – FEM faceters often over-tessellate
          Surface Modeling in VTK
• Creates a swept surface
• Creates a surface of rotation

• Models a generalized cylinder around a chain of line segments
• Creates strips along line segments perpendicular to normals
   stored per-segment
              3D Scanning

St. Matthew   David   Forma Urbis Romae
          Scanners used in the
       Digital Michelangelo Project

Cyberware         Faro + 3D Scanners Cyra
  - for statues     - for tight spots   - for architecture
    Scanning St. Matthew

working in   scanning   scanning
the museum   geometry   color
Problems in 3D scanning
1.   optically uncooperative materials
2.   scanning in the presence of occlusions
3.   filling holes in dense polygon models
4.   handling large datasets
How optically cooperative is marble?
          [Godin et al., Optical Measurement 2001]

      • systematic bias of 40 microns
      • noise of 150 – 250 microns
         – worse at oblique angles of incidence
         – worse for polished statues
            Hard problem :
scanning in the presence of occlusions
          < 30°                               ?

  • occlusions (& self-occlusion) force grazing scans, which
    lead to holes
  • a scanner with a fixed triangulation angle cannot
    circumvent all occlusions
  • a hammer & chisel can reach places
    a triangulation scanner cannot
filling holes in dense polygon models

The importance of subsurface

    BRDF                                BSSRDF
           [Jensen et al., Siggraph 2000]
    Hard problem:
handling large datasets
Scanning the David

      • 480 individually aimed
      • 2 billion polygons
      • 7,000 color images
      • 32 gigabytes
      • 30 nights of scanning
      • 22 people
LiDAR: Light Detection and
            • Range based on
              time for laser
              reflection to return
How do we go from
 points to a
You can generate a
 and extract a
 you’ll see in a few
                  2-D Meshing
• Input is a 2-D set of points stored in a
• Connects 3 points into a triangle if no other
  point lies in circumcircle
• Mesh avoids any faces in input (source)
  accompanying points in vtkPolyData
            3-D Meshing
• Triangulates points in 3-D based on
   tets and circumsphere

• Implements Hoppe S92 & Ph.D.
• Distance to vertex i’s tangent plane
             fi(x) = (x – vi) · ni
• Local least squares provides ni
• Implicit returns min distance
• Polygonize
Surface Representations
      2D example
   Surface Representations
• Parametric surfaces
  – Tensor-product spline surfaces (NURBS)
    • Standard in many CAD systems
  – Piecewise polynomial surface
  – Connected in continuous manner
 Some Drawbacks of Tensor-
     Product Surfaces
• Modeling a complicated surface in a smooth
  manner requires lots of patches and lots of
  extra constraints
• Some operations (refinement)
  difficult to implement.
• Modeling sharp features is
  and holes requires extra work
                     Polygonal Meshes
• Most common type of surface model

• A collection of polygons typically sharing

• Very versatile, can model complex

• Rendering hardware optimized for
  processing triangle meshes

    – Graphics libraries generally tessellate non-
      polygonal mesh representations to render
VTK Cell Types
  Triangle Mesh Data Structures
• “Polygon Soup” or “Face Set”
• No explicit connectivity information
• Implemented in the STL file format

36B per triangle

..or 72B per vertex

    Triangle Mesh Data Structures
• “Indexed Face Set”
• OBJ, PLY format
• Table of vertices
• Table of faces using
  vertex indices
• 36B per vertex
• Drawbacks?
     Triangle Mesh Data Structure
•   Half-Edge
•   Table of vertices: position, outgoing half-edge
•   Table of Faces: incident half-edge
•   Table of Half-Edges:
    origin vertex, face,
    opposite half-edge,
    prev half-edge,
    next half-edge

•   Muller, D. E. ; Preparata, F. P. "Finding the Intersection of Two Convex Polyhedra", Tech. Rept. UIUC,
    1977, 38pp, also Theoretical Computer Science", Vol. 7, 1978, 217-236
   Triangle Mesh Data Structure
• Half-Edge
• 144B per vertex
• Operations:
   – Walk around the boundary of a given face
   – Visit all edges incident to a vertex v
   – Visit all vertex neighbors of v
   – How fast?
• Drawbacks?
• Supported by CGAL and OpenMesh
Half-Edge example
  Rendering Efficiency in VTK
• Converts polygonal mesh into a triangle mesh
• Collects triangles into strips where each new vertex leads to a
   new triangle
• Merges duplicate vertices and removed degenerate cells
• Removes unnecessary precision due to e.g. noise
     Geometry Processing for

• Simplification/Level-of-Detail generation
• Feature Detection
• Mesh Repair
               Mesh Simplification
•Visualization commonly confronts the problem of overwhelming amounts
of data and/or geometry
•Need methods that balance the loss of data fidelity with realities of
    •Visual clutter
    •Memory constraints
    •Interactive framerates

•Generates level-of-detail models
   •Coarsely meshed distant objects
   •Finely meshed near objects
        Formalizing Surface
       Simplification Problem
• Produce approximations with fewer triangles
  – Computationally efficient
  – Should be visually as similar to original as possible
  – In practice similarity of shape used instead
                 Vertex Clustering
Partition space into cells
   • grids, spheres, octrees

Merge all vertices in the same cell
  • triangles with multiple vertices in a cell degenerate
                    Vertex Decimation
•   Implements Schroeder et al. “Decimation of
    Triangle Meshes” S92
•   Removes a vertex if:
    1.   It is near the average plane of the faces sharing it
    2.   None of its adjacent edges is greater than a
         “feature” angle
    3.   Its removal doesn’t change the surface topology
•   Retriangulate the resulting polygon
•   Repeat until target size or error reached
           How to Create Level-of-
              detail (LOD)
                        from viewer?

           close                             far
10,000       2,000       1,000         500         250

         Concern: transitions may “pop”
           would like smooth LOD
       Progressive Meshes
• Proposed by Hoppe Siggraph 96
• Idea: apply sequence of edge collapses:
                   ecol(vs ,vt , vs ) ’

  vl          vr                          vl        vr


     Vertex split transformation:

                vspl(vs ,vl ,vr , vs ,vt ’,…)’

vl         vs   vr                               vl         vr


         Simplification process
13,546           500              152          150

   M=Mn                M175             M1           M0
       ecoln-1                ecoli          ecol0
Progressive Meshes
Progressive Meshes
        Progressive Meshes                                    152
• Implements Hoppe S96
• Simplification
   – Vertices sorted into priority queue according to
     decimation error                                         500
   – Vertices decimated in this order until single triangle
• Streaming mesh transmission
   – Insert vertices in reverse order
   – Unlike edge-collapse/vertex-split, vertex
     removal/insertion not continuous                         13,546
        Quadric Error Metric v                               v                  v
                                                      1      2                  ’
                                          Q  Qi  Q j  ( A i  A j , bi  b j , ci  c j )
• Garland & Heckbert,                         Q( v ')    v   A b
         n           d
   Error( v )   (n i v  di )


 Q  ( A , b, c )  (nnT, dn, d  )
  Q( v )  vTAv   bTv  c                                                       
                                       (n         v  di )   Qi ( v )    Qi  ( v )
                                      i                        i             i    
        QEM on Attributes
• Hoppe Vis99
• Use quadrics to sense
  variance not only in
  vertex position, but
  other attributes:
  – Color
  – Texture coord.
  – Scalar/vector data

                          50K tris   10K tris
                    Feture Detection

   Critical procedure in many meshing tasks
      Identifies edges that are design features
      e.g. edges to be preserved during coarsening

   Automation saves significant person-hours
      Manual identification simply infeasible for very detailed meshes
      No commercial code with equal capabilities
   Feature Detection Technical Details:
   •   Eigenvalues of covariance matrix at each vertex
        –   Contain info about principal curvatures
        –   Unified asymptotic analysis and singularity analysis
        –   Automatic computation of thresholds for eigenvalues from angle thresholds
   •   Eigenvectors contain info about principal directions
        –   Relate to direction of feature edges
        –   Invaluable for determining connectivity of feature curves
   •   X. Jiao and N.R. Bayyana, Identification of C1 and C2 Discontinuities for
       Surface Meshes in CAD, Computer-Aided Design, Vol 40, pages 160-175,

smooth:1                       ridge: 2                            corner: 3
large ev.                      large ev.                           large ev.
         Eigenvalues of the covariance matrix….
     • Covariance matrix Q for a set of n points x1,..,xn
        – Let p be the average of the n points
        – Q=[qij]

               1 n
          qij   (x ik  pi )( x jk  p j )
               n k 1

     • Eigenvalues are all scalars λ such that Qv=λv
       Robust Vertex-Edge Dual Approach for
                Feature Detection
                   Input: mesh, angle thresholds

    Pre-classify vertices and edges using eigenvalue analysis

    Re-classify vertices based on incident ridge edges

    Connect feature curves along ridge edges and ridge vertices
If changed
    Filter open-ended weak feature curves
                                    If no change
              Output:   ridge edges, vertex classification
           Sample results

Noisy nozzle region due to coarse mesh

                 Curved thin wall with skinny triangles
    Feature Detection

• Extracts features from meshes
• Finds edges that are:
  – Boundary (one face)
  – Features (dihedral  < feature )
  – Non-manifold (3+ faces)
• Computes curvatures              r
   as vertex attribute

• Gaussian curvature                   k = 1/r
K(v) = k1 k2 = 2p – Suvw uvw
   (weighted by Area(uvw)/3)

• Mean curvature
H(v) = (k1 + k2)/2
     = S<uv> dihedral(<uv>)
   (weighted by ||<uv>||)

                                  Meyer, Desbrun, Schroder, Barr
Curvature is rate of change of tangent vectors along a curve.
Principal curvatures:
       k1 is max curvature at p
       k2 is min curvature at p
Principal directions are the associated tangent vectors
                 Mesh Repair
• Goal:
  – Produce a manifold triangle mesh
          – Possibly without boundary (i.e. watertight)
  – Possibly remove topological “noise”
  – Provide consistent normal orientation
Mesh Artifacts
           Mesh Artifacts
• Holes and islands in meshes from
  range images
                Mesh Artifacts

• Contoured meshes
  are extracted from
  volume data
  – Often have
    topological noise
            Mesh Artifacts
• Triangulated spline surfaces often have
  gaps and overlaps
               Mesh Artifacts
• Geometrical noise
  – Fixed by smoothing
    (next lecture)

• “poor quality” in the FEM sense
  – Fixed by optimization or remeshing
    (different class)
• vtkFillHolesFilter
  – Surface-based approach
  – Identifies boundary loops and triangulates
   Surface-Based Hole-filling
• Need to refine and smooth the result
  – Otherwise geometry won’t match
• Islands not incorporated
• Self-intersections can occur
• Volumetric approaches preferable
  – Simplification and repair of polygonal models using volumetric
    techniques [Noorudin & Turk]
  – Automatic restoration of polygon models[Bischoff, Pavic, Kobbelt
    If you were reviewing a paper you would
                    be asked:
•   What is the main contribution of the paper?
•   How important is it?
•   Is it practical to implement?
•   Is the paper understandable?
•   What are the drawbacks or shortcomings of the work
    described in the paper?

And as a researcher you should ask your yourself:
How could I improve upon this work?
• Some material used courtesy of:
  – Hugues Hoppe
  – Stanford Digital Michelangelo Project
  – M. Bosch, et al
  – Michael Garland

To top