Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
extraction_informations_forme_3D
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Astrid Beyer
extraction_informations_forme_3D
Commits
fe98a605
Commit
fe98a605
authored
2 years ago
by
Astrid Beyer
Browse files
Options
Downloads
Patches
Plain Diff
wip: script vérification de maillage
parent
6152c936
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
isTriangulate.cpp
+35
-0
35 additions, 0 deletions
isTriangulate.cpp
isTriangulate.h
+9
-0
9 additions, 0 deletions
isTriangulate.h
main.cpp
+77
-78
77 additions, 78 deletions
main.cpp
with
123 additions
and
79 deletions
.gitignore
+
1
−
0
View file @
fe98a605
build/
.vscode/
obj/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
CMakeLists.txt
+
1
−
1
View file @
fe98a605
...
...
@@ -7,7 +7,7 @@ set(CMAKE_CXX_STANDARD 11)
find_package
(
TTKVTK REQUIRED
)
add_executable
(
projet-stage main.cpp
)
add_executable
(
projet-stage main.cpp
isTriangulate.cpp
)
target_link_libraries
(
projet-stage
PUBLIC
...
...
This diff is collapsed.
Click to expand it.
isTriangulate.cpp
0 → 100644
+
35
−
0
View file @
fe98a605
#include
<vtkTriangleFilter.h>
#include
"isTriangulate.h"
// Fonction pour construire une triangulation valide à partir d'un vtkPolyData contenant des quadrilatères
vtkSmartPointer
<
vtkPolyData
>
triangulate
::
buildValidTriangulation
(
vtkSmartPointer
<
vtkPolyData
>
polyData
)
{
vtkSmartPointer
<
vtkPolyData
>
triPolyData
=
vtkSmartPointer
<
vtkPolyData
>::
New
();
// Si le maillage en entrée est composé de quadrilatères, on construit une triangulation valide
if
(
polyData
->
GetMaxCellSize
()
>
3
)
{
std
::
cout
<<
"maillage composé de quads"
;
// On utilise un filtre vtkQuadToTriangle pour convertir les quadrilatères en triangles
vtkSmartPointer
<
vtkTriangleFilter
>
quadToTri
=
vtkSmartPointer
<
vtkTriangleFilter
>::
New
();
quadToTri
->
SetInputData
(
polyData
);
quadToTri
->
Update
();
triPolyData
=
quadToTri
->
GetOutput
();
}
else
if
(
polyData
->
GetMaxCellSize
()
==
3
)
// Si le maillage en entrée est déjà triangulé, on renvoie le vtkPolyData d'origine
{
triPolyData
=
polyData
;
}
else
{
std
::
cout
<<
"Ce maillage n'est pas géré par ce programme, sont acceptés les maillages triangulés et quadrilatérisés"
;
}
// On ajoute un filtre vtkTriangleFilter pour garantir que la sortie est bien un maillage triangulé
vtkSmartPointer
<
vtkTriangleFilter
>
triangleFilter
=
vtkSmartPointer
<
vtkTriangleFilter
>::
New
();
triangleFilter
->
SetInputData
(
triPolyData
);
triangleFilter
->
Update
();
return
triangleFilter
->
GetOutput
();
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
isTriangulate.h
0 → 100644
+
9
−
0
View file @
fe98a605
#ifndef IS_TRIANGULATE_H // Vérification d'inclusion multiple
#define IS_TRIANGULATE_H
namespace
triangulate
{
vtkSmartPointer
<
vtkPolyData
>
buildValidTriangulation
(
vtkSmartPointer
<
vtkPolyData
>
polyData
);
// Prototype de la fonction
}
#endif // Fin de vérification d'inclusion multiple
This diff is collapsed.
Click to expand it.
main.cpp
+
77
−
78
View file @
fe98a605
...
...
@@ -32,13 +32,16 @@
#include
<vtkExtractSurface.h>
#include
<ttkGeometrySmoother.h>
#include
<vtkDataSetSurfaceFilter.h>
#include
<ttkUtils.h>
#include
<vtkThresholdPoints.h>
#include
<vtkAppendPolyData.h>
#include
<vtkSortDataArray.h>
int
main
(
int
argc
,
char
*
argv
[])
{
#include
"isTriangulate.h"
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
!=
2
)
{
std
::
cout
<<
"Required arguments: Filename(.obj)"
<<
std
::
endl
;
...
...
@@ -57,7 +60,8 @@ int main(int argc, char* argv[]) {
vtkNew
<
vtkOBJReader
>
reader
;
reader
->
SetFileName
(
filename
.
c_str
());
reader
->
Update
();
source
=
reader
->
GetOutput
();
source
=
triangulate
::
buildValidTriangulation
(
reader
->
GetOutput
());
}
else
{
...
...
@@ -78,7 +82,6 @@ int main(int argc, char* argv[]) {
minCurvaturesFilter
->
Update
();
auto
k2
=
minCurvaturesFilter
->
GetOutput
();
// Shape Index computation
k1
->
GetPointData
()
->
SetActiveScalars
(
"Maximum_Curvature"
);
auto
k1Array
=
k1
->
GetPointData
()
->
GetAbstractArray
(
"Maximum_Curvature"
);
...
...
@@ -158,7 +161,6 @@ int main(int argc, char* argv[]) {
reebGraph
->
SetInputArrayToProcess
(
0
,
0
,
0
,
vtkDataObject
::
FIELD_ASSOCIATION_POINTS
,
"Shape_Index"
);
reebGraph
->
Update
();
// Create Icospheres to represent nodes in the Reeb Graph
vtkNew
<
ttkIcospheresFromPoints
>
ttkIcospheresFromPoints
{};
ttkIcospheresFromPoints
->
SetInputData
(
0
,
reebGraph
->
GetOutput
());
...
...
@@ -185,7 +187,6 @@ int main(int argc, char* argv[]) {
// tube->SetNumberOfSides(1);
tube
->
Update
();
// Save the graph nodes with IcospheresFromPoints
vtkNew
<
vtkXMLPolyDataWriter
>
writerNodes
{};
writerNodes
->
SetFileName
(
"ReebGraphNodes.vtp"
);
...
...
@@ -223,7 +224,5 @@ int main(int argc, char* argv[]) {
segWriter->SetFileName("outputColor.vtp");
segWriter->Write();*/
return
EXIT_SUCCESS
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment