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
Özgür Ozan Sen
ogs
Commits
dfe02d3d
Commit
dfe02d3d
authored
10 years ago
by
Karsten Rink
Browse files
Options
Downloads
Patches
Plain Diff
fixed comments and indentation
parent
45314197
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
GeoLib/AnalyticalGeometry.cpp
+12
-12
12 additions, 12 deletions
GeoLib/AnalyticalGeometry.cpp
GeoLib/AnalyticalGeometry.h
+12
-12
12 additions, 12 deletions
GeoLib/AnalyticalGeometry.h
with
24 additions
and
24 deletions
GeoLib/AnalyticalGeometry.cpp
+
12
−
12
View file @
dfe02d3d
...
@@ -169,8 +169,8 @@ bool lineSegmentIntersect(
...
@@ -169,8 +169,8 @@ bool lineSegmentIntersect(
}
}
bool
lineSegmentsIntersect
(
const
GeoLib
::
Polyline
*
ply
,
bool
lineSegmentsIntersect
(
const
GeoLib
::
Polyline
*
ply
,
size_t
&
idx0
,
size_t
&
idx0
,
size_t
&
idx1
,
size_t
&
idx1
,
GeoLib
::
Point
&
intersection_pnt
)
GeoLib
::
Point
&
intersection_pnt
)
{
{
size_t
n_segs
(
ply
->
getNumberOfPoints
()
-
1
);
size_t
n_segs
(
ply
->
getNumberOfPoints
()
-
1
);
...
@@ -198,9 +198,10 @@ bool lineSegmentsIntersect(const GeoLib::Polyline* ply,
...
@@ -198,9 +198,10 @@ bool lineSegmentsIntersect(const GeoLib::Polyline* ply,
}
}
bool
isPointInTriangle
(
GeoLib
::
Point
const
&
p
,
bool
isPointInTriangle
(
GeoLib
::
Point
const
&
p
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
double
eps_pnt_out_of_plane
,
double
eps_pnt_out_of_tri
,
double
eps_pnt_out_of_plane
,
GeoLib
::
TriangleTest
algorithm
)
double
eps_pnt_out_of_tri
,
GeoLib
::
TriangleTest
algorithm
)
{
{
switch
(
algorithm
)
switch
(
algorithm
)
{
{
...
@@ -213,11 +214,9 @@ bool isPointInTriangle(GeoLib::Point const& p,
...
@@ -213,11 +214,9 @@ bool isPointInTriangle(GeoLib::Point const& p,
}
}
bool
gaussPointInTriangle
(
GeoLib
::
Point
const
&
q
,
bool
gaussPointInTriangle
(
GeoLib
::
Point
const
&
q
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
GeoLib
::
Point
const
&
b
,
double
eps_pnt_out_of_plane
,
GeoLib
::
Point
const
&
c
,
double
eps_pnt_out_of_tri
)
double
eps_pnt_out_of_plane
,
double
eps_pnt_out_of_tri
)
{
{
MathLib
::
Vector3
const
v
(
a
,
b
);
MathLib
::
Vector3
const
v
(
a
,
b
);
MathLib
::
Vector3
const
w
(
a
,
c
);
MathLib
::
Vector3
const
w
(
a
,
c
);
...
@@ -253,8 +252,9 @@ bool gaussPointInTriangle(GeoLib::Point const& q,
...
@@ -253,8 +252,9 @@ bool gaussPointInTriangle(GeoLib::Point const& q,
}
}
bool
barycentricPointInTriangle
(
GeoLib
::
Point
const
&
p
,
bool
barycentricPointInTriangle
(
GeoLib
::
Point
const
&
p
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
double
eps_pnt_out_of_plane
,
double
eps_pnt_out_of_tri
)
double
eps_pnt_out_of_plane
,
double
eps_pnt_out_of_tri
)
{
{
if
(
std
::
abs
(
orientation3d
(
p
,
a
,
b
,
c
))
>
eps_pnt_out_of_plane
)
if
(
std
::
abs
(
orientation3d
(
p
,
a
,
b
,
c
))
>
eps_pnt_out_of_plane
)
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
GeoLib/AnalyticalGeometry.h
+
12
−
12
View file @
dfe02d3d
...
@@ -121,7 +121,6 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x
...
@@ -121,7 +121,6 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
* Using two eps-values it is possible to test an 'epsilon' neighbourhood around the triangle
* Using two eps-values it is possible to test an 'epsilon' neighbourhood around the triangle
* as well as an 'epsilon' outside the triangles plane.
* as well as an 'epsilon' outside the triangles plane.
* Algorithm based on "Fundamentals of Computer Graphics" by Peter Shirley.
* @param p test point
* @param p test point
* @param a edge node of triangle
* @param a edge node of triangle
* @param b edge node of triangle
* @param b edge node of triangle
...
@@ -132,14 +131,15 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x
...
@@ -132,14 +131,15 @@ double calcTetrahedronVolume(const double* x1, const double* x2, const double* x
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
*/
*/
bool
isPointInTriangle
(
GeoLib
::
Point
const
&
p
,
bool
isPointInTriangle
(
GeoLib
::
Point
const
&
p
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
double
eps_pnt_out_of_plane
=
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
(),
double
eps_pnt_out_of_tri
=
std
::
numeric_limits
<
float
>::
epsilon
(),
GeoLib
::
TriangleTest
algorithm
=
GeoLib
::
GAUSS
);
GeoLib
::
TriangleTest
algorithm
=
GeoLib
::
GAUSS
);
/**
/**
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
* Using the eps it is possible to test a 'epsilon' neighbourhood around the triangle.
* Using two eps-values it is possible to test an 'epsilon' neighbourhood around the triangle
* as well as an 'epsilon' outside the triangles plane.
* @param p test point
* @param p test point
* @param a edge node of triangle
* @param a edge node of triangle
* @param b edge node of triangle
* @param b edge node of triangle
...
@@ -150,9 +150,9 @@ bool isPointInTriangle(GeoLib::Point const& p,
...
@@ -150,9 +150,9 @@ bool isPointInTriangle(GeoLib::Point const& p,
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
*/
*/
bool
gaussPointInTriangle
(
GeoLib
::
Point
const
&
p
,
bool
gaussPointInTriangle
(
GeoLib
::
Point
const
&
p
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
double
eps_pnt_out_of_plane
=
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
());
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.
* Tests if the given point p is within the triangle, defined by its edge nodes a, b and c.
...
@@ -168,9 +168,9 @@ bool gaussPointInTriangle(GeoLib::Point const& p,
...
@@ -168,9 +168,9 @@ bool gaussPointInTriangle(GeoLib::Point const& p,
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
* @return true if the test point p is within the 'epsilon'-neighbourhood of the triangle
*/
*/
bool
barycentricPointInTriangle
(
GeoLib
::
Point
const
&
p
,
bool
barycentricPointInTriangle
(
GeoLib
::
Point
const
&
p
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
GeoLib
::
Point
const
&
a
,
GeoLib
::
Point
const
&
b
,
GeoLib
::
Point
const
&
c
,
double
eps_pnt_out_of_plane
=
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
());
double
eps_pnt_out_of_tri
=
std
::
numeric_limits
<
float
>::
epsilon
());
/**
/**
* Tests if the given point p is located within a tetrahedron spanned by points a, b, c, d.
* Tests if the given point p is located within a tetrahedron spanned by points a, b, c, d.
...
...
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