Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
0a9b3904
Commit
0a9b3904
authored
6 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Added getFaceAreas()
parent
c1384c57
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
VirtualRobot/Visualization/TriMeshModel.cpp
+12
-0
12 additions, 0 deletions
VirtualRobot/Visualization/TriMeshModel.cpp
VirtualRobot/Visualization/TriMeshModel.h
+4
-0
4 additions, 0 deletions
VirtualRobot/Visualization/TriMeshModel.h
with
16 additions
and
0 deletions
VirtualRobot/Visualization/TriMeshModel.cpp
+
12
−
0
View file @
0a9b3904
...
...
@@ -497,6 +497,18 @@ namespace VirtualRobot
vertices
.
swap
(
newVertices
);
return
removed
;
}
std
::
vector
<
float
>
TriMeshModel
::
getFaceAreas
()
const
{
std
::
vector
<
float
>
areas
;
for
(
const
auto
&
face
:
faces
)
{
float
area
=
MathTools
::
getTriangleArea
(
vertices
.
at
(
face
.
id1
),
vertices
.
at
(
face
.
id2
),
vertices
.
at
(
face
.
id3
));
areas
.
push_back
(
area
);
}
return
areas
;
}
void
TriMeshModel
::
fattenShrink
(
float
offset
,
bool
updateNormals
)
{
...
...
This diff is collapsed.
Click to expand it.
VirtualRobot/Visualization/TriMeshModel.h
+
4
−
0
View file @
0a9b3904
...
...
@@ -118,6 +118,10 @@ namespace VirtualRobot
* @return Number of removed vertices
*/
size_t
removeUnusedVertices
();
/// Get the areas of all faces.
std
::
vector
<
float
>
getFaceAreas
()
const
;
// Overwrite all colors
void
setColor
(
VisualizationFactory
::
Color
color
);
...
...
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