Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
1b043016
Commit
1b043016
authored
10 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
dix
parent
e46b0756
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Geo/GModelIO_STL.cpp
+6
-3
6 additions, 3 deletions
Geo/GModelIO_STL.cpp
Geo/GRbf.cpp
+3
-5
3 additions, 5 deletions
Geo/GRbf.cpp
with
9 additions
and
8 deletions
Geo/GModelIO_STL.cpp
+
6
−
3
View file @
1b043016
...
...
@@ -146,7 +146,7 @@ int GModel::readSTL(const std::string &name, double tolerance)
MVertexRTree
pos
(
eps
);
pos
.
insert
(
vertices
);
std
::
set
<
MFace
,
Less_Face
>
unique
;
std
::
set
<
MFace
,
Less_Face
>
unique
;
int
nbDuplic
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
points
.
size
();
i
++
){
for
(
unsigned
int
j
=
0
;
j
<
points
[
i
].
size
();
j
+=
3
){
...
...
@@ -157,7 +157,10 @@ int GModel::readSTL(const std::string &name, double tolerance)
double
z
=
points
[
i
][
j
+
k
].
z
();
v
[
k
]
=
pos
.
find
(
x
,
y
,
z
);
}
MFace
mf
(
v
[
0
],
v
[
1
],
v
[
2
]);
// FIXME: is this unicity test really useful? it slows down large STL
// reads. It would be better to provide an API to detect/remove duplicate
// elements
MFace
mf
(
v
[
0
],
v
[
1
],
v
[
2
]);
if
(
unique
.
find
(
mf
)
==
unique
.
end
()){
faces
[
i
]
->
triangles
.
push_back
(
new
MTriangle
(
v
[
0
],
v
[
1
],
v
[
2
]));
unique
.
insert
(
mf
);
...
...
@@ -167,7 +170,7 @@ int GModel::readSTL(const std::string &name, double tolerance)
}
}
}
if
(
nbDuplic
)
if
(
nbDuplic
)
Msg
::
Warning
(
"%d duplicate triangles in STL file"
,
nbDuplic
);
_associateEntityWithMeshVertices
();
...
...
This diff is collapsed.
Click to expand it.
Geo/GRbf.cpp
+
3
−
5
View file @
1b043016
...
...
@@ -112,18 +112,16 @@ GRbf::GRbf(double sizeBox, int variableEps, int rbfFun,
pos
.
insert
(
vertices
);
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
i
++
){
MVertex
*
v
=
vertices
[
i
];
pos
.
find
(
v
->
x
(),
v
->
y
(),
v
->
z
());
if
(
!
pos
.
find
(
v
->
x
(),
v
->
y
(),
v
->
z
()))
myNodes
.
insert
(
v
);
// keep only no duplicate vertices
allCenters
(
i
,
0
)
=
v
->
x
()
/
sBox
;
allCenters
(
i
,
1
)
=
v
->
y
()
/
sBox
;
allCenters
(
i
,
2
)
=
v
->
z
()
/
sBox
;
_mapAllV
.
insert
(
std
::
make_pair
(
v
,
i
));
}
// keep only no duplicate vertices
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
i
++
)
if
(
vertices
[
i
]
->
getIndex
())
myNodes
.
insert
(
vertices
[
i
]);
// initialize with points
nbNodes
=
myNodes
.
size
();
nbNodes
=
myNodes
.
size
();
centers
.
resize
(
nbNodes
,
3
);
normals
.
resize
(
nbNodes
,
3
);
int
index
=
0
;
...
...
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