Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
iMSTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
VROrthognathic
iMSTK
Commits
0ea78192
Commit
0ea78192
authored
3 years ago
by
Andrew Wilson
Browse files
Options
Downloads
Patches
Plain Diff
BUG: Ignore segments in triangle mesh reading
parent
c11d712c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/MeshIO/imstkAssimpMeshIO.cpp
+13
-10
13 additions, 10 deletions
Source/MeshIO/imstkAssimpMeshIO.cpp
with
13 additions
and
10 deletions
Source/MeshIO/imstkAssimpMeshIO.cpp
+
13
−
10
View file @
0ea78192
...
...
@@ -81,8 +81,8 @@ AssimpMeshIO::convertAssimpMesh(aiMesh* importedMesh)
auto
mesh
=
std
::
make_shared
<
SurfaceMesh
>
(
std
::
string
(
importedMesh
->
mName
.
C_Str
()));
// Get mesh information
auto
numVertices
=
importedMesh
->
mNumVertices
;
auto
num
Triangles
=
importedMesh
->
mNumFaces
;
auto
numVertices
=
importedMesh
->
mNumVertices
;
auto
num
Faces
=
importedMesh
->
mNumFaces
;
if
(
numVertices
==
0
)
{
...
...
@@ -103,17 +103,20 @@ AssimpMeshIO::convertAssimpMesh(aiMesh* importedMesh)
}
// Triangles
std
::
shared_ptr
<
VecDataArray
<
int
,
3
>>
trianglesPtr
=
std
::
make_shared
<
VecDataArray
<
int
,
3
>>
(
numTriangles
);
VecDataArray
<
int
,
3
>&
triangles
=
*
trianglesPtr
;
auto
trianglesPtr
=
std
::
make_shared
<
VecDataArray
<
int
,
3
>>
();
trianglesPtr
->
reserve
(
numFaces
);
VecDataArray
<
int
,
3
>&
triangles
=
*
trianglesPtr
;
for
(
unsigned
int
i
=
0
;
i
<
num
Triangl
es
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
num
Fac
es
;
i
++
)
{
auto
triangle
=
importedMesh
->
mFaces
[
i
];
auto
indices
=
triangle
.
mIndices
;
triangles
[
i
][
0
]
=
indices
[
0
];
triangles
[
i
][
1
]
=
indices
[
1
];
triangles
[
i
][
2
]
=
indices
[
2
];
aiFace
triangle
=
importedMesh
->
mFaces
[
i
];
unsigned
int
*
indices
=
triangle
.
mIndices
;
if
(
triangle
.
mNumIndices
==
3
)
// Only supports triangles
{
triangles
.
push_back
(
Vec3i
(
indices
[
0
],
indices
[
1
],
indices
[
2
]));
}
}
trianglesPtr
->
squeeze
();
// Vertex normals, tangents, and bitangents
std
::
shared_ptr
<
VecDataArray
<
double
,
3
>>
normalsPtr
=
std
::
make_shared
<
VecDataArray
<
double
,
3
>>
(
numVertices
);
...
...
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