• Aucun résultat trouvé

in CGAL

N/A
N/A
Protected

Academic year: 2022

Partager "in CGAL"

Copied!
50
0
0

Texte intégral

(1)

2D Delaunay Refinement

in CGAL

(2)

From Triangulations to Quality Meshes

(3)

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <CGAL/Delaunay_triangulation_2.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

typedef Kernel::Point_2 Point;

typedef CGAL::Delaunay_triangulation_2<Kernel> Delaunay;

typedef Delaunay::Vertex_handle Vertex_handle;

int main()‏

{

Delaunay dt;

dt.insert( std::istream_iterator<Point>(std::cin), std::istream_iterator<Point>() );

Vertex_handle v = dt.nearest_vertex(Point(0.0,0.0));

std::cout << “Nearest vertex to origin: “ << v->point() << std::endl;

return 0;

}

Code Example

(4)

Adding Constraints

CGAL manual

(5)

Constrained Delaunay Triangulation

(6)

Pseudo-dual: Bounded Voronoi Diagram

constrained Bounded Voronoi diagram

“blind” triangles

(7)

Constrained Delaunay

Kilimandjaro elevation contour lines (38K segments)‏

(8)

Code Example

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <CGAL/Constrained_Delaunay_triangulation_2.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

typedef Kernel::Point_2 Point;

typedef CGAL::Constrained_Delaunay_triangulation_2<Kernel> CDT;

typedef CDT::Vertex_handle Vertex_handle;

int main()‏

{

CDT cdt;

// from points

cdt.insert_constraint(Point(0.0,0.0), Point(1.0,0.0));

// from vertices

Vertex_handle v1 = cdt.insert(Point(2.0,3.0));

Vertex_handle v2 = cdt.insert(Point(4.0,5.0));

cdt.insert_constraint(v1,v2);

return 0;

}

(9)

Conforming Delaunay

(10)

Code Example

#include <CGAL/Triangulation_conformer_2.h>

// constrained Delaunay triangulation CDT cdt;

… // insert points & constraints

CGAL::make_conforming_Delaunay_2(cdt);

(11)

Delaunay Meshing

(12)

Code Example

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <CGAL/Constrained_Delaunay_triangulation_2.h>

#include <CGAL/Delaunay_mesher_2.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

typedef CGAL::Constrained_Delaunay_triangulation_2<Kernel> CDT;

int main()‏

{

CDT cdt;

… // insert points and constraints CGAL::refine_Delaunay_mesh_2(cdt);

return 0;

}

(13)

Background

(14)

Delaunay Edge

An edge is said to be a Delaunay edge, if it is inscribed in an empty

circle

(15)

Gabriel Edge

An edge is said to be a Gabriel edge, if its diametral circle is empty

(16)

Conforming Delaunay Triangulation

A constrained Delaunay triangulation is a conforming Delaunay triangulation, if every constrained edge is a Delaunay edge

non conforming conforming

(17)

Conforming Gabriel Triangulation

A constrained Delaunay triangulation is a conforming Gabriel triangulation, if every constrained edge is a Gabriel edge

non conforming conforming Gabriel

(18)

Steiner Vertices

Any constrained Delaunay triangulation can be refined into a conforming Delaunay or Gabriel triangulation by adding Steiner vertices.

non conforming conforming Gabriel

(19)

Delaunay Refinement

Rule #1: break bad elements by inserting circumcenters (Voronoi vertices)‏

 “bad” in terms of size or shape (too big or skinny)‏

Picture taken from [Shewchuk]

(20)

Delaunay Refinement

Rule #2: Midpoint vertex insertion

A constrained segment is said to be encroached, if there is a vertex inside its diametral circle

Picture taken from [Shewchuk]

(21)

Delaunay Refinement

Encroached subsegments have priority over skinny triangles

Picture taken from [Shewchuk]

(22)

API

(23)

Parameters for Mesh Generation

Shape

 Lower bound on triangle angles

Input PLSG 5 deg 20.7 deg

Online manual

(24)

Parameters for Mesh Generation

 Shape

 Lower bound on triangle angles

Size

 No constraint

 Uniform sizing

 Sizing function

(25)

Sizing Parameter

No constraint Uniform Sizing function

(26)

Example Code

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <CGAL/Constrained_Delaunay_triangulation_2.h>

#include <CGAL/Delaunay_mesher_2.h>

#include <CGAL/Delaunay_mesh_size_criteria_2.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;

typedef CGAL::Constrained_Delaunay_triangulation_2<Kernel> CDT;

typedef CGAL::Delaunay_mesh_size_criteria_2<CDT> Criteria;

typedef CGAL::Delaunay_mesher_2<CDT, Criteria> Meshing_engine;

int main()‏

{

CDT cdt;

Meshing_engine engine(cdt);

engine.refine_mesh();

engine.set_criteria(Criteria(0.125, 0.5)); // min 20.6 deg // 0.5 for sizing engine.refine_mesh(); // refine once more, etc.

return 0;

}

(27)

Parameters for Mesh Generation

 Shape

 Lower bound on triangle angles

 Size

 No constraint

 Uniform sizing

 Sizing function

Seeds

 Exclude/include components

(28)

Example

(29)

Volume Mesh Generation

in CGAL

(30)

Volume Mesh Generation Algorithm

repeat {

pick bad simplex

if(Steiner point encroaches a facet)‏

refine facet else

refine simplex

update Delaunay triangulation restricted to domain

}

until all simplices are good

Exude slivers

(31)

Delaunay Refinement

(32)

Delaunay Filtering

domain boundary

restricted Delaunay triangulation

3D complex embedded in

a 3D

triangulation

(33)

Example

(34)

Example

(35)

Mesh from Implicit Function

 38k vertices

 168k tetrahedra

 Mesh generation: 8s

(36)

Multi-Domain Volume Mesh

(37)

Polyhedral Multi-Domain

(38)

Added Value: Shortened Pipeline

3D image

Marching

cubes Simplification Remeshing Mesh 1

Mesh 2

Mesh N Mesh

Generation

Merging

Standard mesh generation pipeline

CGAL-mesh generation pipeline

(39)

CGAL Mesh generation Engine while ( (simplex) ‏)

refine(simplex); is_bad

CGAL 3D (weighted) Delaunay triangulation

Overall Design

User Data Domain

• do_intersect_surface(Segment s)

• is_in_domain(Point p) Predicate

• get_intersection_point(Segment s) Construction

Query

“oracle”

• Mesh matches criteria

Guarantees

Mesh

Output

CGAL Kernel

Criteria

is_bad

Answer

(40)

CGAL Mesh generation Engine

Overall Design

(41)

CGAL Mesh generation Engine

CGAL 3D (weighted) Delaunay triangulation

Overall Design

(42)

CGAL Mesh generation Engine

CGAL 3D (weighted) Delaunay triangulation

Overall Design

CGAL Kernel

(43)

CGAL Mesh generation Engine while ( (simplex) ‏)

refine(simplex); is_bad

CGAL 3D (weighted) Delaunay triangulation

Overall Design

CGAL Kernel

(44)

CGAL Mesh generation Engine while ( (simplex) ‏)

refine(simplex); is_bad

CGAL 3D (weighted) Delaunay triangulation

Overall Design

User Data Domain

CGAL Kernel

(45)

CGAL Mesh generation Engine while ( (simplex) ‏)

refine(simplex); is_bad

CGAL 3D (weighted) Delaunay triangulation

Overall Design

User Data Domain

• do_intersect_surface(Segment s)

• is_in_domain(Point p) Predicate

• get_intersection_point(Segment s) Construction

Query

“oracle”

CGAL Kernel

(46)

CGAL Mesh generation Engine while ( (simplex) ‏)

refine(simplex); is_bad

CGAL 3D (weighted) Delaunay triangulation

Overall Design

User Data Domain

• do_intersect_surface(Segment s)

• is_in_domain(Point p) Predicate

• get_intersection_point(Segment s) Construction

Query

“oracle”

CGAL Kernel

Answer

(47)

CGAL Mesh generation Engine while ( (simplex) ‏)

refine(simplex); is_bad

CGAL 3D (weighted) Delaunay triangulation

Overall Design

User Data Domain

• do_intersect_surface(Segment s)

• is_in_domain(Point p) Predicate

• get_intersection_point(Segment s) Construction

Query

“oracle”

CGAL Kernel

Criteria

is_bad

Answer

(48)

CGAL Mesh generation Engine while ( (simplex) ‏)

refine(simplex); is_bad

CGAL 3D (weighted) Delaunay triangulation

Overall Design

User Data Domain

• do_intersect_surface(Segment s)

• is_in_domain(Point p) Predicate

• get_intersection_point(Segment s) Construction

Query

“oracle”

• Mesh matches criteria

Guarantees

Mesh

Output

CGAL Kernel

Criteria

is_bad

Answer

(49)

Main function

template <class C3T3,class MeshDomain_3, class MeshCriteria>

C3T3 make_mesh_3 (MeshDomain_3 domain, MeshCriteria criteria)

C3T3: 3D complex embedded in a 3D

triangulation

(50)

Simple Code Example

FT sphere_function(const Point& p)

{ return CGAL::squared_distance(p, Point(CGAL::ORIGIN))- 1; }

Mesh_domain domain(sphere_function, K::Sphere_3(CGAL::ORIGIN, 2.));

Mesh_criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025,

cell_radius_edge=2, cell_size=0.1);

C3t3 c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);

Références

Documents relatifs

Nevertheless, since different cell types have different microtopography preferences, topography patterning can be used to control cell cultures of more than one cell type..

Activation of the Constitutive Androstane Receptor induces hepatic lipogenesis and regulates Pnpla3 gene expression in a LXR-independent way...

5 ( مﻼﻌﺘﺴﻻا : مﺎظﻨﻝا موﻘﻴ ﺎﻨرﺎﺒﺨﺈﺒ دوﻘﻔﻤ وأ فﻝﺎﺘ رﻴودﺘﻝا ، دﻴﻠﺠﺘﻝا ﻲﻓ ﻪﻨﺄﺒ ددﻋ لﻜ فﻗوﻤﺒ.. 5 - ةددﺤﻤ ﺔﻴﻨﻤز ةدﻤ لﻼﺨ ﺔﻨﻴﻌﻤ تﺎﻴرود ﻲﻓ كارﺘﺸﻻا دﻴدﺠﺘ ﺦﻴراوﺘﺒ رﻴرﻘﺘ

étudié dans le cadre de cette thèse correspond à un objet glacé qui orbite dans le système solaire externe pour arriver ensuite dans le système solaire interne sous la forme

glycolipids that were identified as product D and PGL-tb by TLC and MALDI-TOF analyses (Figure 3 and Figure S2). The presence of product D indicated that the Rv2957 gene carried

ﻥﻴﺘﻴﻵﺍ ﻥﻴﺘﺎﻫ ﻲﻓ ﻰﻨﻌﻤﻟﺍﻭ ّلﻜ ﻪﻤﻠﻌﻴ ﷲﺍ ﻥﻴﺩ ﻥﻤ ﺎﻤﻠﻋ ﻡﺘﻜ ﻥﻤ ، ﻡﻠﻌﻟﺍ ﺀﺍﻭﺴ ﻱﺫﹼﻟﺍ ﻭـﻫ لﻬﺠﻟﺍ ﺩﻀ ﻭﺃ ، ﻤ ﻭﻫ ﺎﻤﻋ لﻴﺩﺒﻟﺍ ﻡﻠﻌﻟﺍ ﺭ ﻓ ﻪـﻨﺍﻭﻟﺃ ﻑـﻠﺘﺨﻤ ﺩﺎﺴﻓ ﻥﻤ ﻊﻗﺍﻭﻟﺍ

We first approximate the non standard semantics by the domain N V c associating to each program point its threads occurrence in the configuration and to each transition label,

We adopt a very simple economic model with only three agents: households allocate their income between consumption and saving; firms produce consumption and capital goods,