Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
wenqing
ogs
Commits
b3f99d70
Commit
b3f99d70
authored
10 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
added second eps to old function to unify interface
parent
985bf1de
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
GeoLib/AnalyticalGeometry.cpp
+5
-4
5 additions, 4 deletions
GeoLib/AnalyticalGeometry.cpp
GeoLib/AnalyticalGeometry.h
+5
-2
5 additions, 2 deletions
GeoLib/AnalyticalGeometry.h
with
10 additions
and
6 deletions
GeoLib/AnalyticalGeometry.cpp
+
5
−
4
View file @
b3f99d70
...
...
@@ -213,7 +213,7 @@ bool isPointInTriangle(GeoLib::Point const& p,
case
GeoLib
::
BARYCENTRIC
:
return
barycentricPointInTriangle
(
p
,
a
,
b
,
c
,
eps_pnt_out_of_plane
,
eps_pnt_out_of_tri
);
default:
return
gaussPointInTriangle
(
p
,
a
,
b
,
c
,
eps_pnt_out_of_plane
);
return
gaussPointInTriangle
(
p
,
a
,
b
,
c
,
eps_pnt_out_of_plane
,
eps_pnt_out_of_tri
);
}
return
false
;
}
...
...
@@ -222,7 +222,8 @@ bool gaussPointInTriangle(GeoLib::Point const& q,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
double
eps
)
double
eps_pnt_out_of_plane
,
double
eps_pnt_out_of_tri
)
{
MathLib
::
Vector3
const
v
(
a
,
b
);
MathLib
::
Vector3
const
w
(
a
,
c
);
...
...
@@ -240,7 +241,7 @@ bool gaussPointInTriangle(GeoLib::Point const& q,
MathLib
::
GaussAlgorithm
<
MathLib
::
DenseMatrix
<
double
>
,
double
*>
gauss
(
mat
);
gauss
.
solve
(
y
);
const
double
lower
(
std
::
numeric_limits
<
float
>::
epsilon
()
);
const
double
lower
(
eps_pnt_out_of_tri
);
const
double
upper
(
1
+
lower
);
if
(
-
lower
<=
y
[
0
]
&&
y
[
0
]
<=
upper
&&
-
lower
<=
y
[
1
]
&&
y
[
1
]
<=
upper
&&
y
[
0
]
+
y
[
1
]
<=
...
...
@@ -250,7 +251,7 @@ bool gaussPointInTriangle(GeoLib::Point const& q,
a
[
1
]
+
y
[
0
]
*
v
[
1
]
+
y
[
1
]
*
w
[
1
],
a
[
2
]
+
y
[
0
]
*
v
[
2
]
+
y
[
1
]
*
w
[
2
]
);
if
(
MathLib
::
sqrDist
(
q
,
q_projected
)
<
eps
)
if
(
MathLib
::
sqrDist
(
q
,
q_projected
)
<
eps
_pnt_out_of_plane
)
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
GeoLib/AnalyticalGeometry.h
+
5
−
2
View file @
b3f99d70
...
...
@@ -147,12 +147,15 @@ bool isPointInTriangle(GeoLib::Point const& p,
* @param a edge node of triangle
* @param b edge node of triangle
* @param c edge node of triangle
* @param eps size of neighbourhood (orthogonal distance to the plane spaned by triangle)
* @param eps_pnt_out_of_plane eps allowing for p to be slightly off the plane spanned by abc
* ((orthogonal distance to the plane spaned by triangle)
* @param eps_pnt_out_of_tri eps allowing for p to be slightly off outside of abc
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
*/
bool
gaussPointInTriangle
(
GeoLib
::
Point
const
&
p
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
double
eps
=
std
::
numeric_limits
<
float
>::
epsilon
());
double
eps_pnt_out_of_plane
=
std
::
numeric_limits
<
float
>::
epsilon
(),
double
eps_pnt_out_of_tri
=
std
::
numeric_limits
<
float
>::
epsilon
());
/**
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
...
...
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