coal
3.0.4
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
Toggle main menu visibility
Loading...
Searching...
No Matches
convex.h
Go to the documentation of this file.
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Copyright (c) 2011-2014, Willow Garage, Inc.
5
* Copyright (c) 2014-2015, Open Source Robotics Foundation
6
* All rights reserved.
7
*
8
* Redistribution and use in source and binary forms, with or without
9
* modification, are permitted provided that the following conditions
10
* are met:
11
*
12
* * Redistributions of source code must retain the above copyright
13
* notice, this list of conditions and the following disclaimer.
14
* * Redistributions in binary form must reproduce the above
15
* copyright notice, this list of conditions and the following
16
* disclaimer in the documentation and/or other materials provided
17
* with the distribution.
18
* * Neither the name of Open Source Robotics Foundation nor the names of its
19
* contributors may be used to endorse or promote products derived
20
* from this software without specific prior written permission.
21
*
22
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
* POSSIBILITY OF SUCH DAMAGE.
34
*/
35
37
38
#ifndef COAL_SHAPE_CONVEX_H
39
#define COAL_SHAPE_CONVEX_H
40
41
#include "
coal/shape/geometric_shapes.h
"
42
43
namespace
coal
{
44
48
template
<
typename
PolygonT>
49
class
Convex
:
public
ConvexBase
{
50
public
:
52
Convex
() :
ConvexBase
(),
num_polygons
(0) {}
53
63
Convex
(std::shared_ptr<std::vector<Vec3s>> points_,
unsigned
int
num_points_,
64
std::shared_ptr<std::vector<PolygonT>> polygons_,
65
unsigned
int
num_polygons_);
66
69
Convex
(
const
Convex
& other);
70
71
~Convex
();
72
74
Matrix3s
computeMomentofInertia
()
const
;
75
76
Vec3s
computeCOM
()
const
;
77
78
CoalScalar
computeVolume
()
const
;
79
91
void
set
(std::shared_ptr<std::vector<Vec3s>>
points
,
unsigned
int
num_points
,
92
std::shared_ptr<std::vector<PolygonT>>
polygons
,
93
unsigned
int
num_polygons
);
94
96
virtual
Convex<PolygonT>
*
clone
()
const
;
97
101
std::shared_ptr<std::vector<PolygonT>>
polygons
;
102
unsigned
int
num_polygons
;
103
104
protected
:
105
void
fillNeighbors
();
106
};
107
108
}
// namespace coal
109
110
#include "
coal/shape/details/convex.hxx
"
111
112
#endif
coal::Convex
Convex polytope.
Definition
convex.h:49
coal::Convex::clone
virtual Convex< PolygonT > * clone() const
Clone (deep copy).
Definition
convex.hxx:84
coal::Convex::computeMomentofInertia
Matrix3s computeMomentofInertia() const
based on http://number-none.com/blow/inertia/bb_inertia.doc
Definition
convex.hxx:89
coal::Convex::set
void set(std::shared_ptr< std::vector< Vec3s > > points, unsigned int num_points, std::shared_ptr< std::vector< PolygonT > > polygons, unsigned int num_polygons)
Set the current Convex from a list of points and polygons.
Definition
convex.hxx:70
coal::Convex::~Convex
~Convex()
Definition
convex.hxx:67
coal::Convex::computeVolume
CoalScalar computeVolume() const
compute the volume
Definition
convex.hxx:187
coal::Convex::fillNeighbors
void fillNeighbors()
Definition
convex.hxx:231
coal::Convex::num_polygons
unsigned int num_polygons
Definition
convex.h:102
coal::Convex::computeCOM
Vec3s computeCOM() const
compute center of mass
Definition
convex.hxx:142
coal::Convex::polygons
std::shared_ptr< std::vector< PolygonT > > polygons
An array of PolygonT object. PolygonT should contains a list of vertices for each polygon,...
Definition
convex.h:101
coal::Convex::Convex
Convex()
Construct an uninitialized convex object.
Definition
convex.h:52
convex.hxx
coal::ConvexBase::num_points
unsigned int num_points
Definition
geometric_shapes.h:720
coal::ConvexBase::ConvexBase
ConvexBase()
Construct an uninitialized convex object Initialization is done with ConvexBase::initialize.
Definition
geometric_shapes.h:762
coal::ConvexBase::points
std::shared_ptr< std::vector< Vec3s > > points
An array of the points of the polygon.
Definition
geometric_shapes.h:719
coal
Main namespace.
Definition
broadphase_bruteforce.h:44
coal::Matrix3s
Eigen::Matrix< CoalScalar, 3, 3 > Matrix3s
Definition
data_types.h:81
coal::Vec3s
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
Definition
data_types.h:77
coal::CoalScalar
double CoalScalar
Definition
data_types.h:76
geometric_shapes.h
include
coal
shape
convex.h
Generated by
1.17.0