SlideShare une entreprise Scribd logo
1  sur  255
Télécharger pour lire hors ligne
1
01/07/2023
-
2
01/07/2023
-
My goals
>1. Give you some pointers
>2. Give you some good « tricks »
3
01/07/2023
-
Syllabus
>1. The hitch hacker’s guide
to geometry processing
>2. Packing your luggage
>3. Finding your way
>4. Connecting with friends
>5. Into darkness
>6. Planning your next trip
4
01/07/2023
-
5
01/07/2023
-
1. The hitch hacker’s guide to Geometry Proc.
> Activate ("Gray beard’s provocative introduction")
6
> 1. Hitch hacker’s guide to G.P.
1979 Apple ][
6502 processor, 1MHz
64Kb RAM
Approx. 10 FLOPs
> 1. Hitch hacker’s guide to G.P.
1979 Apple ][
6502 processor, 1MHz
64Kb RAM
Approx. 10 FLOPs
2023 PC
Core i7 gen4, 3 GHz
16Gb RAM
Approx. 300 GFLOPs
> 1. Hitch hacker’s guide to G.P.
1979 Apple ][
6502 processor, 1MHz
64Kb RAM
Approx. 10 FLOPs
2023 PC
Core i7 gen4, 3 GHz
16Gb RAM
Approx. 300 GFLOPs
X 3 million !!!!
44 years
> 1. Hitch hacker’s guide to G.P.
Boots in 20 seconds Boots in 3 minutes
> 1. Hitch hacker’s guide to G.P.
Boots in 20 seconds Boots in 3 minutes
Where did the 3 million acceleration factor go ?
> 1. Hitch hacker’s guide to G.P.
What can you do in 20 seconds ?
3 GHz, 4 cores = 240 billions instructions !!
> 1. Hitch hacker’s guide to G.P.
If you cannot do the job in less than 20 seconds
on a modern PC, then there is probably a
problem somewhere
What can you do in 20 seconds ?
3 GHz, 4 cores = 240 billions instructions !!
> 1. Hitch hacker’s guide to G.P.
Boots in 20 seconds Boots in 3 minutes
Where did the 1 million acceleration factor go ?
- Lost in abstraction -
> 1. Hitch hacker’s guide to G.P.
Abstraction in Programming:
+ Separates concepts
+ Separates specification from Implementation
> 1. Hitch hacker’s guide to G.P.
Abstraction in Programming:
+ Separates concepts
+ Separates specification from Implementation
- Sometimes separates things
that should be considered together !!
> 1. Hitch hacker’s guide to G.P.
Futuristic programming
Usefullness (and coolness) are primary !
> 1. Hitch hacker’s guide to G.P.
• Jonathan Shewchuk s Triangle and exact predicates
• Tetgen, MGTetra, MMG3d
• Omar Cornut s ImGUI library
• David Mount s ANN library
• The LUA prog. language
Futuristic programming
Examples of Futuristic codes
Usefullness (and coolness) are primary !
> 1. Hitch hacker’s guide to G.P.
Geogram/Graphite Programming Priorities
1. Make it as simple as possible (but not simpler)
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
Geogram/Graphite Programming Priorities
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
3. Make it as easy to compile as possible
Geogram/Graphite Programming Priorities
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
3. Make it as easy to compile as possible
4. Maximize speed
Geogram/Graphite Programming Priorities
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
3. Make it as easy to compile as possible
4. Maximize speed
5. Minimize memory consumption
Geogram/Graphite Programming Priorities
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
3. Make it as easy to compile as possible
4. Maximize speed
5. Minimize memory consumption
6. Minimize number of lines of code
Geogram/Graphite Programming Priorities
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
3. Make it as easy to compile as possible
4. Maximize speed
5. Minimize memory consumption
6. Minimize number of lines of code
7. Minimize number of C++ classes
Geogram/Graphite Programming Priorities
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
3. Make it as easy to compile as possible
4. Maximize speed
5. Minimize memory consumption
6. Minimize number of lines of code
7. Minimize number of C++ classes
Geogram/Graphite Programming Priorities
Simplicity is the
ultimate sophistication
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
3. Make it as easy to compile as possible
4. Maximize speed
5. Minimize memory consumption
6. Minimize number of lines of code
7. Minimize number of C++ classes
Geogram/Graphite Programming Priorities
Simplicity is the
ultimate sophistication
> 1. Hitch hacker’s guide to G.P.
1. Make it as simple as possible (but not simpler)
2. Make it as easy to use as possible
3. Make it as easy to compile as possible
4. Maximize speed
5. Minimize memory consumption
6. Minimize number of lines of code
7. Minimize number of C++ classes
8. Systematically document all classes, all functions, [+Biblio.]
9. Systematically document the implementation of all algorithms
10. Assertion checks everywhere
11. Zero warnings with all compilers / platforms
12. Perform systematic non-regression testing and mem.
check.
Geogram/Graphite Programming Priorities
> 1. Hitch hacker’s guide to G.P.
01/07/2023
-
30
> 2. Packing your luggage ….
01/07/2023
-
31
> 2. Packing your luggage ….
…. data structures
From several Computer Graphics / Mesh Processing 101 courses
- including (earlier versions of) mine -
> 2. Packing your luggage ….
…. data structures
Halfedges Design Principles
1. Individual combinatorial elements
can be created/destroyed at any time
in constant time
2. Basic operations (collapse, split, )
3. Higher-level operations on top of them
Halfedges and edgeuses, harmful or useful ?
> 2. Packing your luggage ….
…. data structures
+ Benefit of abstraction: layered design
Halfedges Design Principles
1. Individual combinatorial elements
can be created/destroyed at any time
in constant time
2. Basic operations (collapse, split, )
3. Higher-level operations on top of them
Halfedges and edgeuses, harmful or useful ?
> 2. Packing your luggage ….
…. data structures
+ Benefit of abstraction: layered design
- Separates things that should have been considered together
Halfedges and edgeuses, harmful or useful ?
Halfedges Design Principles
1. Individual combinatorial elements
can be created/destroyed at any time
in constant time
2. Basic operations (collapse, split, )
3. Higher-level operations on top of them
> 2. Packing your luggage ….
…. data structures
+ Benefit of abstraction: layered design
- Separates things that should have been considered together
Not the optimal level of granularity
Halfedges and edgeuses, harmful or useful ?
Halfedges Design Principles
1. Individual combinatorial elements
can be created/destroyed at any time
in constant time
2. Basic operations (collapse, split, )
3. Higher-level operations on top of them
> 2. Packing your luggage ….
…. data structures
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Objection ! (?) Deletion of one individual element is O(n) instead of constant
In fact: deleting 1 element = wrong granularity level !
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Deleting a bunch of elements
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Deleting a bunch of elements
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Deleting a bunch of elements
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Deleting a bunch of elements – operates also in O(n) – right granularity
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Deleting a bunch of elements – operates also in O(n) – right granularity
Needs array permutation (not in the STL unfortunately,
but easy to implement, see GEOGRAM::permutation).
Indexed Mesh data structure (no data structure)
> 2. Packing your luggage ….
Indexed Mesh data structure (no data structure)
Summary:
•An array of vertices coordinates
•An array of triangle vertices indices
> 2. Packing your luggage ….
•An array of vertices coordinates
•An array of triangle vertices indices
•An array of triangle adjacencies (optional)
•An array of facet first indices (optional)
Indexed Mesh data structure (no data structure)
Summary:
> 2. Packing your luggage ….
Benefits of such a
non-datastructure, non-object, non-oriented, (non-)programming
1. Simpler code
> 2. Packing your luggage ….
…. data structures
Benefits of such a
non-datastructure, non-object, non-oriented, (non-)programming
1. Simpler code
2. Less memory;
> 2. Packing your luggage ….
…. data structures
Benefits of such a
non-datastructure, non-object, non-oriented, (non-)programming
1. Simpler code
2. Less memory;
3. Parallelization #pragma omp parallel for
> 2. Packing your luggage ….
…. data structures
Benefits of such a
non-datastructure, non-object, non-oriented, (non-)programming
1. Simpler code
2. Less memory;
3. Parallelization #pragma omp parallel for
4. Easy copy: memcpy()
> 2. Packing your luggage ….
…. data structures
Benefits of such a
non-datastructure, non-object, non-oriented, (non-)programming
1. Simpler code
2. Less memory;
3. Parallelization #pragma omp parallel for
4. Easy copy: memcpy()
5. Easy I/O: fread()/fwrite()
> 2. Packing your luggage ….
…. data structures
Benefits of such a
non-datastructure, non-object, non-oriented, (non-)programming
1. Simpler code
2. Less memory;
3. Parallelization #pragma omp parallel for
4. Easy copy: memcpy()
5. Easy I/O: fread()/fwrite()
6. Properties/attributes are simply additional arrays
> 2. Packing your luggage ….
…. data structures
Benefits of such a
non-datastructure, non-object, non-oriented, (non-)programming
1. Simpler code
2. Less memory;
3. Parallelization #pragma omp parallel for
4. Easy copy: memcpy()
5. Easy I/O: fread()/fwrite()
6. Properties/attributes are simply additional arrays
7. Directly understood by OpenGL: VertexBufferObject
> 2. Packing your luggage ….
…. data structures
A mesh = a bunch of arrays (std::vectors)
> 2. Packing your luggage ….
…. data structures
A mesh = a bunch of arrays (std::vectors)
How do you iterate on a vector ?
> 2. Packing your luggage ….
…. data structures
Pre-2011:
for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) {
do something with *it
}
How do you iterate on a vector ?
> 2. Packing your luggage ….
…. data structures
Pre-2011:
for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) {
do something with *it
}
How do you iterate on a vector ?
It s a pain to type
Clutters the source-code (less legible)
> 2. Packing your luggage ….
…. data structures
Pre-2011:
for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) {
do something with *it
}
2011:
for(auto it = V.begin(); it!=V.end(); ++it) {
do something with *it
}
How do you iterate on a vector ?
> 2. Packing your luggage ….
…. data structures
Pre-2011:
for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) {
do something with *it
}
2011:
for(auto it = V.begin(); it!=V.end(); ++it) {
do something with *it
}
now:
for(auto&& i : V) {
do something with i
} How do you iterate on a vector ?
> 2. Packing your luggage ….
…. data structures
A mesh = a bunch of arrays (std::vectors)
How do you iterate on a vector ?
Warning: flying tomatoes alert ahead,
(modern C++ lovers might throw tomatoes at me)
!
> 2. Packing your luggage ….
…. data structures
Pre-2011:
for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) {
do something with *it
}
2011:
for(auto it = V.begin(); it!=V.end(); ++it) {
do something with *it
}
now:
for(auto&& i : V) {
do something with I
} How do you iterate on a vector ?
> 2. Packing your luggage ….
…. data structures
How I iterate on a vector:
for(uint i=0; i<V.size(); ++i) {
do something with V[i];
}
How do you iterate on a vector ?
> 2. Packing your luggage ….
…. data structures
How I iterate on a vector:
for(uint i=0; i<V.size(); ++i) {
do something with V[i];
}
+ Easy to understand, even by C-only and Fortran programmers
+ Compatible with all compilers
+ #pragma omp parallel-for friendly* (and also better vectorization)
- 15 additional keystrokes as compared to modern C++ range-for
How do you iterate on a vector ?
*But use ints instead of uints, omp does not like uints
> 2. Packing your luggage ….
…. data structures
How I iterate on a vector:
for(uint i=0; i<V.size(); ++i) {
do something with V[i];
}
+ Easy to understand, even by C-only programmers
+ Compatible with all compilers
+ #pragma omp parallel-for friendly
- 15 additional keystrokes as compared to modern C++ range-for
The following code has been approved for
APPROPRIATE AUDIENCES
PG-13
> 2. Packing your luggage ….
…. data structures
How I iterate on a vector:
for(uint i=0; i<V.size(); ++i) {
do something with V[i];
}
+ Easy to understand, even by C-only programmers
+ Compatible with all compilers
+ #pragma omp parallel-for friendly
- 15 additional keystrokes as compared to modern C++ range-for
#define FOR(i,N) for(uint i=0; i<(N); ++i)
FOR(i,V.size()) {
do something with V[i];
}
+ Easy to understand, legible
+ Trivial iterations easy to spot
- Macros are evil
[Nicolas Ray]
> 2. Packing your luggage ….
…. data structures
Objection:
It is bad because it is not flexible,
what if you want to adapt your algorithm to another container ?
> 2. Packing your luggage ….
…. data structures
Objection:
It is bad because it is not flexible,
what if you want to adapt your algorithm to another container ?
Answer:
I m not going to use something else than a vector, because it is the best
choice for the mesh data structure. Why keeping a tuning knob on the
dash board if it is always on the same position ?
modern/generic != futuristic
> 2. Packing your luggage ….
…. data structures
Objection:
It is bad because it is not flexible,
what if you want to adapt your algorithm to another container ?
Answer:
I m not going to use something else than a vector, because it is the best
choice for the mesh data structure. Why keeping a tuning knob on the
dash board if it is always on the same position ? (think of the I-Phone)
The Nokia N95, a
modern/generic phone.
The I-phone,
a futuristic phone.
modern/generic != futuristic
> 2. Packing your luggage ….
…. data structures
modern/generic != futuristic
It is good because it has
everything that you need
The Nokia N95, a
modern/generic phone.
The I-phone,
a futuristic phone.
> 2. Packing your luggage ….
…. data structures
modern/generic != futuristic
It is good because it has
everything that you need
It is even better because it has
nothing else than what you need
The Nokia N95, a
modern/generic phone.
The I-phone,
a futuristic phone.
> 2. Packing your luggage ….
…. data structures
modern/generic != futuristic
It is good because it has
everything that you need
It is even better because it has
nothing else than what you need
Work is finished when you have
nothing to add and nothing to remove !
The Nokia N95, a
modern/generic phone.
The I-phone,
a futuristic phone.
> 2. Packing your luggage ….
…. data structures
Why keeping a tuning knob on the dash board if it is always
on the same position ? (think of the I-Phone)
A parameter that always has the same value is not a parameter and should be
removed from the API.
A template that is instanced only once should not be a template.
> 2. Packing your luggage ….
…. data structures
A parameter that always has the same value is not a parameter and should be
removed from the API.
A template that is instanced only once should not be a template.
Objection: but we loose genericity if we do that ???
Why keeping a tuning knob on the dash board if it is always
on the same position ? (think of the I-Phone)
> 2. Packing your luggage ….
…. data structures
A parameter that always has the same value is not a parameter and should be
removed from the API.
A template that is instanced only once should not be a template.
Objection: but we loose genericity if we do that ???
Answer to objection: but we gain a lot, it declutters the
code, makes it more legible, reduces compilation times,
makes C++ compilation error messages more legible.
Why keeping a tuning knob on the dash board if it is always
on the same position ? (think of the I-Phone)
> 2. Packing your luggage ….
…. data structures
Rule of thumb:
Make it a parameter not before you need it with at least two different values.
Make it a template not before you need at least two different instanciations.
*regarding compilation time, legibiity of error messages and run-time flex.
> 2. Packing your luggage ….
…. data structures
Rule of thumb:
Make it a parameter not before you need it with at least two different values.
Make it a template not before you need at least two different instanciations.
About templates, consider less annoying* alternatives, such as
(1) object oriented programming / virtual functions
(2) or simply a parameter and if() statements
*regarding compilation time, legibility of error messages and run-time flex.
> 2. Packing your luggage ….
…. data structures
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Pointset processing
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Transfer attributes
between meshes
(texture baking)
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Raytracing with
meshes
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Raytracing with
meshes
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
How do you compute line-triangle intersection ?
[Moller Trumbore]
Google search “stack overflow intersection between line and triangle in 3D”,
See part 3 of the first answer, it is super well explained, I’m 100% objective :-)
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Martin Carvaga
NVidia
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
left(n) = 2*n
right(n) = 2*n+1
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
Triangles array
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
Triangles array
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
Triangles array
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
Triangles array
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
Triangles array
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
Triangles array
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
NVidia
Triangles array
> 3. Finding your way….
…. Geometric search
bool MeshFacetsAABB::ray_intersection_recursive(
const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e
) const
Node index
bbox[n]
> 3. Finding your way….
…. Geometric search
bool MeshFacetsAABB::ray_intersection_recursive(
const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e
) const
Facet sequence
[b, …, e-1]
Node index
bbox[n]
> 3. Finding your way….
…. Geometric search
bool MeshFacetsAABB::ray_intersection_recursive(
const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e
) const
Facet sequence
[b, …, e-1]
Node index
bbox[n]
Initialize traversal with (1, 0, nf)
> 3. Finding your way….
…. Geometric search
bool MeshFacetsAABB::ray_intersection_recursive(
const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e
) const {
if(!ray_box_intersection(R.origin, dirinv, bboxes_[n])) {
return false;
}
if(b + 1 == e) {
return ray_triangle_intersection(R.origin, R.direction, b);
}
index_t m = b + (e - b) / 2; index_t childl = 2 * n; index_t childr = 2 * n + 1;
return (
ray_intersection_recursive(R,dirinv,tmax,ignore_f, childl,b,m) ||
ray_intersection_recursive(R,dirinv,tmax,ignore_f, childr,m,e)
);
}
> 3. Finding your way….
…. Geometric search
bool MeshFacetsAABB::ray_intersection_recursive(
const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e
) const {
if(!ray_box_intersection(R.origin, dirinv, bboxes_[n])) {
return false;
}
if(b + 1 == e) {
return ray_triangle_intersection(R.origin, R.direction, b);
}
index_t m = b + (e - b) / 2; index_t childl = 2 * n; index_t childr = 2 * n + 1;
return (
ray_intersection_recursive(R,dirinv,tmax,ignore_f, childl,b,m) ||
ray_intersection_recursive(R,dirinv,tmax,ignore_f, childr,m,e)
);
}
Early skip
non-intersected boxes
> 3. Finding your way….
…. Geometric search
bool MeshFacetsAABB::ray_intersection_recursive(
const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e
) const {
if(!ray_box_intersection(R.origin, dirinv, bboxes_[n])) {
return false;
}
if(b + 1 == e) {
return ray_triangle_intersection(R.origin, R.direction, b);
}
index_t m = b + (e - b) / 2; index_t childl = 2 * n; index_t childr = 2 * n + 1;
return (
ray_intersection_recursive(R,dirinv,tmax,ignore_f, childl,b,m) ||
ray_intersection_recursive(R,dirinv,tmax,ignore_f, childr,m,e)
);
}
Leaves, with 1 triangle,
Compute ray-tri isect
> 3. Finding your way….
…. Geometric search
bool MeshFacetsAABB::ray_intersection_recursive(
const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e
) const {
if(!ray_box_intersection(R.origin, dirinv, bboxes_[n])) {
return false;
}
if(b + 1 == e) {
return ray_triangle_intersection(R.origin, R.direction, b);
}
index_t m = b + (e - b) / 2; index_t childl = 2 * n; index_t childr = 2 * n + 1;
return (
ray_intersection_recursive(R,dirinv,tmax,ignore_f, childl,b,m) ||
ray_intersection_recursive(R,dirinv,tmax,ignore_f, childr,m,e)
);
}
Recursive traversal
N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Delage Devillers
Spatial sort in CGAL
std::nth_element()
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Shadertoy
Geogram
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Other topics on geometric search
AABB:
SAH (Surface Area Heuristic)
ZMAABB (Zero Memory) [Terdiman]
KdTrees
Pointsets, nearest neighbors queries
*regarding compilation time, legibility of error messages and run-time flex.
> 3. Finding your way….
…. Geometric search
Other topics on geometric search
AABB:
SAH (Surface Area Heuristic)
ZMAABB (Zero Memory) [Terdiman]
KdTrees
Pointsets, nearest neighbors queries
Take home message:
Continuous arrays
As simple as possible
Only store what‟s necessary:
- permute elements of mesh
- plus a couple of additional arrays
*regarding compilation time, legibility of error messages and run-time flex.
>4. Connecting with friends ….
*regarding compilation time, legibility of error messages and run-time flex.
>4. Connecting with friends ….
… Voronoi and Delaunay
>4. Connecting with friends ….
… Voronoi and Delaunay
>4. Connecting with friends ….
… Voronoi and Delaunay
>4. Connecting with friends ….
… Voronoi and Delaunay
Classical algorithm:
Bowyer & Watson
Much material online:
- Hang Si
- Jonathan Shewchuk
- CGAL manuals
>4. Connecting with friends ….
… Voronoi and Delaunay
Constrained Delaunay triangulation
>4. Connecting with friends ….
… Voronoi and Delaunay
Easty-to-read reference:
S.W. Sloan,
A fast algorithm for
generating constrained
Delaunay triangulation,
1992
Implementation in Geogram:
CDT2d
Constrained Delaunay triangulation
Pointset X Simplicial complex S
>4. Connecting with friends ….
… Voronoi and Delaunay
Pointset X Simplicial complex S
either triangulated surface
or tetrahedralized solid
>4. Connecting with friends ….
… Voronoi and Delaunay
Pointset X Simplicial complex S
either triangulated surface
or tetrahedralized solid
Embedded in IRd
>4. Connecting with friends ….
… Voronoi and Delaunay
Vor(X)|S (Intersection between Vor(X) and S)
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
xi
>4. Connecting with friends ….
… Voronoi and Delaunay
“Meshless Voronoi diagrams”
Voronoi cells as iterative convex clipping
Neighbors in increasing distance from xi
xi
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
Bisector of xi, x1
xi
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
Half-space clipping
xi
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
π+(i,1)
π-(i,1)
This side: The other side:
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
Half-space clipping
xi
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
π+(i,1)
π-(i,1)
This side: The other side:
Remove π-(i,1)
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
Half-space clipping
xi
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
Then remove π-(i,2)
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
Half-space clipping
xi
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
… then remove π-(i,3)
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
Half-space clipping
xi
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
… then remove π-(i,4)
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
Half-space clipping
xi
x1
x2
x3
x4
x5
x6
x7
x8
x9
x10
x11
… then remove π-(i,5)
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ?
x1
x2
x3
x4
x5
x7
x8
x9
x10
x11
x6
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ? Rk
x1
x2
x3
x4
x5
x7
x8
x9
x10
x11
x6
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ?
x1
x2
x3
x4
x5
x7
x8
x9
x10
x11
x6
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ? d(xi, xk) > 2 Rk
x1
x2
x3
x4
x5
x7
x8
x9
x10
x11
x6
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
Observation: d(xi, xk+1) > 2Rk → ∩ π+(i,k) = Vor(xi)
[L and Bonneel – Voronoi Parallel Linear Enumeration]
[Dey et.al – Localized co-cone]
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ? d(xi, xk) > 2 Rk
“Radius of security” is reached
[L and Bonneel – Voronoi Parallel Linear Enumeration]
[Dey et.al – Localized co-cone]
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ? d(xi, xk) > 2 Rk
“Radius of security” is reached
Note: Rk decreases and d(xi, xk) increases
[L and Bonneel – Voronoi Parallel Linear Enumeration]
[Dey et.al – Localized co-cone]
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ? d(xi, xk) > 2 Rk
“Radius of security” is reached
Note: Rk decreases and d(xi, xk) increases
Advantages:
[L and Bonneel – Voronoi Parallel Linear Enumeration]
[Dey et.al – Localized co-cone]
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ? d(xi, xk) > 2 Rk
“Radius of security” is reached
Note: Rk decreases and d(xi, xk) increases
Advantages:
(1) Compute Vor(X) ∩ S directly (start with f and clip)
[L and Bonneel – Voronoi Parallel Linear Enumeration]
[Dey et.al – Localized co-cone]
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ? d(xi, xk) > 2 Rk
“Radius of security” is reached
Note: Rk decreases and d(xi, xk) increases
Advantages:
(1) Compute Vor(X) ∩ S directly (start with f and clip)
(2) Replace Delaunay with ANN ! (no d! factor)
[L and Bonneel – Voronoi Parallel Linear Enumeration]
[Dey et.al – Localized co-cone]
>4. Connecting with friends ….
… Voronoi and Delaunay
Voronoi cells as iterative convex clipping
When should I stop ? d(xi, xk) > 2 Rk
“Radius of security” is reached
Note: Rk decreases and d(xi, xk) increases
Advantages:
(1) Compute Vor(X) ∩ S directly (start with f and clip)
(2) Replace Delaunay with ANN ! (no d! factor)
(3) Parallelization is trivial (partition S and // in parts)
[L and Bonneel – Voronoi Parallel Linear Enumeration]
[Dey et.al – Localized co-cone]
>4. Connecting with friends ….
… Voronoi and Delaunay
> 5. Into darkness ….
> 5. Into darkness ….
… geometric predicates
xi
xj
Elementary operation: cut a polygon
(or polyhedron) with a bisector
> 5. Into darkness …
… geometric predicates
xi
xj
Elementary operation: cut a polygon
(or polyhedron) with a bisector
Classify the vertices of the polygon
> 5. Into darkness …
… geometric predicates
xi
xj
Elementary operation: cut a polygon
(or polyhedron) with a bisector
Classify the vertices of the polygon
Sign( d(p,xj) – d(p,xi)) > 0
> 5. Into darkness …
… geometric predicates
xi
xj
Elementary operation: cut a polygon
(or polyhedron) with a bisector
Classify the vertices of the polygon
Sign( d(p,xj) – d(p,xi)) > 0
Sign( d(p,xj) – d(p,xi)) < 0
> 5. Into darkness …
… geometric predicates
xi
xj
Elementary operation: cut a polygon
(or polyhedron) with a bisector
Classify the vertices of the polygon
Compute the intersections
Sign( d(p,xj) – d(p,xi)) > 0
Sign( d(p,xj) – d(p,xi)) < 0
> 5. Into darkness …
… geometric predicates
xi
xj
Sign( d(p,xj) – d(p,xi)) > 0
Sign( d(p,xj) – d(p,xi)) < 0
Elementary operation: cut a polygon
(or polyhedron) with a bisector
Classify the vertices of the polygon
Compute the intersections - discard
> 5. Into darkness …
… geometric predicates
xi
xj
xk Now clipping with the bisector of (xi, xk)
> 5. Into darkness …
… geometric predicates
xi
xj
xk Now clipping with the bisector of (xi, xk)
We need to classify all the points, including
these ones !
> 5. Into darkness …
… geometric predicates
xi
xj
xk Now clipping with the bisector of (xi, xk)
We need to classify all the points, including
these ones !
(they are intersections between a
segment and a bisector)
> 5. Into darkness …
… geometric predicates
xi
xj
xk Now clipping with the bisector of (xi, xk)
We need to classify all the points, including
these ones !
(they are intersections between a
segment and a bisector)
This generates a new intersection
(between a facet and two bisector)
> 5. Into darkness …
… geometric predicates
Three configurations
1) Side(xi,xj,q) where q is a vertex of S
> 5. Into darkness …
… geometric predicates
Three configurations
1) Side1(xi,xj,q)
Three configurations
1) Side1(xi,xj,q)
2) Side(xi,xj,q) where q = π(i,k) ∩ [p1,p2]
> 5. Into darkness …
… geometric predicates
Three configurations
1) Side1(xi,xj,q)
2) Side2(xi,xj,xk,p1,p2)
> 5. Into darkness …
… geometric predicates
Three configurations
1) Side1(xi,xj,q)
2) Side2(xi,xj,xk,p1,p2)
3) Side(xi,xj,q) where
q = π(i,k) ∩ π(i,l) ∩ [p1,p2,p3]
> 5. Into darkness …
… geometric predicates
Three configurations
1) Side1(xi,xj,q)
2) Side2(xi,xj,xk,p1,p2)
3) Side3(xi,xj,xk, xl,p1,p2,p3)
> 5. Into darkness …
… geometric predicates
Three configurations
1) Side1(xi,xj,q)
2) Side2(xi,xj,xk,p1,p2)
3) Side3(xi,xj,xk, xl,p1,p2,p3)
Implementations of exact predicates:
- J. Shewchuk‟s code
- CGAL (Pion, Meyer)
> 5. Into darkness …
… geometric predicates
Three configurations
1) Side1(xi,xj,q)
2) Side2(xi,xj,xk,p1,p2)
3) Side3(xi,xj,xk, xl,p1,p2,p3)
Implementations of exact predicates:
- J. Shewchuk‟s code
- CGAL (Pion, Meyer)
They do not have Side1(), Side2(), Side3() (“exotic predicates”)
> 5. Into darkness …
… geometric predicates
Three configurations
1) Side1(xi,xj,q)
2) Side2(xi,xj,xk,p1,p2)
3) Side3(xi,xj,xk, xl,p1,p2,p3)
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Wish list:
• Easy to use
(no “Guru” needed for each new predicate)
• Reasonably efficient
• Easy to compile/integrate
(multi_precision.h, multi_precision.cpp and that‟s all)
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #1: (dense) multi-precision (GMP)
a0
a1
a2
a3
x 20
x 21*32
x 22*32
x 23*32
…
Each number is an array of (32 bits) integers:
Implement +,-,* (reasonably easy)
Sign: look at the leading non-zero component
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #1: (dense) multi-precision (GMP)
a “limitation”:
c = a10 * 210*32 + b0
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #1: (dense) multi-precision (GMP)
a “limitation”:
b0
0
0
a10
x 20
x 210*32
c = a10 * 210*32 + b0
…
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #2: (sparse) multi-precision
b0 | 0
a10 | 10
c = a10 * 210*32 + b0
Store the exponents of the components
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #2: (sparse) multi-precision
b0 | 0
a10 | 10
c = a10 * 210*32 + b0
Exp. Exp.
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #2: (sparse) multi-precision
b0 | 0
a10 | 10
c = a10 * 210*32 + b0
Exp. Exp.
mantissa mantissa
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #2: (sparse) multi-precision
b0 | 0
a10 | 10
c = a10 * 210*32 + b0
Exp. Exp.
mantissa mantissa
These are floating point numbers !!!
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
x3 x2 x1
…
Each number is represented by the sum of an array of „components‟
These are floating point numbers !!!
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
x3 x2 x1
…
Each number is represented by the sum of an array of „components‟
They are sorted in decreasing exponents
These are floating point numbers !!!
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
x3 x2 x1
…
Each number is represented by the sum of an array of „components‟
They are sorted in decreasing exponents
They are „non-overlapping‟
These are floating point numbers !!!
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
x3 x2 x1
…
Each number is represented by the sum of an array of „components‟
They are sorted in decreasing exponents
They are „non-overlapping‟
The sign is determined by the first component (highest exponent)
These are floating point numbers !!!
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
x2 x1
Two_sum(double a, double b)
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
x2 x1
Two_sum(double a, double b)
+
Length:
l+m
Length l Length m
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
x2 x1
Two_sum(double a, double b)
+
*
Length:
l+m
Length:
2*l
A double
Length l
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
* …
Length: 2*l*m
Expansion * Expansion product implemented by a recursive function
(“distillation”)
Length l Length m
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
* …
Expansion * Expansion product implemented by a recursive function
(“distillation”)
Performance ? 10 to 40 times slower than standard doubles
Length: 2*l*m
Length l Length m
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
* …
Expansion * Expansion product implemented by a recursive function
(“distillation”)
Performance ? 10 to 40 times slower than standard doubles
Use arithmetic filters
Adaptive precision [Shewchuk] ? Too complicated to get right
Length: 2*l*m
Length l Length m
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
Idea #3: expansions (Shewchuk)
* …
Expansion * Expansion product implemented by a recursive function
(“distillation”)
Performance ? 10 to 40 times slower than standard doubles
Use arithmetic filters
Adaptive precision [Shewchuk] ? Too complicated to get right
Quasi-static filters [Meyer and Pion] – FPG generator (easy to use)
Length: 2*l*m
Length l Length m
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
PCK (Predicate Construction Kit)
multi_precision.h / multi_precision.cpp
A “low-level” expansion class (allocates expansions on stack)
A “high-level” C++ number type (+,-,*,Sign overloads)
a script that generates the filter with FPG [Meyer and Pion] and the
exact precision version with expansions
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
We need an exact “number type” with +,-,*,Sign()
PCK (Predicate Construction Kit)
multi_precision.h / multi_precision.cpp
A “low-level” expansion class (allocates expansions on stack)
A “high-level” C++ number type (+,-,*,Sign overloads)
a script that generates the filter with FPG [Meyer and Pion] and the
exact precision version with expansions
So we are done ?
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
xi
xj
Not yet !!
> 5. Into darkness …
… geometric predicates
How to implement Side1(), Side2(), Side3() ?
xi
xj
Not yet !!
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
xi
xj
π(i,j) = {p | d2(p,xi) = d2(p,xj)}
[Voronoi]
[Edelsbrunner et.al]
[Devillers et.al]
> 5. Into darkness …
… geometric predicates
xi
xj
πw(i,j) = {p | d2(p,xi) - wi = d2(p,xj) - wj}
[Voronoi]
[Edelsbrunner et.al]
[Devillers et.al]
> 5. Into darkness …
… geometric predicates
xi
xj
πw(i,j) = {p | d2(p,xi) - wi = d2(p,xj) - wj}
[Voronoi]
[Edelsbrunner et.al]
[Devillers et.al]
The Voronoi diagram is replaced with a power diagram
> 5. Into darkness …
… geometric predicates
xi
xj
πw(i,j) = {p | d2(p,xi) - wi = d2(p,xj) - wj}
[Voronoi]
[Edelsbrunner et.al]
[Devillers et.al]
The Voronoi diagram is replaced with a power diagram
Symbolic perturbation – Simulation of Simplicity:
Define the weight as a function of ε: wi = εi
> 5. Into darkness …
… geometric predicates
xi
xj
πw(i,j) = {p | d2(p,xi) - wi = d2(p,xj) - wj}
[Voronoi]
[Edelsbrunner et.al]
[Devillers et.al]
The Voronoi diagram is replaced with a power diagram
Symbolic perturbation – Simulation of Simplicity:
Define the weight as a function of ε: wi = εi
The combinatorics is determined by the limit ε → 0
> 5. Into darkness …
… geometric predicates
How to write side1(), side2(), side3(), side4() ?
d2(q,pj)-wj – d2(q,pi) + wi where:
q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd]
> 5. Into darkness …
… geometric predicates
How to write side1(), side2(), side3(), side4() ?
d2(q,pj)-wj – d2(q,pi) + wi where:
q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd]
Solve for q in:
q Є πw(i,k1)
…
q Є πw(i,kd)
q Є [p1,p2,p3…pd]
{
> 5. Into darkness …
… geometric predicates
How to write side1(), side2(), side3(), side4() ?
d2(q,pj)-wj – d2(q,pi) + wi where:
q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd]
q = (1/d) Q
Keep numerator and denom.
separate (remember, we are
not allowed to divide)
Solve for q in:
q Є πw(i,k1)
…
q Є πw(i,kd)
q Є [p1,p2,p3…pd]
{
> 5. Into darkness …
… geometric predicates
How to write side1(), side2(), side3(), side4() ?
d2(q,pj)-wj – d2(q,pi) + wi where:
q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd]
q = (1/d) Q
Keep numerator and denom.
separate (remember, we are
not allowed to divide)
Inject q=(1/d) Q in side1() and mutliply by d to remove the division
Solve for q in:
q Є πw(i,k1)
…
q Є πw(i,kd)
q Є [p1,p2,p3…pd]
{
> 5. Into darkness …
… geometric predicates
How to write side1(), side2(), side3(), side4() ?
d2(q,pj)-wj – d2(q,pi) + wi where:
q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd]
q = (1/d) Q
Keep numerator and denom.
separate (remember, we are
not allowed to divide)
Inject q=(1/d) Q in side1() and mutliply by d to remove the division
Order the terms in wi = εi
Solve for q in:
q Є πw(i,k1)
…
q Є πw(i,kd)
q Є [p1,p2,p3…pd]
{
> 5. Into darkness …
… geometric predicates
How to write side1(), side2(), side3(), side4() ?
d2(q,pj)-wj – d2(q,pi) + wi where:
q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd]
q = (1/d) Q
Keep numerator and denom.
separate (remember, we are
not allowed to divide)
Inject q=(1/d) Q in side1() and mutliply by d to remove the division
Order the terms in wi = εi the constant one is non-perturbed predicate
if zero, the first non-zero one determines the sign
Solve for q in:
q Є πw(i,k1)
…
q Є πw(i,kd)
q Є [p1,p2,p3…pd]
{
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh"
Sign predicate(side1)(
point(p0), point(p1), point(q0) DIM
) {
scalar r = sq_dist(p0,p1) ;
r -= 2*dot_at(p1,q0,p0) ;
generic_predicate_result(sign(r)) ;
begin_sos2(p0,p1)
sos(p0,POSITIVE)
sos(p1,NEGATIVE)
end_sos
}
Source PCK
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh"
Sign predicate(side1)(
point(p0), point(p1), point(q0) DIM
) {
scalar r = sq_dist(p0,p1) ;
r -= 2*dot_at(p1,q0,p0) ;
generic_predicate_result(sign(r)) ;
begin_sos2(p0,p1)
sos(p0,POSITIVE)
sos(p1,NEGATIVE)
end_sos
}
Source PCK
(p1-p0).(q0-p0)
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh“
Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) {
scalar l1 = 1*sq_dist(p1,p0) ;
scalar l2 = 1*sq_dist(p2,p0) ;
scalar a10 = 2*dot_at(p1,q0,p0);
scalar a11 = 2*dot_at(p1,q1,p0);
scalar a20 = 2*dot_at(p2,q0,p0);
scalar a21 = 2*dot_at(p2,q1,p0);
scalar Delta = a11 - a10 ;
scalar DeltaLambda0 = a11 - l1 ;
scalar DeltaLambda1 = l1 - a10 ;
scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ;
Sign Delta_sign = sign(Delta) ;
Sign r_sign = sign(r) ;
generic_predicate_result(Delta_sign*r_sign) ;
begin_sos3(p0,p1,p2)
sos(p0, Sign(Delta_sign*sign(Delta-a21+a20)))
sos(p1, Sign(Delta_sign*sign(a21-a20)))
sos(p2, NEGATIVE)
end_sos
} Source PCK
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh“
Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) {
scalar l1 = 1*sq_dist(p1,p0) ;
scalar l2 = 1*sq_dist(p2,p0) ;
scalar a10 = 2*dot_at(p1,q0,p0);
scalar a11 = 2*dot_at(p1,q1,p0);
scalar a20 = 2*dot_at(p2,q0,p0);
scalar a21 = 2*dot_at(p2,q1,p0);
scalar Delta = a11 - a10 ;
scalar DeltaLambda0 = a11 - l1 ;
scalar DeltaLambda1 = l1 - a10 ;
scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ;
Sign Delta_sign = sign(Delta) ;
Sign r_sign = sign(r) ;
generic_predicate_result(Delta_sign*r_sign) ;
begin_sos3(p0,p1,p2)
sos(p0, Sign(Delta_sign*sign(Delta-a21+a20)))
sos(p1, Sign(Delta_sign*sign(a21-a20)))
sos(p2, NEGATIVE)
end_sos
} Source PCK
Denominator
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh“
Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) {
scalar l1 = 1*sq_dist(p1,p0) ;
scalar l2 = 1*sq_dist(p2,p0) ;
scalar a10 = 2*dot_at(p1,q0,p0);
scalar a11 = 2*dot_at(p1,q1,p0);
scalar a20 = 2*dot_at(p2,q0,p0);
scalar a21 = 2*dot_at(p2,q1,p0);
scalar Delta = a11 - a10 ;
scalar DeltaLambda0 = a11 - l1 ;
scalar DeltaLambda1 = l1 - a10 ;
scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ;
Sign Delta_sign = sign(Delta) ;
Sign r_sign = sign(r) ;
generic_predicate_result(Delta_sign*r_sign) ;
begin_sos3(p0,p1,p2)
sos(p0, Sign(Delta_sign*sign(Delta-a21+a20)))
sos(p1, Sign(Delta_sign*sign(a21-a20)))
sos(p2, NEGATIVE)
end_sos
} Source PCK
Barycentric
coords. of q
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh“
Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) {
scalar l1 = 1*sq_dist(p1,p0) ;
scalar l2 = 1*sq_dist(p2,p0) ;
scalar a10 = 2*dot_at(p1,q0,p0);
scalar a11 = 2*dot_at(p1,q1,p0);
scalar a20 = 2*dot_at(p2,q0,p0);
scalar a21 = 2*dot_at(p2,q1,p0);
scalar Delta = a11 - a10 ;
scalar DeltaLambda0 = a11 - l1 ;
scalar DeltaLambda1 = l1 - a10 ;
scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ;
Sign Delta_sign = sign(Delta) ;
Sign r_sign = sign(r) ;
generic_predicate_result(Delta_sign*r_sign) ;
begin_sos3(p0,p1,p2)
sos(p0, Sign(Delta_sign*sign(Delta-a21+a20)))
sos(p1, Sign(Delta_sign*sign(a21-a20)))
sos(p2, NEGATIVE)
end_sos
} Source PCK
Barycentric
coords. of q
Solely depend
on dot products
between input
points
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh“
Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) {
scalar l1 = 1*sq_dist(p1,p0) ;
scalar l2 = 1*sq_dist(p2,p0) ;
scalar a10 = 2*dot_at(p1,q0,p0);
scalar a11 = 2*dot_at(p1,q1,p0);
scalar a20 = 2*dot_at(p2,q0,p0);
scalar a21 = 2*dot_at(p2,q1,p0);
scalar Delta = a11 - a10 ;
scalar DeltaLambda0 = a11 - l1 ;
scalar DeltaLambda1 = l1 - a10 ;
scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ;
Sign Delta_sign = sign(Delta) ;
Sign r_sign = sign(r) ;
generic_predicate_result(Delta_sign*r_sign) ;
begin_sos3(p0,p1,p2)
sos(p0, Sign(Delta_sign*sign(Delta-a21+a20)))
sos(p1, Sign(Delta_sign*sign(a21-a20)))
sos(p2, NEGATIVE)
end_sos
} Source PCK
Result when in
generic position
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh“
Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) {
scalar l1 = 1*sq_dist(p1,p0) ;
scalar l2 = 1*sq_dist(p2,p0) ;
scalar a10 = 2*dot_at(p1,q0,p0);
scalar a11 = 2*dot_at(p1,q1,p0);
scalar a20 = 2*dot_at(p2,q0,p0);
scalar a21 = 2*dot_at(p2,q1,p0);
scalar Delta = a11 - a10 ;
scalar DeltaLambda0 = a11 - l1 ;
scalar DeltaLambda1 = l1 - a10 ;
scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ;
Sign Delta_sign = sign(Delta) ;
Sign r_sign = sign(r) ;
generic_predicate_result(Delta_sign*r_sign) ;
begin_sos3(p0,p1,p2)
sos(p0, Sign(Delta_sign*sign(Delta-a21+a20)))
sos(p1, Sign(Delta_sign*sign(a21-a20)))
sos(p2, NEGATIVE)
end_sos
} Source PCK
Symbolic
perturbation
> 5. Into darkness …
… geometric predicates
Sign side2_exact_SOS(
const double* p0, const double* p1, const double* p2,
const double* q0, const double* q1,
coord_index_t dim
) {
const expansion& l1 = expansion_sq_dist(p1, p0, dim);
const expansion& l2 = expansion_sq_dist(p2, p0, dim);
const expansion& a10 = expansion_dot_at(p1, q0, p0, dim).scale_fast(2.0);
const expansion& a11 = expansion_dot_at(p1, q1, p0, dim).scale_fast(2.0);
const expansion& a20 = expansion_dot_at(p2, q0, p0, dim).scale_fast(2.0);
const expansion& a21 = expansion_dot_at(p2, q1, p0, dim).scale_fast(2.0);
const expansion& Delta = expansion_diff(a11, a10);
Sign Delta_sign = Delta.sign();
vor_assert(Delta_sign != ZERO);
const expansion& DeltaLambda0 = expansion_diff(a11, l1);
const expansion& DeltaLambda1 = expansion_diff(l1, a10);
const expansion& r0 = expansion_product(Delta, l2);
const expansion& r1 = expansion_product(a20, DeltaLambda0).negate();
const expansion& r2 = expansion_product(a21, DeltaLambda1).negate();
const expansion& r = expansion_sum3(r0, r1, r2);
Sign r_sign = r.sign();
………..
Exact version with expansions
> 5. Into darkness …
… geometric predicates
if(r_sign == ZERO) {
const double* p_sort[3];
p_sort[0] = p0;
p_sort[1] = p1;
p_sort[2] = p2;
std::sort(p_sort, p_sort + 3);
for(index_t i = 0; i < 3; ++i) {
if(p_sort[i] == p0) {
const expansion& z1 = expansion_diff(Delta, a21);
const expansion& z = expansion_sum(z1, a20);
Sign z_sign = z.sign();
len_side2_SOS = vor_max(len_side2_SOS, z.length());
if(z_sign != ZERO) {
return Sign(Delta_sign * z_sign);
}
}
if(p_sort[i] == p1) {
const expansion& z = expansion_diff(a21, a20);
Sign z_sign = z.sign();
len_side2_SOS = vor_max(len_side2_SOS, z.length());
if(z_sign != ZERO) {
return Sign(Delta_sign * z_sign);
}
}
if(p_sort[i] == p2) {
return NEGATIVE;
}
}
vor_assert_not_reached;
}
return Sign(Delta_sign * r_sign);
} Exact version with expansions
> 5. Into darkness …
… geometric predicates
#include "kernel.pckh"
Sign predicate(side3)(
point(p0), point(p1), point(p2), point(p3),
point(q0), point(q1), point(q2) DIM
) {
scalar l1 = 1*sq_dist(p1,p0);
scalar l2 = 1*sq_dist(p2,p0);
scalar l3 = 1*sq_dist(p3,p0);
scalar a10 = 2*dot_at(p1,q0,p0);
scalar a11 = 2*dot_at(p1,q1,p0);
scalar a12 = 2*dot_at(p1,q2,p0);
scalar a20 = 2*dot_at(p2,q0,p0);
scalar a21 = 2*dot_at(p2,q1,p0);
scalar a22 = 2*dot_at(p2,q2,p0);
scalar a30 = 2*dot_at(p3,q0,p0);
scalar a31 = 2*dot_at(p3,q1,p0);
scalar a32 = 2*dot_at(p3,q2,p0);
scalar b00 = a11*a22-a12*a21;
scalar b01 = a21-a22;
scalar b02 = a12-a11;
scalar b10 = a12*a20-a10*a22;
scalar b11 = a22-a20;
scalar b12 = a10-a12;
scalar b20 = a10*a21-a11*a20;
scalar b21 = a20-a21;
scalar b22 = a11-a10;
scalar Delta = b00+b10+b20;
scalar DeltaLambda0 =
b01*l1+b02*l2+b00 ;
scalar DeltaLambda1 =
b11*l1+b12*l2+b10 ;
scalar DeltaLambda2 =
b21*l1+b22*l2+b20 ;
scalar r = Delta*l3 - (
a30 * DeltaLambda0 +
a31 * DeltaLambda1 +
a32 * DeltaLambda2
) ;
Sign Delta_sign = sign(Delta) ;
Sign r_sign = sign(r) ;
generic_predicate_result(
Delta_sign*r_sign
) ;
begin_sos4(p0,p1,p2,p3)
sos(p0, Sign(Delta_sign*sign(
Delta-((b01+b02)*a30+
(b11+b12)*a31+
(b21+b22)*a32)
)))
sos(p1, Sign(Delta_sign*
sign((a30*b01)+
(a31*b11)+
(a32*b21))))
sos(p2, Sign(Delta_sign*sign(
(a30*b02)+
(a31*b12)+
(a32*b22))))
sos(p3, NEGATIVE)
end_sos
}
Source PCK
> 5. Into darkness …
… geometric predicates
……….
scalar b00= det3x3(a11,a12,a13,a21,a22,a23,a31,a32,a33);
scalar b01=-det_111_2x3(a21,a22,a23,a31,a32,a33);
scalar b02= det_111_2x3(a11,a12,a13,a31,a32,a33);
scalar b03=-det_111_2x3(a11,a12,a13,a21,a22,a23);
scalar b10=-det3x3(a10,a12,a13,a20,a22,a23,a30,a32,a33);
scalar b11= det_111_2x3(a20,a22,a23,a30,a32,a33);
scalar b12=-det_111_2x3(a10,a12,a13,a30,a32,a33);
scalar b13= det_111_2x3(a10,a12,a13,a20,a22,a23);
scalar b20= det3x3(a10,a11,a13,a20,a21,a23,a30,a31,a33);
scalar b21=-det_111_2x3(a20,a21,a23,a30,a31,a33);
scalar b22= det_111_2x3(a10,a11,a13,a30,a31,a33);
scalar b23=-det_111_2x3(a10,a11,a13,a20,a21,a23);
scalar b30=-det3x3(a10,a11,a12,a20,a21,a22,a30,a31,a32);
scalar b31= det_111_2x3(a20,a21,a22,a30,a31,a32);
scalar b32=-det_111_2x3(a10,a11,a12,a30,a31,a32);
scalar b33= det_111_2x3(a10,a11,a12,a20,a21,a22);
scalar Delta=b00+b10+b20+b30;
scalar DeltaLambda0 = b01*l1+b02*l2+b03*l3+b00;
scalar DeltaLambda1 = b11*l1+b12*l2+b13*l3+b10;
scalar DeltaLambda2 = b21*l1+b22*l2+b23*l3+b20;
scalar DeltaLambda3 = b31*l1+b32*l2+b33*l3+b30;
……….
scalar r = Delta*l4 - (
a40*DeltaLambda0+
a41*DeltaLambda1+
a42*DeltaLambda2+
a43*DeltaLambda3
);
Sign Delta_sign = sign(Delta);
generic_predicate_result(Delta_sign*sign(r)) ;
begin_sos5(p0,p1,p2,p3,p4)
sos(p0, Sign( Delta_sign*sign(Delta - (
(b01+b02+b03)*a30 +
(b11+b12+b13)*a31 +
(b21+b22+b23)*a32 +
(b31+b32+b33)*a33
)))
)
sos(p1, Sign( Delta_sign*sign(a30*b01+a31*b11+a32*b21+a33*b31)))
sos(p2, Sign( Delta_sign*sign(a30*b02+a31*b12+a32*b22+a33*b32)))
sos(p3, Sign( Delta_sign*sign(a30*b03+a31*b13+a32*b23+a33*b33)))
sos(p4, NEGATIVE)
end_sos
}
q is the intersection of three bisectors and a tetrahedron embedded in nD
Note: There is a special case in 3d (no need for the tetrahedron) = insphere3d()
The code of the general
nD version (excerpt) :
Source PCK
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
A nice model for Thingy30K …
Putting everything together …
> 5. Into darkness …
… geometric predicates
Take a closer look … Aaaahhhhhh !!!!
> 5. Into darkness …
… geometric predicates
> Intersect; Remove internal boundaries; Tetgen
> 5. Into darkness …
… geometric predicates
Aaaahhhhhh !!!!
> 5. Into darkness …
… geometric predicates
> Intersect; Remove internal boundaries; Tetgen
> 5. Into darkness …
… geometric predicates
Aaaahhhhhh !!!!
> 5. Into darkness …
… geometric predicates
> Intersect; Remove internal boundaries; Tetgen
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
> 5. Into darkness …
… geometric predicates
More on this, to read on the beach:
- Chewchuk
- Sylvain Pion, FPG
- CGAL
- Tetwild, FastTetwild
- Attene, Cherchi, Livesu
- Thingy30K
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Physics
Math
Computer
Science
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Physics
Math
Computer
Science
Got the feeling that
there are intersting
things to discover
exactly here !
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Physics
Math
Computer
Science
A journey in Mathland
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Math
A journey in Mathland
Optimal
transport
A numerical algorithm for
Semi-discrete OT in 3D,
ESAIM Math Modeling
and Analysis, L, 2015
Centroidal Power Diagrams,
ACM TOG/SIGGRAPH Asia,
Xin, L, Chen, Chu, Yue, Wang
2016
Notions of OT theory and how
to implement them on a
Computer,
Computer & Graphics,
L & Schwindt, 2018
BIRS Banff, BIRS Oaxaca,
Institut Fourier, Bonn
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Math
A journey in Mathland
Optimal
transport Recorded lecture
& slides on the web
Links from my webpage
brunolevy.github.io
SGP2018 Graduate Course
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Math
The trip continues in Physland…
Optimal
transport
Physics
Computational
fluid
dynamics
C.S.
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Free-surface fluid simulation, J. of computational Physics, B, 2022
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Math
The trip continues in Physland…
Optimal
transport
Physics
Computational
fluid
dynamics
C.S.
Cosmology
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Monthly Notices of the Royal Astron Soc., L, Mohayaee, S.von Hausegger 2021
Physical Review Letters, von Hausegger, L, Mohayaee, 2022
Physical Review Letters, Nikhaktar, Sheth, L, Mohayaee, 2022
Featured in Physics Magazine
A mathematical time machine to explore the origins of the Universe
*regarding compilation time, legibility of error messages and run-time flex.
>6. Planning your next trip ….
… GP in other sciences
Math
Love Physland, I settled down there !
Optimal
transport
Physics
Computational
fluid
dynamics
C.S.
Cosmology
>Epilogue ….
How GP (and Geogram) can help other sciences
The “product”: geogram (on github)
The “product”: geogram (on github)
Is it good ?
The “product”: geogram (on github)
Is it good ? Yes and no
23 years of code, 40 papers, 2 ERCs
+ functionalities, efficiency, small footprint
+ few dependencies
+ high portability (Linux/Mac/Win/Android/web)
+ heavily tested
- there is technical debt
- arrays/pointers-based,
API may feel a bit weird and low-level
Projects with Geogram
(industry and academic)
What GP can do for other sciences
- Dare computing what others would not dream of.
- Mix of math. and algorithmics.
- C++ ninjas, high tech (GPUs…).
- Irregular geometric data structures.
Voronoi/Laguerre diagrams of
astronomical size
(hundred millions cells)
> Deactivate ("Gray beard speaker"); switch to Q&A mode.

Contenu connexe

Tendances

Analisi el lladre de bicicletes
Analisi el lladre de bicicletesAnalisi el lladre de bicicletes
Analisi el lladre de bicicletessandroalfaro
 
Comparació Plató Nietzsche
Comparació Plató NietzscheComparació Plató Nietzsche
Comparació Plató NietzscheDaniel Fernández
 
Notes DATA STRUCTURE - queue
Notes DATA STRUCTURE - queueNotes DATA STRUCTURE - queue
Notes DATA STRUCTURE - queueFarhanum Aziera
 
AVL tree ( Balanced Binary Search Tree)-Data Structure
AVL tree ( Balanced Binary Search Tree)-Data StructureAVL tree ( Balanced Binary Search Tree)-Data Structure
AVL tree ( Balanced Binary Search Tree)-Data StructureYaksh Jethva
 
Binary trees
Binary treesBinary trees
Binary treesAmit Vats
 
Manifold learning with application to object recognition
Manifold learning with application to object recognitionManifold learning with application to object recognition
Manifold learning with application to object recognitionzukun
 
신뢰 전파 기법을 이용한 스테레오 정합(Stereo matching using belief propagation algorithm)
신뢰 전파 기법을 이용한 스테레오 정합(Stereo matching using belief propagation algorithm)신뢰 전파 기법을 이용한 스테레오 정합(Stereo matching using belief propagation algorithm)
신뢰 전파 기법을 이용한 스테레오 정합(Stereo matching using belief propagation algorithm)Hansol Kang
 
Sistemes representació
Sistemes representacióSistemes representació
Sistemes representacióbinitue
 
Lecture 10 data structures and algorithms
Lecture 10 data structures and algorithmsLecture 10 data structures and algorithms
Lecture 10 data structures and algorithmsAakash deep Singhal
 
La qüestió dels Universals
La qüestió dels UniversalsLa qüestió dels Universals
La qüestió dels UniversalsAnna Sarsanedas
 
Composició i enquadrament de l'imatge
Composició  i enquadrament de l'imatgeComposició  i enquadrament de l'imatge
Composició i enquadrament de l'imatgeIngrid Brosman
 

Tendances (20)

Heap tree
Heap treeHeap tree
Heap tree
 
Analisi el lladre de bicicletes
Analisi el lladre de bicicletesAnalisi el lladre de bicicletes
Analisi el lladre de bicicletes
 
Simbolismo
SimbolismoSimbolismo
Simbolismo
 
Graph data structure and algorithms
Graph data structure and algorithmsGraph data structure and algorithms
Graph data structure and algorithms
 
Comparació Plató Nietzsche
Comparació Plató NietzscheComparació Plató Nietzsche
Comparació Plató Nietzsche
 
Kruskal Algorithm
Kruskal AlgorithmKruskal Algorithm
Kruskal Algorithm
 
Notes DATA STRUCTURE - queue
Notes DATA STRUCTURE - queueNotes DATA STRUCTURE - queue
Notes DATA STRUCTURE - queue
 
E Munch El Crit
E Munch  El CritE Munch  El Crit
E Munch El Crit
 
AVL tree ( Balanced Binary Search Tree)-Data Structure
AVL tree ( Balanced Binary Search Tree)-Data StructureAVL tree ( Balanced Binary Search Tree)-Data Structure
AVL tree ( Balanced Binary Search Tree)-Data Structure
 
Binary trees
Binary treesBinary trees
Binary trees
 
Manifold learning with application to object recognition
Manifold learning with application to object recognitionManifold learning with application to object recognition
Manifold learning with application to object recognition
 
신뢰 전파 기법을 이용한 스테레오 정합(Stereo matching using belief propagation algorithm)
신뢰 전파 기법을 이용한 스테레오 정합(Stereo matching using belief propagation algorithm)신뢰 전파 기법을 이용한 스테레오 정합(Stereo matching using belief propagation algorithm)
신뢰 전파 기법을 이용한 스테레오 정합(Stereo matching using belief propagation algorithm)
 
Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
Abstracció
AbstraccióAbstracció
Abstracció
 
Sistemes representació
Sistemes representacióSistemes representació
Sistemes representació
 
Lecture 10 data structures and algorithms
Lecture 10 data structures and algorithmsLecture 10 data structures and algorithms
Lecture 10 data structures and algorithms
 
La qüestió dels Universals
La qüestió dels UniversalsLa qüestió dels Universals
La qüestió dels Universals
 
Chap 8 graph
Chap 8 graphChap 8 graph
Chap 8 graph
 
Composició i enquadrament de l'imatge
Composició  i enquadrament de l'imatgeComposició  i enquadrament de l'imatge
Composició i enquadrament de l'imatge
 
Sopa Campbell
Sopa CampbellSopa Campbell
Sopa Campbell
 

Similaire à SGP 2023 graduate school - A quick journey into geometry processing

The joy of computer graphics programming
The joy of computer graphics programmingThe joy of computer graphics programming
The joy of computer graphics programmingBruno Levy
 
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...Josef A. Habdank
 
Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2ice799
 
Peddle the Pedal to the Metal
Peddle the Pedal to the MetalPeddle the Pedal to the Metal
Peddle the Pedal to the MetalC4Media
 
There's no magic... until you talk about databases
 There's no magic... until you talk about databases There's no magic... until you talk about databases
There's no magic... until you talk about databasesESUG
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource KernelsSilvio Cesare
 
Improving app performance using .Net Core 3.0
Improving app performance using .Net Core 3.0Improving app performance using .Net Core 3.0
Improving app performance using .Net Core 3.0Richard Banks
 
Memory Optimization
Memory OptimizationMemory Optimization
Memory Optimizationguest3eed30
 
Memory Optimization
Memory OptimizationMemory Optimization
Memory OptimizationWei Lin
 
Distributed Computing & MapReduce
Distributed Computing & MapReduceDistributed Computing & MapReduce
Distributed Computing & MapReducecoolmirza143
 
Optimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark HarknessOptimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark Harknessozlael ozlael
 
Optimizing Games for Mobiles
Optimizing Games for MobilesOptimizing Games for Mobiles
Optimizing Games for MobilesSt1X
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidStanojko Markovik
 
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...Maarten Balliauw
 
Go Faster With Native Compilation
Go Faster With Native CompilationGo Faster With Native Compilation
Go Faster With Native CompilationPGConf APAC
 

Similaire à SGP 2023 graduate school - A quick journey into geometry processing (20)

The joy of computer graphics programming
The joy of computer graphics programmingThe joy of computer graphics programming
The joy of computer graphics programming
 
Programar para GPUs
Programar para GPUsProgramar para GPUs
Programar para GPUs
 
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
Extreme Apache Spark: how in 3 months we created a pipeline that can process ...
 
Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2Infrastructure as code might be literally impossible part 2
Infrastructure as code might be literally impossible part 2
 
Peddle the Pedal to the Metal
Peddle the Pedal to the MetalPeddle the Pedal to the Metal
Peddle the Pedal to the Metal
 
There's no magic... until you talk about databases
 There's no magic... until you talk about databases There's no magic... until you talk about databases
There's no magic... until you talk about databases
 
Auditing the Opensource Kernels
Auditing the Opensource KernelsAuditing the Opensource Kernels
Auditing the Opensource Kernels
 
Introduction to Parallelization ans performance optimization
Introduction to Parallelization ans performance optimizationIntroduction to Parallelization ans performance optimization
Introduction to Parallelization ans performance optimization
 
Improving app performance using .Net Core 3.0
Improving app performance using .Net Core 3.0Improving app performance using .Net Core 3.0
Improving app performance using .Net Core 3.0
 
Memory Optimization
Memory OptimizationMemory Optimization
Memory Optimization
 
Memory Optimization
Memory OptimizationMemory Optimization
Memory Optimization
 
Distributed Computing & MapReduce
Distributed Computing & MapReduceDistributed Computing & MapReduce
Distributed Computing & MapReduce
 
0507 057 01 98 * Adana Cukurova Klima Servisleri
0507 057 01 98 * Adana Cukurova Klima Servisleri0507 057 01 98 * Adana Cukurova Klima Servisleri
0507 057 01 98 * Adana Cukurova Klima Servisleri
 
Optimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark HarknessOptimizing mobile applications - Ian Dundore, Mark Harkness
Optimizing mobile applications - Ian Dundore, Mark Harkness
 
Optimizing Games for Mobiles
Optimizing Games for MobilesOptimizing Games for Mobiles
Optimizing Games for Mobiles
 
Introduction to Parallelization ans performance optimization
Introduction to Parallelization ans performance optimizationIntroduction to Parallelization ans performance optimization
Introduction to Parallelization ans performance optimization
 
Fedor Polyakov - Optimizing computer vision problems on mobile platforms
Fedor Polyakov - Optimizing computer vision problems on mobile platforms Fedor Polyakov - Optimizing computer vision problems on mobile platforms
Fedor Polyakov - Optimizing computer vision problems on mobile platforms
 
The Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with androidThe Good, the Bad and the Ugly things to do with android
The Good, the Bad and the Ugly things to do with android
 
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
 
Go Faster With Native Compilation
Go Faster With Native CompilationGo Faster With Native Compilation
Go Faster With Native Compilation
 

Plus de Bruno Levy

Brenier-Monge-Ampère gravity
Brenier-Monge-Ampère gravityBrenier-Monge-Ampère gravity
Brenier-Monge-Ampère gravityBruno Levy
 
03_spectral_computing.pdf
03_spectral_computing.pdf03_spectral_computing.pdf
03_spectral_computing.pdfBruno Levy
 
04_spectral_applications.pdf
04_spectral_applications.pdf04_spectral_applications.pdf
04_spectral_applications.pdfBruno Levy
 
Meshing for computer graphics
Meshing for computer graphicsMeshing for computer graphics
Meshing for computer graphicsBruno Levy
 
Centroidal Voronoi Tessellations for Graphs (Eurographics 2012)
Centroidal Voronoi Tessellations for Graphs (Eurographics 2012)Centroidal Voronoi Tessellations for Graphs (Eurographics 2012)
Centroidal Voronoi Tessellations for Graphs (Eurographics 2012)Bruno Levy
 
CGI2018 keynote - fluids simulation
CGI2018 keynote - fluids simulationCGI2018 keynote - fluids simulation
CGI2018 keynote - fluids simulationBruno Levy
 
Course on Optimal Transport
Course on Optimal TransportCourse on Optimal Transport
Course on Optimal TransportBruno Levy
 
Simuler la physique avec un ordinateur
Simuler la physique avec un ordinateurSimuler la physique avec un ordinateur
Simuler la physique avec un ordinateurBruno Levy
 
Optimal Transport for a Computer Programmer's Point of View
Optimal Transport for a Computer Programmer's Point of ViewOptimal Transport for a Computer Programmer's Point of View
Optimal Transport for a Computer Programmer's Point of ViewBruno Levy
 

Plus de Bruno Levy (11)

Brenier-Monge-Ampère gravity
Brenier-Monge-Ampère gravityBrenier-Monge-Ampère gravity
Brenier-Monge-Ampère gravity
 
03_spectral_computing.pdf
03_spectral_computing.pdf03_spectral_computing.pdf
03_spectral_computing.pdf
 
04_spectral_applications.pdf
04_spectral_applications.pdf04_spectral_applications.pdf
04_spectral_applications.pdf
 
Meshing for computer graphics
Meshing for computer graphicsMeshing for computer graphics
Meshing for computer graphics
 
Centroidal Voronoi Tessellations for Graphs (Eurographics 2012)
Centroidal Voronoi Tessellations for Graphs (Eurographics 2012)Centroidal Voronoi Tessellations for Graphs (Eurographics 2012)
Centroidal Voronoi Tessellations for Graphs (Eurographics 2012)
 
CGI2018 keynote - fluids simulation
CGI2018 keynote - fluids simulationCGI2018 keynote - fluids simulation
CGI2018 keynote - fluids simulation
 
Course on Optimal Transport
Course on Optimal TransportCourse on Optimal Transport
Course on Optimal Transport
 
Igrv2017
Igrv2017Igrv2017
Igrv2017
 
Voronoy Story
Voronoy StoryVoronoy Story
Voronoy Story
 
Simuler la physique avec un ordinateur
Simuler la physique avec un ordinateurSimuler la physique avec un ordinateur
Simuler la physique avec un ordinateur
 
Optimal Transport for a Computer Programmer's Point of View
Optimal Transport for a Computer Programmer's Point of ViewOptimal Transport for a Computer Programmer's Point of View
Optimal Transport for a Computer Programmer's Point of View
 

Dernier

Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptxAlMamun560346
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfSumit Kumar yadav
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Lokesh Kothari
 
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...ssuser79fe74
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learninglevieagacer
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Monika Rani
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPirithiRaju
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICEayushi9330
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxgindu3009
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​kaibalyasahoo82800
 
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxCOST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxFarihaAbdulRasheed
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...Lokesh Kothari
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .Poonam Aher Patil
 
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)Joonhun Lee
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Silpa
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000Sapana Sha
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksSérgio Sacani
 

Dernier (20)

Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
 
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxCOST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 

SGP 2023 graduate school - A quick journey into geometry processing

  • 1. 1
  • 3. 01/07/2023 - My goals >1. Give you some pointers >2. Give you some good « tricks » 3
  • 4. 01/07/2023 - Syllabus >1. The hitch hacker’s guide to geometry processing >2. Packing your luggage >3. Finding your way >4. Connecting with friends >5. Into darkness >6. Planning your next trip 4
  • 6. 01/07/2023 - 1. The hitch hacker’s guide to Geometry Proc. > Activate ("Gray beard’s provocative introduction") 6
  • 7. > 1. Hitch hacker’s guide to G.P.
  • 8. 1979 Apple ][ 6502 processor, 1MHz 64Kb RAM Approx. 10 FLOPs > 1. Hitch hacker’s guide to G.P.
  • 9. 1979 Apple ][ 6502 processor, 1MHz 64Kb RAM Approx. 10 FLOPs 2023 PC Core i7 gen4, 3 GHz 16Gb RAM Approx. 300 GFLOPs > 1. Hitch hacker’s guide to G.P.
  • 10. 1979 Apple ][ 6502 processor, 1MHz 64Kb RAM Approx. 10 FLOPs 2023 PC Core i7 gen4, 3 GHz 16Gb RAM Approx. 300 GFLOPs X 3 million !!!! 44 years > 1. Hitch hacker’s guide to G.P.
  • 11. Boots in 20 seconds Boots in 3 minutes > 1. Hitch hacker’s guide to G.P.
  • 12. Boots in 20 seconds Boots in 3 minutes Where did the 3 million acceleration factor go ? > 1. Hitch hacker’s guide to G.P.
  • 13. What can you do in 20 seconds ? 3 GHz, 4 cores = 240 billions instructions !! > 1. Hitch hacker’s guide to G.P.
  • 14. If you cannot do the job in less than 20 seconds on a modern PC, then there is probably a problem somewhere What can you do in 20 seconds ? 3 GHz, 4 cores = 240 billions instructions !! > 1. Hitch hacker’s guide to G.P.
  • 15. Boots in 20 seconds Boots in 3 minutes Where did the 1 million acceleration factor go ? - Lost in abstraction - > 1. Hitch hacker’s guide to G.P.
  • 16. Abstraction in Programming: + Separates concepts + Separates specification from Implementation > 1. Hitch hacker’s guide to G.P.
  • 17. Abstraction in Programming: + Separates concepts + Separates specification from Implementation - Sometimes separates things that should be considered together !! > 1. Hitch hacker’s guide to G.P.
  • 18. Futuristic programming Usefullness (and coolness) are primary ! > 1. Hitch hacker’s guide to G.P.
  • 19. • Jonathan Shewchuk s Triangle and exact predicates • Tetgen, MGTetra, MMG3d • Omar Cornut s ImGUI library • David Mount s ANN library • The LUA prog. language Futuristic programming Examples of Futuristic codes Usefullness (and coolness) are primary ! > 1. Hitch hacker’s guide to G.P.
  • 20. Geogram/Graphite Programming Priorities 1. Make it as simple as possible (but not simpler) > 1. Hitch hacker’s guide to G.P.
  • 21. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible Geogram/Graphite Programming Priorities > 1. Hitch hacker’s guide to G.P.
  • 22. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible 3. Make it as easy to compile as possible Geogram/Graphite Programming Priorities > 1. Hitch hacker’s guide to G.P.
  • 23. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible 3. Make it as easy to compile as possible 4. Maximize speed Geogram/Graphite Programming Priorities > 1. Hitch hacker’s guide to G.P.
  • 24. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible 3. Make it as easy to compile as possible 4. Maximize speed 5. Minimize memory consumption Geogram/Graphite Programming Priorities > 1. Hitch hacker’s guide to G.P.
  • 25. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible 3. Make it as easy to compile as possible 4. Maximize speed 5. Minimize memory consumption 6. Minimize number of lines of code Geogram/Graphite Programming Priorities > 1. Hitch hacker’s guide to G.P.
  • 26. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible 3. Make it as easy to compile as possible 4. Maximize speed 5. Minimize memory consumption 6. Minimize number of lines of code 7. Minimize number of C++ classes Geogram/Graphite Programming Priorities > 1. Hitch hacker’s guide to G.P.
  • 27. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible 3. Make it as easy to compile as possible 4. Maximize speed 5. Minimize memory consumption 6. Minimize number of lines of code 7. Minimize number of C++ classes Geogram/Graphite Programming Priorities Simplicity is the ultimate sophistication > 1. Hitch hacker’s guide to G.P.
  • 28. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible 3. Make it as easy to compile as possible 4. Maximize speed 5. Minimize memory consumption 6. Minimize number of lines of code 7. Minimize number of C++ classes Geogram/Graphite Programming Priorities Simplicity is the ultimate sophistication > 1. Hitch hacker’s guide to G.P.
  • 29. 1. Make it as simple as possible (but not simpler) 2. Make it as easy to use as possible 3. Make it as easy to compile as possible 4. Maximize speed 5. Minimize memory consumption 6. Minimize number of lines of code 7. Minimize number of C++ classes 8. Systematically document all classes, all functions, [+Biblio.] 9. Systematically document the implementation of all algorithms 10. Assertion checks everywhere 11. Zero warnings with all compilers / platforms 12. Perform systematic non-regression testing and mem. check. Geogram/Graphite Programming Priorities > 1. Hitch hacker’s guide to G.P.
  • 30. 01/07/2023 - 30 > 2. Packing your luggage ….
  • 31. 01/07/2023 - 31 > 2. Packing your luggage …. …. data structures
  • 32. From several Computer Graphics / Mesh Processing 101 courses - including (earlier versions of) mine - > 2. Packing your luggage …. …. data structures
  • 33. Halfedges Design Principles 1. Individual combinatorial elements can be created/destroyed at any time in constant time 2. Basic operations (collapse, split, ) 3. Higher-level operations on top of them Halfedges and edgeuses, harmful or useful ? > 2. Packing your luggage …. …. data structures
  • 34. + Benefit of abstraction: layered design Halfedges Design Principles 1. Individual combinatorial elements can be created/destroyed at any time in constant time 2. Basic operations (collapse, split, ) 3. Higher-level operations on top of them Halfedges and edgeuses, harmful or useful ? > 2. Packing your luggage …. …. data structures
  • 35. + Benefit of abstraction: layered design - Separates things that should have been considered together Halfedges and edgeuses, harmful or useful ? Halfedges Design Principles 1. Individual combinatorial elements can be created/destroyed at any time in constant time 2. Basic operations (collapse, split, ) 3. Higher-level operations on top of them > 2. Packing your luggage …. …. data structures
  • 36. + Benefit of abstraction: layered design - Separates things that should have been considered together Not the optimal level of granularity Halfedges and edgeuses, harmful or useful ? Halfedges Design Principles 1. Individual combinatorial elements can be created/destroyed at any time in constant time 2. Basic operations (collapse, split, ) 3. Higher-level operations on top of them > 2. Packing your luggage …. …. data structures
  • 37. Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 38. Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 39. Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 40. Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 41. Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 42. Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 43. Objection ! (?) Deletion of one individual element is O(n) instead of constant In fact: deleting 1 element = wrong granularity level ! Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 44. Deleting a bunch of elements Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 45. Deleting a bunch of elements Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 46. Deleting a bunch of elements Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 47. Deleting a bunch of elements – operates also in O(n) – right granularity Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 48. Deleting a bunch of elements – operates also in O(n) – right granularity Needs array permutation (not in the STL unfortunately, but easy to implement, see GEOGRAM::permutation). Indexed Mesh data structure (no data structure) > 2. Packing your luggage ….
  • 49. Indexed Mesh data structure (no data structure) Summary: •An array of vertices coordinates •An array of triangle vertices indices > 2. Packing your luggage ….
  • 50. •An array of vertices coordinates •An array of triangle vertices indices •An array of triangle adjacencies (optional) •An array of facet first indices (optional) Indexed Mesh data structure (no data structure) Summary: > 2. Packing your luggage ….
  • 51. Benefits of such a non-datastructure, non-object, non-oriented, (non-)programming 1. Simpler code > 2. Packing your luggage …. …. data structures
  • 52. Benefits of such a non-datastructure, non-object, non-oriented, (non-)programming 1. Simpler code 2. Less memory; > 2. Packing your luggage …. …. data structures
  • 53. Benefits of such a non-datastructure, non-object, non-oriented, (non-)programming 1. Simpler code 2. Less memory; 3. Parallelization #pragma omp parallel for > 2. Packing your luggage …. …. data structures
  • 54. Benefits of such a non-datastructure, non-object, non-oriented, (non-)programming 1. Simpler code 2. Less memory; 3. Parallelization #pragma omp parallel for 4. Easy copy: memcpy() > 2. Packing your luggage …. …. data structures
  • 55. Benefits of such a non-datastructure, non-object, non-oriented, (non-)programming 1. Simpler code 2. Less memory; 3. Parallelization #pragma omp parallel for 4. Easy copy: memcpy() 5. Easy I/O: fread()/fwrite() > 2. Packing your luggage …. …. data structures
  • 56. Benefits of such a non-datastructure, non-object, non-oriented, (non-)programming 1. Simpler code 2. Less memory; 3. Parallelization #pragma omp parallel for 4. Easy copy: memcpy() 5. Easy I/O: fread()/fwrite() 6. Properties/attributes are simply additional arrays > 2. Packing your luggage …. …. data structures
  • 57. Benefits of such a non-datastructure, non-object, non-oriented, (non-)programming 1. Simpler code 2. Less memory; 3. Parallelization #pragma omp parallel for 4. Easy copy: memcpy() 5. Easy I/O: fread()/fwrite() 6. Properties/attributes are simply additional arrays 7. Directly understood by OpenGL: VertexBufferObject > 2. Packing your luggage …. …. data structures
  • 58. A mesh = a bunch of arrays (std::vectors) > 2. Packing your luggage …. …. data structures
  • 59. A mesh = a bunch of arrays (std::vectors) How do you iterate on a vector ? > 2. Packing your luggage …. …. data structures
  • 60. Pre-2011: for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) { do something with *it } How do you iterate on a vector ? > 2. Packing your luggage …. …. data structures
  • 61. Pre-2011: for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) { do something with *it } How do you iterate on a vector ? It s a pain to type Clutters the source-code (less legible) > 2. Packing your luggage …. …. data structures
  • 62. Pre-2011: for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) { do something with *it } 2011: for(auto it = V.begin(); it!=V.end(); ++it) { do something with *it } How do you iterate on a vector ? > 2. Packing your luggage …. …. data structures
  • 63. Pre-2011: for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) { do something with *it } 2011: for(auto it = V.begin(); it!=V.end(); ++it) { do something with *it } now: for(auto&& i : V) { do something with i } How do you iterate on a vector ? > 2. Packing your luggage …. …. data structures
  • 64. A mesh = a bunch of arrays (std::vectors) How do you iterate on a vector ? Warning: flying tomatoes alert ahead, (modern C++ lovers might throw tomatoes at me) ! > 2. Packing your luggage …. …. data structures
  • 65. Pre-2011: for(std::vector<Thing>::iterator it = V.begin(); it!=V.end(); ++it) { do something with *it } 2011: for(auto it = V.begin(); it!=V.end(); ++it) { do something with *it } now: for(auto&& i : V) { do something with I } How do you iterate on a vector ? > 2. Packing your luggage …. …. data structures
  • 66. How I iterate on a vector: for(uint i=0; i<V.size(); ++i) { do something with V[i]; } How do you iterate on a vector ? > 2. Packing your luggage …. …. data structures
  • 67. How I iterate on a vector: for(uint i=0; i<V.size(); ++i) { do something with V[i]; } + Easy to understand, even by C-only and Fortran programmers + Compatible with all compilers + #pragma omp parallel-for friendly* (and also better vectorization) - 15 additional keystrokes as compared to modern C++ range-for How do you iterate on a vector ? *But use ints instead of uints, omp does not like uints > 2. Packing your luggage …. …. data structures
  • 68. How I iterate on a vector: for(uint i=0; i<V.size(); ++i) { do something with V[i]; } + Easy to understand, even by C-only programmers + Compatible with all compilers + #pragma omp parallel-for friendly - 15 additional keystrokes as compared to modern C++ range-for The following code has been approved for APPROPRIATE AUDIENCES PG-13 > 2. Packing your luggage …. …. data structures
  • 69. How I iterate on a vector: for(uint i=0; i<V.size(); ++i) { do something with V[i]; } + Easy to understand, even by C-only programmers + Compatible with all compilers + #pragma omp parallel-for friendly - 15 additional keystrokes as compared to modern C++ range-for #define FOR(i,N) for(uint i=0; i<(N); ++i) FOR(i,V.size()) { do something with V[i]; } + Easy to understand, legible + Trivial iterations easy to spot - Macros are evil [Nicolas Ray] > 2. Packing your luggage …. …. data structures
  • 70. Objection: It is bad because it is not flexible, what if you want to adapt your algorithm to another container ? > 2. Packing your luggage …. …. data structures
  • 71. Objection: It is bad because it is not flexible, what if you want to adapt your algorithm to another container ? Answer: I m not going to use something else than a vector, because it is the best choice for the mesh data structure. Why keeping a tuning knob on the dash board if it is always on the same position ? modern/generic != futuristic > 2. Packing your luggage …. …. data structures
  • 72. Objection: It is bad because it is not flexible, what if you want to adapt your algorithm to another container ? Answer: I m not going to use something else than a vector, because it is the best choice for the mesh data structure. Why keeping a tuning knob on the dash board if it is always on the same position ? (think of the I-Phone) The Nokia N95, a modern/generic phone. The I-phone, a futuristic phone. modern/generic != futuristic > 2. Packing your luggage …. …. data structures
  • 73. modern/generic != futuristic It is good because it has everything that you need The Nokia N95, a modern/generic phone. The I-phone, a futuristic phone. > 2. Packing your luggage …. …. data structures
  • 74. modern/generic != futuristic It is good because it has everything that you need It is even better because it has nothing else than what you need The Nokia N95, a modern/generic phone. The I-phone, a futuristic phone. > 2. Packing your luggage …. …. data structures
  • 75. modern/generic != futuristic It is good because it has everything that you need It is even better because it has nothing else than what you need Work is finished when you have nothing to add and nothing to remove ! The Nokia N95, a modern/generic phone. The I-phone, a futuristic phone. > 2. Packing your luggage …. …. data structures
  • 76. Why keeping a tuning knob on the dash board if it is always on the same position ? (think of the I-Phone) A parameter that always has the same value is not a parameter and should be removed from the API. A template that is instanced only once should not be a template. > 2. Packing your luggage …. …. data structures
  • 77. A parameter that always has the same value is not a parameter and should be removed from the API. A template that is instanced only once should not be a template. Objection: but we loose genericity if we do that ??? Why keeping a tuning knob on the dash board if it is always on the same position ? (think of the I-Phone) > 2. Packing your luggage …. …. data structures
  • 78. A parameter that always has the same value is not a parameter and should be removed from the API. A template that is instanced only once should not be a template. Objection: but we loose genericity if we do that ??? Answer to objection: but we gain a lot, it declutters the code, makes it more legible, reduces compilation times, makes C++ compilation error messages more legible. Why keeping a tuning knob on the dash board if it is always on the same position ? (think of the I-Phone) > 2. Packing your luggage …. …. data structures
  • 79. Rule of thumb: Make it a parameter not before you need it with at least two different values. Make it a template not before you need at least two different instanciations. *regarding compilation time, legibiity of error messages and run-time flex. > 2. Packing your luggage …. …. data structures
  • 80. Rule of thumb: Make it a parameter not before you need it with at least two different values. Make it a template not before you need at least two different instanciations. About templates, consider less annoying* alternatives, such as (1) object oriented programming / virtual functions (2) or simply a parameter and if() statements *regarding compilation time, legibility of error messages and run-time flex. > 2. Packing your luggage …. …. data structures
  • 81. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way….
  • 82. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search
  • 83. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Pointset processing
  • 84. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Transfer attributes between meshes (texture baking)
  • 85. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Raytracing with meshes
  • 86. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Raytracing with meshes
  • 87. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search How do you compute line-triangle intersection ? [Moller Trumbore] Google search “stack overflow intersection between line and triangle in 3D”, See part 3 of the first answer, it is super well explained, I’m 100% objective :-)
  • 88. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Martin Carvaga NVidia
  • 89. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  • 90. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 left(n) = 2*n right(n) = 2*n+1
  • 91. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia Triangles array
  • 92. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia Triangles array
  • 93. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia Triangles array
  • 94. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia Triangles array
  • 95. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia Triangles array
  • 96. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia Triangles array
  • 97. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search NVidia Triangles array
  • 98. > 3. Finding your way…. …. Geometric search bool MeshFacetsAABB::ray_intersection_recursive( const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e ) const Node index bbox[n]
  • 99. > 3. Finding your way…. …. Geometric search bool MeshFacetsAABB::ray_intersection_recursive( const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e ) const Facet sequence [b, …, e-1] Node index bbox[n]
  • 100. > 3. Finding your way…. …. Geometric search bool MeshFacetsAABB::ray_intersection_recursive( const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e ) const Facet sequence [b, …, e-1] Node index bbox[n] Initialize traversal with (1, 0, nf)
  • 101. > 3. Finding your way…. …. Geometric search bool MeshFacetsAABB::ray_intersection_recursive( const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e ) const { if(!ray_box_intersection(R.origin, dirinv, bboxes_[n])) { return false; } if(b + 1 == e) { return ray_triangle_intersection(R.origin, R.direction, b); } index_t m = b + (e - b) / 2; index_t childl = 2 * n; index_t childr = 2 * n + 1; return ( ray_intersection_recursive(R,dirinv,tmax,ignore_f, childl,b,m) || ray_intersection_recursive(R,dirinv,tmax,ignore_f, childr,m,e) ); }
  • 102. > 3. Finding your way…. …. Geometric search bool MeshFacetsAABB::ray_intersection_recursive( const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e ) const { if(!ray_box_intersection(R.origin, dirinv, bboxes_[n])) { return false; } if(b + 1 == e) { return ray_triangle_intersection(R.origin, R.direction, b); } index_t m = b + (e - b) / 2; index_t childl = 2 * n; index_t childr = 2 * n + 1; return ( ray_intersection_recursive(R,dirinv,tmax,ignore_f, childl,b,m) || ray_intersection_recursive(R,dirinv,tmax,ignore_f, childr,m,e) ); } Early skip non-intersected boxes
  • 103. > 3. Finding your way…. …. Geometric search bool MeshFacetsAABB::ray_intersection_recursive( const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e ) const { if(!ray_box_intersection(R.origin, dirinv, bboxes_[n])) { return false; } if(b + 1 == e) { return ray_triangle_intersection(R.origin, R.direction, b); } index_t m = b + (e - b) / 2; index_t childl = 2 * n; index_t childr = 2 * n + 1; return ( ray_intersection_recursive(R,dirinv,tmax,ignore_f, childl,b,m) || ray_intersection_recursive(R,dirinv,tmax,ignore_f, childr,m,e) ); } Leaves, with 1 triangle, Compute ray-tri isect
  • 104. > 3. Finding your way…. …. Geometric search bool MeshFacetsAABB::ray_intersection_recursive( const Ray& R, const vec3& dirinv, index_t n, index_t b, index_t e ) const { if(!ray_box_intersection(R.origin, dirinv, bboxes_[n])) { return false; } if(b + 1 == e) { return ray_triangle_intersection(R.origin, R.direction, b); } index_t m = b + (e - b) / 2; index_t childl = 2 * n; index_t childr = 2 * n + 1; return ( ray_intersection_recursive(R,dirinv,tmax,ignore_f, childl,b,m) || ray_intersection_recursive(R,dirinv,tmax,ignore_f, childr,m,e) ); } Recursive traversal
  • 105. N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search
  • 106. N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search
  • 107. N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search
  • 108. N1 N2 N3 N4 N5 N6 N7 01 02 03 04 05 06 07 08 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Delage Devillers Spatial sort in CGAL std::nth_element()
  • 109. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Shadertoy Geogram
  • 110. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Other topics on geometric search AABB: SAH (Surface Area Heuristic) ZMAABB (Zero Memory) [Terdiman] KdTrees Pointsets, nearest neighbors queries
  • 111. *regarding compilation time, legibility of error messages and run-time flex. > 3. Finding your way…. …. Geometric search Other topics on geometric search AABB: SAH (Surface Area Heuristic) ZMAABB (Zero Memory) [Terdiman] KdTrees Pointsets, nearest neighbors queries Take home message: Continuous arrays As simple as possible Only store what‟s necessary: - permute elements of mesh - plus a couple of additional arrays
  • 112. *regarding compilation time, legibility of error messages and run-time flex. >4. Connecting with friends ….
  • 113. *regarding compilation time, legibility of error messages and run-time flex. >4. Connecting with friends …. … Voronoi and Delaunay
  • 114. >4. Connecting with friends …. … Voronoi and Delaunay
  • 115. >4. Connecting with friends …. … Voronoi and Delaunay
  • 116. >4. Connecting with friends …. … Voronoi and Delaunay Classical algorithm: Bowyer & Watson Much material online: - Hang Si - Jonathan Shewchuk - CGAL manuals
  • 117. >4. Connecting with friends …. … Voronoi and Delaunay Constrained Delaunay triangulation
  • 118. >4. Connecting with friends …. … Voronoi and Delaunay Easty-to-read reference: S.W. Sloan, A fast algorithm for generating constrained Delaunay triangulation, 1992 Implementation in Geogram: CDT2d Constrained Delaunay triangulation
  • 119. Pointset X Simplicial complex S >4. Connecting with friends …. … Voronoi and Delaunay
  • 120. Pointset X Simplicial complex S either triangulated surface or tetrahedralized solid >4. Connecting with friends …. … Voronoi and Delaunay
  • 121. Pointset X Simplicial complex S either triangulated surface or tetrahedralized solid Embedded in IRd >4. Connecting with friends …. … Voronoi and Delaunay
  • 122. Vor(X)|S (Intersection between Vor(X) and S) >4. Connecting with friends …. … Voronoi and Delaunay
  • 123. Voronoi cells as iterative convex clipping xi >4. Connecting with friends …. … Voronoi and Delaunay “Meshless Voronoi diagrams”
  • 124. Voronoi cells as iterative convex clipping Neighbors in increasing distance from xi xi x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 >4. Connecting with friends …. … Voronoi and Delaunay
  • 125. Voronoi cells as iterative convex clipping Bisector of xi, x1 xi x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 >4. Connecting with friends …. … Voronoi and Delaunay
  • 126. Voronoi cells as iterative convex clipping Half-space clipping xi x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 π+(i,1) π-(i,1) This side: The other side: >4. Connecting with friends …. … Voronoi and Delaunay
  • 127. Voronoi cells as iterative convex clipping Half-space clipping xi x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 π+(i,1) π-(i,1) This side: The other side: Remove π-(i,1) >4. Connecting with friends …. … Voronoi and Delaunay
  • 128. Voronoi cells as iterative convex clipping Half-space clipping xi x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 Then remove π-(i,2) >4. Connecting with friends …. … Voronoi and Delaunay
  • 129. Voronoi cells as iterative convex clipping Half-space clipping xi x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 … then remove π-(i,3) >4. Connecting with friends …. … Voronoi and Delaunay
  • 130. Voronoi cells as iterative convex clipping Half-space clipping xi x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 … then remove π-(i,4) >4. Connecting with friends …. … Voronoi and Delaunay
  • 131. Voronoi cells as iterative convex clipping Half-space clipping xi x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 … then remove π-(i,5) >4. Connecting with friends …. … Voronoi and Delaunay
  • 132. Voronoi cells as iterative convex clipping When should I stop ? x1 x2 x3 x4 x5 x7 x8 x9 x10 x11 x6 >4. Connecting with friends …. … Voronoi and Delaunay
  • 133. Voronoi cells as iterative convex clipping When should I stop ? Rk x1 x2 x3 x4 x5 x7 x8 x9 x10 x11 x6 >4. Connecting with friends …. … Voronoi and Delaunay
  • 134. Voronoi cells as iterative convex clipping When should I stop ? x1 x2 x3 x4 x5 x7 x8 x9 x10 x11 x6 >4. Connecting with friends …. … Voronoi and Delaunay
  • 135. Voronoi cells as iterative convex clipping When should I stop ? d(xi, xk) > 2 Rk x1 x2 x3 x4 x5 x7 x8 x9 x10 x11 x6 >4. Connecting with friends …. … Voronoi and Delaunay
  • 136. Voronoi cells as iterative convex clipping Observation: d(xi, xk+1) > 2Rk → ∩ π+(i,k) = Vor(xi) [L and Bonneel – Voronoi Parallel Linear Enumeration] [Dey et.al – Localized co-cone] >4. Connecting with friends …. … Voronoi and Delaunay
  • 137. Voronoi cells as iterative convex clipping When should I stop ? d(xi, xk) > 2 Rk “Radius of security” is reached [L and Bonneel – Voronoi Parallel Linear Enumeration] [Dey et.al – Localized co-cone] >4. Connecting with friends …. … Voronoi and Delaunay
  • 138. Voronoi cells as iterative convex clipping When should I stop ? d(xi, xk) > 2 Rk “Radius of security” is reached Note: Rk decreases and d(xi, xk) increases [L and Bonneel – Voronoi Parallel Linear Enumeration] [Dey et.al – Localized co-cone] >4. Connecting with friends …. … Voronoi and Delaunay
  • 139. Voronoi cells as iterative convex clipping When should I stop ? d(xi, xk) > 2 Rk “Radius of security” is reached Note: Rk decreases and d(xi, xk) increases Advantages: [L and Bonneel – Voronoi Parallel Linear Enumeration] [Dey et.al – Localized co-cone] >4. Connecting with friends …. … Voronoi and Delaunay
  • 140. Voronoi cells as iterative convex clipping When should I stop ? d(xi, xk) > 2 Rk “Radius of security” is reached Note: Rk decreases and d(xi, xk) increases Advantages: (1) Compute Vor(X) ∩ S directly (start with f and clip) [L and Bonneel – Voronoi Parallel Linear Enumeration] [Dey et.al – Localized co-cone] >4. Connecting with friends …. … Voronoi and Delaunay
  • 141. Voronoi cells as iterative convex clipping When should I stop ? d(xi, xk) > 2 Rk “Radius of security” is reached Note: Rk decreases and d(xi, xk) increases Advantages: (1) Compute Vor(X) ∩ S directly (start with f and clip) (2) Replace Delaunay with ANN ! (no d! factor) [L and Bonneel – Voronoi Parallel Linear Enumeration] [Dey et.al – Localized co-cone] >4. Connecting with friends …. … Voronoi and Delaunay
  • 142. Voronoi cells as iterative convex clipping When should I stop ? d(xi, xk) > 2 Rk “Radius of security” is reached Note: Rk decreases and d(xi, xk) increases Advantages: (1) Compute Vor(X) ∩ S directly (start with f and clip) (2) Replace Delaunay with ANN ! (no d! factor) (3) Parallelization is trivial (partition S and // in parts) [L and Bonneel – Voronoi Parallel Linear Enumeration] [Dey et.al – Localized co-cone] >4. Connecting with friends …. … Voronoi and Delaunay
  • 143. > 5. Into darkness ….
  • 144. > 5. Into darkness …. … geometric predicates
  • 145. xi xj Elementary operation: cut a polygon (or polyhedron) with a bisector > 5. Into darkness … … geometric predicates
  • 146. xi xj Elementary operation: cut a polygon (or polyhedron) with a bisector Classify the vertices of the polygon > 5. Into darkness … … geometric predicates
  • 147. xi xj Elementary operation: cut a polygon (or polyhedron) with a bisector Classify the vertices of the polygon Sign( d(p,xj) – d(p,xi)) > 0 > 5. Into darkness … … geometric predicates
  • 148. xi xj Elementary operation: cut a polygon (or polyhedron) with a bisector Classify the vertices of the polygon Sign( d(p,xj) – d(p,xi)) > 0 Sign( d(p,xj) – d(p,xi)) < 0 > 5. Into darkness … … geometric predicates
  • 149. xi xj Elementary operation: cut a polygon (or polyhedron) with a bisector Classify the vertices of the polygon Compute the intersections Sign( d(p,xj) – d(p,xi)) > 0 Sign( d(p,xj) – d(p,xi)) < 0 > 5. Into darkness … … geometric predicates
  • 150. xi xj Sign( d(p,xj) – d(p,xi)) > 0 Sign( d(p,xj) – d(p,xi)) < 0 Elementary operation: cut a polygon (or polyhedron) with a bisector Classify the vertices of the polygon Compute the intersections - discard > 5. Into darkness … … geometric predicates
  • 151. xi xj xk Now clipping with the bisector of (xi, xk) > 5. Into darkness … … geometric predicates
  • 152. xi xj xk Now clipping with the bisector of (xi, xk) We need to classify all the points, including these ones ! > 5. Into darkness … … geometric predicates
  • 153. xi xj xk Now clipping with the bisector of (xi, xk) We need to classify all the points, including these ones ! (they are intersections between a segment and a bisector) > 5. Into darkness … … geometric predicates
  • 154. xi xj xk Now clipping with the bisector of (xi, xk) We need to classify all the points, including these ones ! (they are intersections between a segment and a bisector) This generates a new intersection (between a facet and two bisector) > 5. Into darkness … … geometric predicates
  • 155. Three configurations 1) Side(xi,xj,q) where q is a vertex of S > 5. Into darkness … … geometric predicates
  • 157. Three configurations 1) Side1(xi,xj,q) 2) Side(xi,xj,q) where q = π(i,k) ∩ [p1,p2] > 5. Into darkness … … geometric predicates
  • 158. Three configurations 1) Side1(xi,xj,q) 2) Side2(xi,xj,xk,p1,p2) > 5. Into darkness … … geometric predicates
  • 159. Three configurations 1) Side1(xi,xj,q) 2) Side2(xi,xj,xk,p1,p2) 3) Side(xi,xj,q) where q = π(i,k) ∩ π(i,l) ∩ [p1,p2,p3] > 5. Into darkness … … geometric predicates
  • 160. Three configurations 1) Side1(xi,xj,q) 2) Side2(xi,xj,xk,p1,p2) 3) Side3(xi,xj,xk, xl,p1,p2,p3) > 5. Into darkness … … geometric predicates
  • 161. Three configurations 1) Side1(xi,xj,q) 2) Side2(xi,xj,xk,p1,p2) 3) Side3(xi,xj,xk, xl,p1,p2,p3) Implementations of exact predicates: - J. Shewchuk‟s code - CGAL (Pion, Meyer) > 5. Into darkness … … geometric predicates
  • 162. Three configurations 1) Side1(xi,xj,q) 2) Side2(xi,xj,xk,p1,p2) 3) Side3(xi,xj,xk, xl,p1,p2,p3) Implementations of exact predicates: - J. Shewchuk‟s code - CGAL (Pion, Meyer) They do not have Side1(), Side2(), Side3() (“exotic predicates”) > 5. Into darkness … … geometric predicates
  • 163. Three configurations 1) Side1(xi,xj,q) 2) Side2(xi,xj,xk,p1,p2) 3) Side3(xi,xj,xk, xl,p1,p2,p3) How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() > 5. Into darkness … … geometric predicates
  • 164. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Wish list: • Easy to use (no “Guru” needed for each new predicate) • Reasonably efficient • Easy to compile/integrate (multi_precision.h, multi_precision.cpp and that‟s all) > 5. Into darkness … … geometric predicates
  • 165. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #1: (dense) multi-precision (GMP) a0 a1 a2 a3 x 20 x 21*32 x 22*32 x 23*32 … Each number is an array of (32 bits) integers: Implement +,-,* (reasonably easy) Sign: look at the leading non-zero component > 5. Into darkness … … geometric predicates
  • 166. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #1: (dense) multi-precision (GMP) a “limitation”: c = a10 * 210*32 + b0 > 5. Into darkness … … geometric predicates
  • 167. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #1: (dense) multi-precision (GMP) a “limitation”: b0 0 0 a10 x 20 x 210*32 c = a10 * 210*32 + b0 … > 5. Into darkness … … geometric predicates
  • 168. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #2: (sparse) multi-precision b0 | 0 a10 | 10 c = a10 * 210*32 + b0 Store the exponents of the components > 5. Into darkness … … geometric predicates
  • 169. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #2: (sparse) multi-precision b0 | 0 a10 | 10 c = a10 * 210*32 + b0 Exp. Exp. > 5. Into darkness … … geometric predicates
  • 170. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #2: (sparse) multi-precision b0 | 0 a10 | 10 c = a10 * 210*32 + b0 Exp. Exp. mantissa mantissa > 5. Into darkness … … geometric predicates
  • 171. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #2: (sparse) multi-precision b0 | 0 a10 | 10 c = a10 * 210*32 + b0 Exp. Exp. mantissa mantissa These are floating point numbers !!! > 5. Into darkness … … geometric predicates
  • 172. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) x3 x2 x1 … Each number is represented by the sum of an array of „components‟ These are floating point numbers !!! > 5. Into darkness … … geometric predicates
  • 173. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) x3 x2 x1 … Each number is represented by the sum of an array of „components‟ They are sorted in decreasing exponents These are floating point numbers !!! > 5. Into darkness … … geometric predicates
  • 174. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) x3 x2 x1 … Each number is represented by the sum of an array of „components‟ They are sorted in decreasing exponents They are „non-overlapping‟ These are floating point numbers !!! > 5. Into darkness … … geometric predicates
  • 175. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) x3 x2 x1 … Each number is represented by the sum of an array of „components‟ They are sorted in decreasing exponents They are „non-overlapping‟ The sign is determined by the first component (highest exponent) These are floating point numbers !!! > 5. Into darkness … … geometric predicates
  • 176. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) x2 x1 Two_sum(double a, double b) > 5. Into darkness … … geometric predicates
  • 177. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) x2 x1 Two_sum(double a, double b) + Length: l+m Length l Length m > 5. Into darkness … … geometric predicates
  • 178. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) x2 x1 Two_sum(double a, double b) + * Length: l+m Length: 2*l A double Length l > 5. Into darkness … … geometric predicates
  • 179. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) * … Length: 2*l*m Expansion * Expansion product implemented by a recursive function (“distillation”) Length l Length m > 5. Into darkness … … geometric predicates
  • 180. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) * … Expansion * Expansion product implemented by a recursive function (“distillation”) Performance ? 10 to 40 times slower than standard doubles Length: 2*l*m Length l Length m > 5. Into darkness … … geometric predicates
  • 181. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) * … Expansion * Expansion product implemented by a recursive function (“distillation”) Performance ? 10 to 40 times slower than standard doubles Use arithmetic filters Adaptive precision [Shewchuk] ? Too complicated to get right Length: 2*l*m Length l Length m > 5. Into darkness … … geometric predicates
  • 182. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() Idea #3: expansions (Shewchuk) * … Expansion * Expansion product implemented by a recursive function (“distillation”) Performance ? 10 to 40 times slower than standard doubles Use arithmetic filters Adaptive precision [Shewchuk] ? Too complicated to get right Quasi-static filters [Meyer and Pion] – FPG generator (easy to use) Length: 2*l*m Length l Length m > 5. Into darkness … … geometric predicates
  • 183. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() PCK (Predicate Construction Kit) multi_precision.h / multi_precision.cpp A “low-level” expansion class (allocates expansions on stack) A “high-level” C++ number type (+,-,*,Sign overloads) a script that generates the filter with FPG [Meyer and Pion] and the exact precision version with expansions > 5. Into darkness … … geometric predicates
  • 184. How to implement Side1(), Side2(), Side3() ? We need an exact “number type” with +,-,*,Sign() PCK (Predicate Construction Kit) multi_precision.h / multi_precision.cpp A “low-level” expansion class (allocates expansions on stack) A “high-level” C++ number type (+,-,*,Sign overloads) a script that generates the filter with FPG [Meyer and Pion] and the exact precision version with expansions So we are done ? > 5. Into darkness … … geometric predicates
  • 185. How to implement Side1(), Side2(), Side3() ? xi xj Not yet !! > 5. Into darkness … … geometric predicates
  • 186. How to implement Side1(), Side2(), Side3() ? xi xj Not yet !! > 5. Into darkness … … geometric predicates
  • 187. > 5. Into darkness … … geometric predicates
  • 188. > 5. Into darkness … … geometric predicates
  • 189. > 5. Into darkness … … geometric predicates
  • 190. > 5. Into darkness … … geometric predicates
  • 191. > 5. Into darkness … … geometric predicates
  • 192. > 5. Into darkness … … geometric predicates
  • 193. > 5. Into darkness … … geometric predicates
  • 194. > 5. Into darkness … … geometric predicates
  • 195. > 5. Into darkness … … geometric predicates
  • 196. > 5. Into darkness … … geometric predicates
  • 197. > 5. Into darkness … … geometric predicates
  • 198. > 5. Into darkness … … geometric predicates
  • 199. > 5. Into darkness … … geometric predicates
  • 200. > 5. Into darkness … … geometric predicates
  • 201. > 5. Into darkness … … geometric predicates
  • 202. > 5. Into darkness … … geometric predicates
  • 203. xi xj π(i,j) = {p | d2(p,xi) = d2(p,xj)} [Voronoi] [Edelsbrunner et.al] [Devillers et.al] > 5. Into darkness … … geometric predicates
  • 204. xi xj πw(i,j) = {p | d2(p,xi) - wi = d2(p,xj) - wj} [Voronoi] [Edelsbrunner et.al] [Devillers et.al] > 5. Into darkness … … geometric predicates
  • 205. xi xj πw(i,j) = {p | d2(p,xi) - wi = d2(p,xj) - wj} [Voronoi] [Edelsbrunner et.al] [Devillers et.al] The Voronoi diagram is replaced with a power diagram > 5. Into darkness … … geometric predicates
  • 206. xi xj πw(i,j) = {p | d2(p,xi) - wi = d2(p,xj) - wj} [Voronoi] [Edelsbrunner et.al] [Devillers et.al] The Voronoi diagram is replaced with a power diagram Symbolic perturbation – Simulation of Simplicity: Define the weight as a function of ε: wi = εi > 5. Into darkness … … geometric predicates
  • 207. xi xj πw(i,j) = {p | d2(p,xi) - wi = d2(p,xj) - wj} [Voronoi] [Edelsbrunner et.al] [Devillers et.al] The Voronoi diagram is replaced with a power diagram Symbolic perturbation – Simulation of Simplicity: Define the weight as a function of ε: wi = εi The combinatorics is determined by the limit ε → 0 > 5. Into darkness … … geometric predicates
  • 208. How to write side1(), side2(), side3(), side4() ? d2(q,pj)-wj – d2(q,pi) + wi where: q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd] > 5. Into darkness … … geometric predicates
  • 209. How to write side1(), side2(), side3(), side4() ? d2(q,pj)-wj – d2(q,pi) + wi where: q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd] Solve for q in: q Є πw(i,k1) … q Є πw(i,kd) q Є [p1,p2,p3…pd] { > 5. Into darkness … … geometric predicates
  • 210. How to write side1(), side2(), side3(), side4() ? d2(q,pj)-wj – d2(q,pi) + wi where: q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd] q = (1/d) Q Keep numerator and denom. separate (remember, we are not allowed to divide) Solve for q in: q Є πw(i,k1) … q Є πw(i,kd) q Є [p1,p2,p3…pd] { > 5. Into darkness … … geometric predicates
  • 211. How to write side1(), side2(), side3(), side4() ? d2(q,pj)-wj – d2(q,pi) + wi where: q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd] q = (1/d) Q Keep numerator and denom. separate (remember, we are not allowed to divide) Inject q=(1/d) Q in side1() and mutliply by d to remove the division Solve for q in: q Є πw(i,k1) … q Є πw(i,kd) q Є [p1,p2,p3…pd] { > 5. Into darkness … … geometric predicates
  • 212. How to write side1(), side2(), side3(), side4() ? d2(q,pj)-wj – d2(q,pi) + wi where: q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd] q = (1/d) Q Keep numerator and denom. separate (remember, we are not allowed to divide) Inject q=(1/d) Q in side1() and mutliply by d to remove the division Order the terms in wi = εi Solve for q in: q Є πw(i,k1) … q Є πw(i,kd) q Є [p1,p2,p3…pd] { > 5. Into darkness … … geometric predicates
  • 213. How to write side1(), side2(), side3(), side4() ? d2(q,pj)-wj – d2(q,pi) + wi where: q = πw(i,k1) ∩ … πw(i,kd) ∩ [p1,p2,p3…pd] q = (1/d) Q Keep numerator and denom. separate (remember, we are not allowed to divide) Inject q=(1/d) Q in side1() and mutliply by d to remove the division Order the terms in wi = εi the constant one is non-perturbed predicate if zero, the first non-zero one determines the sign Solve for q in: q Є πw(i,k1) … q Є πw(i,kd) q Є [p1,p2,p3…pd] { > 5. Into darkness … … geometric predicates
  • 214. #include "kernel.pckh" Sign predicate(side1)( point(p0), point(p1), point(q0) DIM ) { scalar r = sq_dist(p0,p1) ; r -= 2*dot_at(p1,q0,p0) ; generic_predicate_result(sign(r)) ; begin_sos2(p0,p1) sos(p0,POSITIVE) sos(p1,NEGATIVE) end_sos } Source PCK > 5. Into darkness … … geometric predicates
  • 215. #include "kernel.pckh" Sign predicate(side1)( point(p0), point(p1), point(q0) DIM ) { scalar r = sq_dist(p0,p1) ; r -= 2*dot_at(p1,q0,p0) ; generic_predicate_result(sign(r)) ; begin_sos2(p0,p1) sos(p0,POSITIVE) sos(p1,NEGATIVE) end_sos } Source PCK (p1-p0).(q0-p0) > 5. Into darkness … … geometric predicates
  • 216. #include "kernel.pckh“ Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) { scalar l1 = 1*sq_dist(p1,p0) ; scalar l2 = 1*sq_dist(p2,p0) ; scalar a10 = 2*dot_at(p1,q0,p0); scalar a11 = 2*dot_at(p1,q1,p0); scalar a20 = 2*dot_at(p2,q0,p0); scalar a21 = 2*dot_at(p2,q1,p0); scalar Delta = a11 - a10 ; scalar DeltaLambda0 = a11 - l1 ; scalar DeltaLambda1 = l1 - a10 ; scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ; Sign Delta_sign = sign(Delta) ; Sign r_sign = sign(r) ; generic_predicate_result(Delta_sign*r_sign) ; begin_sos3(p0,p1,p2) sos(p0, Sign(Delta_sign*sign(Delta-a21+a20))) sos(p1, Sign(Delta_sign*sign(a21-a20))) sos(p2, NEGATIVE) end_sos } Source PCK > 5. Into darkness … … geometric predicates
  • 217. #include "kernel.pckh“ Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) { scalar l1 = 1*sq_dist(p1,p0) ; scalar l2 = 1*sq_dist(p2,p0) ; scalar a10 = 2*dot_at(p1,q0,p0); scalar a11 = 2*dot_at(p1,q1,p0); scalar a20 = 2*dot_at(p2,q0,p0); scalar a21 = 2*dot_at(p2,q1,p0); scalar Delta = a11 - a10 ; scalar DeltaLambda0 = a11 - l1 ; scalar DeltaLambda1 = l1 - a10 ; scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ; Sign Delta_sign = sign(Delta) ; Sign r_sign = sign(r) ; generic_predicate_result(Delta_sign*r_sign) ; begin_sos3(p0,p1,p2) sos(p0, Sign(Delta_sign*sign(Delta-a21+a20))) sos(p1, Sign(Delta_sign*sign(a21-a20))) sos(p2, NEGATIVE) end_sos } Source PCK Denominator > 5. Into darkness … … geometric predicates
  • 218. #include "kernel.pckh“ Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) { scalar l1 = 1*sq_dist(p1,p0) ; scalar l2 = 1*sq_dist(p2,p0) ; scalar a10 = 2*dot_at(p1,q0,p0); scalar a11 = 2*dot_at(p1,q1,p0); scalar a20 = 2*dot_at(p2,q0,p0); scalar a21 = 2*dot_at(p2,q1,p0); scalar Delta = a11 - a10 ; scalar DeltaLambda0 = a11 - l1 ; scalar DeltaLambda1 = l1 - a10 ; scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ; Sign Delta_sign = sign(Delta) ; Sign r_sign = sign(r) ; generic_predicate_result(Delta_sign*r_sign) ; begin_sos3(p0,p1,p2) sos(p0, Sign(Delta_sign*sign(Delta-a21+a20))) sos(p1, Sign(Delta_sign*sign(a21-a20))) sos(p2, NEGATIVE) end_sos } Source PCK Barycentric coords. of q > 5. Into darkness … … geometric predicates
  • 219. #include "kernel.pckh“ Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) { scalar l1 = 1*sq_dist(p1,p0) ; scalar l2 = 1*sq_dist(p2,p0) ; scalar a10 = 2*dot_at(p1,q0,p0); scalar a11 = 2*dot_at(p1,q1,p0); scalar a20 = 2*dot_at(p2,q0,p0); scalar a21 = 2*dot_at(p2,q1,p0); scalar Delta = a11 - a10 ; scalar DeltaLambda0 = a11 - l1 ; scalar DeltaLambda1 = l1 - a10 ; scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ; Sign Delta_sign = sign(Delta) ; Sign r_sign = sign(r) ; generic_predicate_result(Delta_sign*r_sign) ; begin_sos3(p0,p1,p2) sos(p0, Sign(Delta_sign*sign(Delta-a21+a20))) sos(p1, Sign(Delta_sign*sign(a21-a20))) sos(p2, NEGATIVE) end_sos } Source PCK Barycentric coords. of q Solely depend on dot products between input points > 5. Into darkness … … geometric predicates
  • 220. #include "kernel.pckh“ Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) { scalar l1 = 1*sq_dist(p1,p0) ; scalar l2 = 1*sq_dist(p2,p0) ; scalar a10 = 2*dot_at(p1,q0,p0); scalar a11 = 2*dot_at(p1,q1,p0); scalar a20 = 2*dot_at(p2,q0,p0); scalar a21 = 2*dot_at(p2,q1,p0); scalar Delta = a11 - a10 ; scalar DeltaLambda0 = a11 - l1 ; scalar DeltaLambda1 = l1 - a10 ; scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ; Sign Delta_sign = sign(Delta) ; Sign r_sign = sign(r) ; generic_predicate_result(Delta_sign*r_sign) ; begin_sos3(p0,p1,p2) sos(p0, Sign(Delta_sign*sign(Delta-a21+a20))) sos(p1, Sign(Delta_sign*sign(a21-a20))) sos(p2, NEGATIVE) end_sos } Source PCK Result when in generic position > 5. Into darkness … … geometric predicates
  • 221. #include "kernel.pckh“ Sign predicate(side2)( point(p0), point(p1), point(p2), point(q0), point(q1) DIM) { scalar l1 = 1*sq_dist(p1,p0) ; scalar l2 = 1*sq_dist(p2,p0) ; scalar a10 = 2*dot_at(p1,q0,p0); scalar a11 = 2*dot_at(p1,q1,p0); scalar a20 = 2*dot_at(p2,q0,p0); scalar a21 = 2*dot_at(p2,q1,p0); scalar Delta = a11 - a10 ; scalar DeltaLambda0 = a11 - l1 ; scalar DeltaLambda1 = l1 - a10 ; scalar r = Delta*l2 - a20*DeltaLambda0 - a21*DeltaLambda1 ; Sign Delta_sign = sign(Delta) ; Sign r_sign = sign(r) ; generic_predicate_result(Delta_sign*r_sign) ; begin_sos3(p0,p1,p2) sos(p0, Sign(Delta_sign*sign(Delta-a21+a20))) sos(p1, Sign(Delta_sign*sign(a21-a20))) sos(p2, NEGATIVE) end_sos } Source PCK Symbolic perturbation > 5. Into darkness … … geometric predicates
  • 222. Sign side2_exact_SOS( const double* p0, const double* p1, const double* p2, const double* q0, const double* q1, coord_index_t dim ) { const expansion& l1 = expansion_sq_dist(p1, p0, dim); const expansion& l2 = expansion_sq_dist(p2, p0, dim); const expansion& a10 = expansion_dot_at(p1, q0, p0, dim).scale_fast(2.0); const expansion& a11 = expansion_dot_at(p1, q1, p0, dim).scale_fast(2.0); const expansion& a20 = expansion_dot_at(p2, q0, p0, dim).scale_fast(2.0); const expansion& a21 = expansion_dot_at(p2, q1, p0, dim).scale_fast(2.0); const expansion& Delta = expansion_diff(a11, a10); Sign Delta_sign = Delta.sign(); vor_assert(Delta_sign != ZERO); const expansion& DeltaLambda0 = expansion_diff(a11, l1); const expansion& DeltaLambda1 = expansion_diff(l1, a10); const expansion& r0 = expansion_product(Delta, l2); const expansion& r1 = expansion_product(a20, DeltaLambda0).negate(); const expansion& r2 = expansion_product(a21, DeltaLambda1).negate(); const expansion& r = expansion_sum3(r0, r1, r2); Sign r_sign = r.sign(); ……….. Exact version with expansions > 5. Into darkness … … geometric predicates
  • 223. if(r_sign == ZERO) { const double* p_sort[3]; p_sort[0] = p0; p_sort[1] = p1; p_sort[2] = p2; std::sort(p_sort, p_sort + 3); for(index_t i = 0; i < 3; ++i) { if(p_sort[i] == p0) { const expansion& z1 = expansion_diff(Delta, a21); const expansion& z = expansion_sum(z1, a20); Sign z_sign = z.sign(); len_side2_SOS = vor_max(len_side2_SOS, z.length()); if(z_sign != ZERO) { return Sign(Delta_sign * z_sign); } } if(p_sort[i] == p1) { const expansion& z = expansion_diff(a21, a20); Sign z_sign = z.sign(); len_side2_SOS = vor_max(len_side2_SOS, z.length()); if(z_sign != ZERO) { return Sign(Delta_sign * z_sign); } } if(p_sort[i] == p2) { return NEGATIVE; } } vor_assert_not_reached; } return Sign(Delta_sign * r_sign); } Exact version with expansions > 5. Into darkness … … geometric predicates
  • 224. #include "kernel.pckh" Sign predicate(side3)( point(p0), point(p1), point(p2), point(p3), point(q0), point(q1), point(q2) DIM ) { scalar l1 = 1*sq_dist(p1,p0); scalar l2 = 1*sq_dist(p2,p0); scalar l3 = 1*sq_dist(p3,p0); scalar a10 = 2*dot_at(p1,q0,p0); scalar a11 = 2*dot_at(p1,q1,p0); scalar a12 = 2*dot_at(p1,q2,p0); scalar a20 = 2*dot_at(p2,q0,p0); scalar a21 = 2*dot_at(p2,q1,p0); scalar a22 = 2*dot_at(p2,q2,p0); scalar a30 = 2*dot_at(p3,q0,p0); scalar a31 = 2*dot_at(p3,q1,p0); scalar a32 = 2*dot_at(p3,q2,p0); scalar b00 = a11*a22-a12*a21; scalar b01 = a21-a22; scalar b02 = a12-a11; scalar b10 = a12*a20-a10*a22; scalar b11 = a22-a20; scalar b12 = a10-a12; scalar b20 = a10*a21-a11*a20; scalar b21 = a20-a21; scalar b22 = a11-a10; scalar Delta = b00+b10+b20; scalar DeltaLambda0 = b01*l1+b02*l2+b00 ; scalar DeltaLambda1 = b11*l1+b12*l2+b10 ; scalar DeltaLambda2 = b21*l1+b22*l2+b20 ; scalar r = Delta*l3 - ( a30 * DeltaLambda0 + a31 * DeltaLambda1 + a32 * DeltaLambda2 ) ; Sign Delta_sign = sign(Delta) ; Sign r_sign = sign(r) ; generic_predicate_result( Delta_sign*r_sign ) ; begin_sos4(p0,p1,p2,p3) sos(p0, Sign(Delta_sign*sign( Delta-((b01+b02)*a30+ (b11+b12)*a31+ (b21+b22)*a32) ))) sos(p1, Sign(Delta_sign* sign((a30*b01)+ (a31*b11)+ (a32*b21)))) sos(p2, Sign(Delta_sign*sign( (a30*b02)+ (a31*b12)+ (a32*b22)))) sos(p3, NEGATIVE) end_sos } Source PCK > 5. Into darkness … … geometric predicates
  • 225. ………. scalar b00= det3x3(a11,a12,a13,a21,a22,a23,a31,a32,a33); scalar b01=-det_111_2x3(a21,a22,a23,a31,a32,a33); scalar b02= det_111_2x3(a11,a12,a13,a31,a32,a33); scalar b03=-det_111_2x3(a11,a12,a13,a21,a22,a23); scalar b10=-det3x3(a10,a12,a13,a20,a22,a23,a30,a32,a33); scalar b11= det_111_2x3(a20,a22,a23,a30,a32,a33); scalar b12=-det_111_2x3(a10,a12,a13,a30,a32,a33); scalar b13= det_111_2x3(a10,a12,a13,a20,a22,a23); scalar b20= det3x3(a10,a11,a13,a20,a21,a23,a30,a31,a33); scalar b21=-det_111_2x3(a20,a21,a23,a30,a31,a33); scalar b22= det_111_2x3(a10,a11,a13,a30,a31,a33); scalar b23=-det_111_2x3(a10,a11,a13,a20,a21,a23); scalar b30=-det3x3(a10,a11,a12,a20,a21,a22,a30,a31,a32); scalar b31= det_111_2x3(a20,a21,a22,a30,a31,a32); scalar b32=-det_111_2x3(a10,a11,a12,a30,a31,a32); scalar b33= det_111_2x3(a10,a11,a12,a20,a21,a22); scalar Delta=b00+b10+b20+b30; scalar DeltaLambda0 = b01*l1+b02*l2+b03*l3+b00; scalar DeltaLambda1 = b11*l1+b12*l2+b13*l3+b10; scalar DeltaLambda2 = b21*l1+b22*l2+b23*l3+b20; scalar DeltaLambda3 = b31*l1+b32*l2+b33*l3+b30; ………. scalar r = Delta*l4 - ( a40*DeltaLambda0+ a41*DeltaLambda1+ a42*DeltaLambda2+ a43*DeltaLambda3 ); Sign Delta_sign = sign(Delta); generic_predicate_result(Delta_sign*sign(r)) ; begin_sos5(p0,p1,p2,p3,p4) sos(p0, Sign( Delta_sign*sign(Delta - ( (b01+b02+b03)*a30 + (b11+b12+b13)*a31 + (b21+b22+b23)*a32 + (b31+b32+b33)*a33 ))) ) sos(p1, Sign( Delta_sign*sign(a30*b01+a31*b11+a32*b21+a33*b31))) sos(p2, Sign( Delta_sign*sign(a30*b02+a31*b12+a32*b22+a33*b32))) sos(p3, Sign( Delta_sign*sign(a30*b03+a31*b13+a32*b23+a33*b33))) sos(p4, NEGATIVE) end_sos } q is the intersection of three bisectors and a tetrahedron embedded in nD Note: There is a special case in 3d (no need for the tetrahedron) = insphere3d() The code of the general nD version (excerpt) : Source PCK > 5. Into darkness … … geometric predicates
  • 226. > 5. Into darkness … … geometric predicates A nice model for Thingy30K … Putting everything together …
  • 227. > 5. Into darkness … … geometric predicates Take a closer look … Aaaahhhhhh !!!!
  • 228. > 5. Into darkness … … geometric predicates > Intersect; Remove internal boundaries; Tetgen
  • 229. > 5. Into darkness … … geometric predicates Aaaahhhhhh !!!!
  • 230. > 5. Into darkness … … geometric predicates > Intersect; Remove internal boundaries; Tetgen
  • 231. > 5. Into darkness … … geometric predicates Aaaahhhhhh !!!!
  • 232. > 5. Into darkness … … geometric predicates > Intersect; Remove internal boundaries; Tetgen
  • 233. > 5. Into darkness … … geometric predicates
  • 234. > 5. Into darkness … … geometric predicates
  • 235. > 5. Into darkness … … geometric predicates More on this, to read on the beach: - Chewchuk - Sylvain Pion, FPG - CGAL - Tetwild, FastTetwild - Attene, Cherchi, Livesu - Thingy30K
  • 236. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip ….
  • 237. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences
  • 238. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Physics Math Computer Science
  • 239. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Physics Math Computer Science Got the feeling that there are intersting things to discover exactly here !
  • 240. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Physics Math Computer Science A journey in Mathland
  • 241. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Math A journey in Mathland Optimal transport A numerical algorithm for Semi-discrete OT in 3D, ESAIM Math Modeling and Analysis, L, 2015 Centroidal Power Diagrams, ACM TOG/SIGGRAPH Asia, Xin, L, Chen, Chu, Yue, Wang 2016 Notions of OT theory and how to implement them on a Computer, Computer & Graphics, L & Schwindt, 2018 BIRS Banff, BIRS Oaxaca, Institut Fourier, Bonn
  • 242. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Math A journey in Mathland Optimal transport Recorded lecture & slides on the web Links from my webpage brunolevy.github.io SGP2018 Graduate Course
  • 243. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Math The trip continues in Physland… Optimal transport Physics Computational fluid dynamics C.S.
  • 244. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Free-surface fluid simulation, J. of computational Physics, B, 2022
  • 245. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Math The trip continues in Physland… Optimal transport Physics Computational fluid dynamics C.S. Cosmology
  • 246. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Monthly Notices of the Royal Astron Soc., L, Mohayaee, S.von Hausegger 2021 Physical Review Letters, von Hausegger, L, Mohayaee, 2022 Physical Review Letters, Nikhaktar, Sheth, L, Mohayaee, 2022 Featured in Physics Magazine A mathematical time machine to explore the origins of the Universe
  • 247. *regarding compilation time, legibility of error messages and run-time flex. >6. Planning your next trip …. … GP in other sciences Math Love Physland, I settled down there ! Optimal transport Physics Computational fluid dynamics C.S. Cosmology
  • 248. >Epilogue …. How GP (and Geogram) can help other sciences
  • 250. The “product”: geogram (on github) Is it good ?
  • 251. The “product”: geogram (on github) Is it good ? Yes and no 23 years of code, 40 papers, 2 ERCs + functionalities, efficiency, small footprint + few dependencies + high portability (Linux/Mac/Win/Android/web) + heavily tested - there is technical debt - arrays/pointers-based, API may feel a bit weird and low-level
  • 253. What GP can do for other sciences - Dare computing what others would not dream of. - Mix of math. and algorithmics. - C++ ninjas, high tech (GPUs…). - Irregular geometric data structures.
  • 254. Voronoi/Laguerre diagrams of astronomical size (hundred millions cells)
  • 255. > Deactivate ("Gray beard speaker"); switch to Q&A mode.