Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Feliks Kiszkurno
ogs-feliks
Commits
dac1db4d
Commit
dac1db4d
authored
6 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[GL] Add a fast and non-robust version of orient2d
parent
7ee6f4e1
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
+23
-0
23 additions, 0 deletions
GeoLib/AnalyticalGeometry.cpp
GeoLib/AnalyticalGeometry.h
+9
-1
9 additions, 1 deletion
GeoLib/AnalyticalGeometry.h
with
32 additions
and
1 deletion
GeoLib/AnalyticalGeometry.cpp
+
23
−
0
View file @
dac1db4d
...
...
@@ -30,6 +30,7 @@
#include
"MathLib/GeometricBasics.h"
extern
double
orient2d
(
double
*
,
double
*
,
double
*
);
extern
double
orient2dfast
(
double
*
,
double
*
,
double
*
);
namespace
ExactPredicates
{
...
...
@@ -40,6 +41,15 @@ double getOrientation2d(MathLib::Point3d const& a,
const_cast
<
double
*>
(
b
.
getCoords
()),
const_cast
<
double
*>
(
c
.
getCoords
()));
}
double
getOrientation2dFast
(
MathLib
::
Point3d
const
&
a
,
MathLib
::
Point3d
const
&
b
,
MathLib
::
Point3d
const
&
c
)
{
return
orient2dfast
(
const_cast
<
double
*>
(
a
.
getCoords
()),
const_cast
<
double
*>
(
b
.
getCoords
()),
const_cast
<
double
*>
(
c
.
getCoords
()));
}
}
namespace
GeoLib
...
...
@@ -56,6 +66,19 @@ Orientation getOrientation(MathLib::Point3d const& p0,
return
COLLINEAR
;
}
Orientation
getOrientationFast
(
MathLib
::
Point3d
const
&
p0
,
MathLib
::
Point3d
const
&
p1
,
MathLib
::
Point3d
const
&
p2
)
{
double
const
orientation
=
ExactPredicates
::
getOrientation2dFast
(
p0
,
p1
,
p2
);
if
(
orientation
>
0
)
return
CCW
;
if
(
orientation
<
0
)
return
CW
;
return
COLLINEAR
;
}
bool
parallel
(
MathLib
::
Vector3
v
,
MathLib
::
Vector3
w
)
{
const
double
eps
(
std
::
numeric_limits
<
double
>::
epsilon
());
...
...
This diff is collapsed.
Click to expand it.
GeoLib/AnalyticalGeometry.h
+
9
−
1
View file @
dac1db4d
...
...
@@ -39,13 +39,21 @@ enum Orientation
};
/**
* Computes the orientation of the three 2D-Points.
* Computes the orientation of the three 2D-Points.
This is a robust method.
* \returns CW (clockwise), CCW (counterclockwise) or COLLINEAR (points are on a
* line)
*/
Orientation
getOrientation
(
MathLib
::
Point3d
const
&
p0
,
MathLib
::
Point3d
const
&
p1
,
MathLib
::
Point3d
const
&
p2
);
/**
* Computes the orientation of the three 2D-Points. This is a non-robust method.
* \returns CW (clockwise), CCW (counterclockwise) or COLLINEAR (points are on a
* line)
*/
Orientation
getOrientationFast
(
MathLib
::
Point3d
const
&
p0
,
MathLib
::
Point3d
const
&
p1
,
MathLib
::
Point3d
const
&
p2
);
/**
* compute a supporting plane (represented by plane_normal and the value d) for the polygon
* Let \f$n\f$ be the plane normal and \f$d\f$ a parameter. Then for all points \f$p \in R^3\f$ of the plane
...
...
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