Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume below a plane #219

Merged
merged 88 commits into from
Sep 22, 2021
Merged
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
56b214e
Add volume below primitives
arjo129 Aug 3, 2021
008aa1b
fix tests
arjo129 Aug 5, 2021
0e40a5f
nearly there for boxes
arjo129 Aug 5, 2021
c18b735
Fix boxes
arjo129 Aug 6, 2021
40fa5b3
use convex hull algo
arjo129 Aug 9, 2021
e275ff8
Add overlap method
arjo129 Aug 10, 2021
dfec15c
Finally `Box::VolumeBelow()` works :tada:
arjo129 Aug 11, 2021
13f0ade
signed volume
arjo129 Aug 12, 2021
5cfe42c
codecheck
arjo129 Aug 12, 2021
d82a6ba
Add center of volume recalculation
arjo129 Aug 14, 2021
27287dc
Add center of volume functions
arjo129 Aug 14, 2021
f241019
codecheck
arjo129 Aug 14, 2021
61258cd
Trying to get windows CI to pass
arjo129 Aug 14, 2021
69af275
Add preliminary cylinder logic.
arjo129 Aug 16, 2021
3095359
Add plane transformation
arjo129 Aug 19, 2021
37b3842
fix function return value
arjo129 Aug 26, 2021
bbed807
fix types
arjo129 Aug 26, 2021
c6c7e00
Preliminary work for cylinders
arjo129 Aug 29, 2021
278dc07
remove unessecary include
arjo129 Aug 30, 2021
f4e70c7
remove more useless logging
arjo129 Aug 30, 2021
11180ee
remove unused transform function.
arjo129 Aug 30, 2021
6521336
style fixes
arjo129 Aug 30, 2021
532775b
:facepalm: compilation error
arjo129 Aug 30, 2021
a90d11a
more style fixes.
arjo129 Aug 30, 2021
a30d0db
Merge branch 'ign-math6' into arjo/volume_below
arjo129 Aug 30, 2021
4d6675d
Fix docstring
arjo129 Aug 30, 2021
2578996
Revert changes to cylinder since those are not ready yet.
arjo129 Aug 30, 2021
482f582
more cleanups
arjo129 Aug 30, 2021
4888d99
Add triangle test
arjo129 Aug 30, 2021
e1985b3
Remove redundant function
arjo129 Aug 30, 2021
7f204d4
>.< Doh stray include
arjo129 Aug 30, 2021
99589e4
remove unused include
arjo129 Aug 30, 2021
5ee6f3b
typesafe-ify
arjo129 Aug 31, 2021
1c896fa
silence warning
arjo129 Sep 1, 2021
646595f
Codecheck
arjo129 Sep 1, 2021
e8fd7a2
Flip sign... :facepalm:
arjo129 Sep 1, 2021
6f82675
Merge branch 'ign-math6' into arjo/volume_below
arjo129 Sep 2, 2021
43fd3e3
Merge branch 'ign-math6' into arjo/volume_below
chapulina Sep 14, 2021
16289b0
Rename `Box::GetIntersections`.
arjo129 Sep 15, 2021
9ed6254
Merge branch 'arjo/volume_below' of github.com:ignitionrobotics/ign-m…
arjo129 Sep 15, 2021
1257aca
Revert *all* changes to cylinder
arjo129 Sep 15, 2021
7f1f1c8
fix docs and signature
arjo129 Sep 15, 2021
6ff1b49
Add line test
arjo129 Sep 15, 2021
753b49d
style fix
arjo129 Sep 15, 2021
633dfee
Documentation
arjo129 Sep 15, 2021
165a724
Fix compiler :warning:
arjo129 Sep 15, 2021
f5a45fa
Added test for `Vector3d::Project()`
arjo129 Sep 16, 2021
e7eaad6
Add test for CenterOfVolumeBelow()
arjo129 Sep 16, 2021
9739419
Add Vector(2|3|4)<T>::NaN to easily create invalid vectors (#222)
chapulina Sep 15, 2021
9fef0d9
style
arjo129 Sep 16, 2021
5a20d68
update intersections test
arjo129 Sep 16, 2021
e6e6e65
Removed `GetPointOnPlane` as its unessescary
arjo129 Sep 16, 2021
7189fe0
fix :warning: about signess
arjo129 Sep 16, 2021
d98acb7
Update include/ignition/math/Box.hh
arjo129 Sep 16, 2021
8cfbb7d
Rename intersections
arjo129 Sep 17, 2021
cf438da
Rename Vector projection
arjo129 Sep 17, 2021
aed0c6b
Add tolerance argument
arjo129 Sep 17, 2021
c835aee
Update line to point distance to support points projected beyond the …
chapulina Sep 16, 2021
b1a172f
Suggestions to #219
chapulina Sep 16, 2021
9979f83
🌐 Spherical coordinates: bug fix, docs and sanity checks (#235)
chapulina Sep 16, 2021
5c9343f
Adds python interface to Quaternion, Pose3, Matrix3 and Matrix4 (#221)
LolaSegura Sep 17, 2021
495583d
fixes
arjo129 Sep 20, 2021
305d4d4
Rigorous tests and bugfixes
arjo129 Sep 20, 2021
aba72c1
Style
arjo129 Sep 20, 2021
0b8c218
more fixes
arjo129 Sep 20, 2021
acacbb9
fix compile issues caused by merge
arjo129 Sep 20, 2021
b1a36c0
More comprehensive tests and bugfixes for box
arjo129 Sep 20, 2021
d8bae9a
Merge branch 'ign-math6' into arjo/volume_below
arjo129 Sep 20, 2021
8e75628
fix windows warning (I think)
arjo129 Sep 20, 2021
9a66163
Add plane intersection in bounds
arjo129 Sep 20, 2021
4bf9cfb
style
arjo129 Sep 20, 2021
d0c605d
style
arjo129 Sep 20, 2021
d4968df
More suggestions to #219
chapulina Sep 21, 2021
9a659fe
abs, include
chapulina Sep 21, 2021
70aa913
Merge pull request #243 from ignitionrobotics/chapulina/volume_below_2
arjo129 Sep 21, 2021
f8d1a7a
Merge branch 'ign-math6' into arjo/volume_below
arjo129 Sep 21, 2021
95cd4ee
Fixed header
arjo129 Sep 21, 2021
20d66b1
Workaround. Hopefully will make windows happy.
arjo129 Sep 21, 2021
1492375
Address @scpeter 's feedback
arjo129 Sep 21, 2021
72d7779
Address @scpeters feedback about Line3
arjo129 Sep 21, 2021
e356258
Reverting, because the dividee by zero will never occur
arjo129 Sep 21, 2021
b06b483
Added comment
arjo129 Sep 21, 2021
91a6b43
Add test cases and assert
arjo129 Sep 21, 2021
f547e71
Whelps compile error.
arjo129 Sep 21, 2021
69b0448
Add docs
arjo129 Sep 21, 2021
bacd9f9
whitespaces
arjo129 Sep 21, 2021
4c0bd02
More docs fixes
arjo129 Sep 21, 2021
b4f9ddc
update scalar value
arjo129 Sep 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions include/ignition/math/Line3.hh
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,9 @@ namespace ignition

/// \brief Calculate shortest distance between line and point
/// \param[in] _pt Point which we are measuring distance to.
/// \param[in] _epsilon Tolerance below which assume this line is a point.
/// \returns Distance from point to line.
public: T Distance(const Vector3<T> &_pt)
public: T Distance(const Vector3<T> &_pt, const T _epsilon = 1e-6)
{
auto line = this->pts[1] - this->pts[0];
auto ptTo0 = _pt - this->pts[0];
Expand All @@ -251,8 +252,13 @@ namespace ignition
}

// Distance to point projected onto line
auto d = (ptTo0).Cross(line);
return d.Length() / (line).Length();
auto d = ptTo0.Cross(line);

// If line has length zero assume its a point.
if(line.Length() <= _epsilon)
return ptTo0.Length();

return d.Length() / line.Length();
}

/// \brief Check if this line intersects the given line segment.
Expand Down