26 #include "utility/geom/d2/D2to3d.h" 27 #include "utility/geom/pos_vec/Vector3d.h" 28 #include "utility/geom/d2/2d_polygons/Polygon2d.h" 29 #include "../cgal_types.h" 30 #include "utility/geom/d2/Plane.h" 40 template <
typename InputIterator>
41 explicit Polygon3d(InputIterator first,InputIterator last);
46 explicit Polygon3d(
const boost::python::list &);
48 virtual GeomObj *getCopy(
void)
const 51 inline void push_back(
const Pos3d &p)
52 { plg2d.push_back(
to_2d(p)); }
54 inline virtual unsigned int getNumVertices(
void)
const 55 {
return plg2d.getNumVertices(); }
56 inline virtual unsigned int getNumEdges(
void)
const 57 {
return plg2d.getNumEdges(); }
64 std::vector<Polygon3d> getTributaryPolygons(
void)
const;
65 inline std::vector<double> getTributaryAreas(
void)
const 90 inline GEOM_FT getLambda(
const Pos3d &p)
const 96 Plane getPlaneFromSide0(
unsigned int i)
const;
97 Plane getPlaneFromSide(
unsigned int i)
const;
100 GEOM_FT
Ix(
void)
const;
101 GEOM_FT
Iy(
void)
const;
102 GEOM_FT
Iz(
void)
const;
104 GEOM_FT
GetMax(
unsigned short int i)
const;
105 GEOM_FT
GetMin(
unsigned short int i)
const;
106 bool In(
const Pos3d &p,
const double &tol)
const;
109 GEOM_FT distSigno(
const Pos3d &p)
const;
122 std::list<Polygon3d>
Corta(
const Plane &p)
const;
124 void Print(std::ostream &os)
const;
127 template <
typename InputIterator>
128 Polygon3d::Polygon3d(InputIterator begin,InputIterator end)
133 const Pos3d A= *i; i++;
134 const Pos3d B= *i; i++;
138 for(InputIterator i= begin; i!= end; i++)
144 inline std::list<Polygon3d> corta(
const Polygon3d &pol,
const Plane &pl)
145 {
return pol.
Corta(pl); }
Pos2d to_2d(const Pos3d &) const
Return the 2D point corresponding to the 3D point argument.
Definition: D2to3d.cc:132
GEOM_FT Iz(void) const
Moment of inertia with respect to an axis parallel to the z axis passing through the center of mass...
Definition: Polygon3d.cc:254
int getIndexOfProximalEdge(const Pos3d &) const
Return the proximal edge with respect to the point argument.
Definition: Polygon3d.cc:131
Segment3d Lado0(unsigned int i) const
Return the i-th side (i between 0 and num_sides-1).
Definition: Polygon3d.cc:102
Plane polygon in a 3D space.
Definition: Polygon3d.h:35
std::string orientation(const Pos3d &) const
Return the orientation of the polygon (clockwise or counterclockwise).
Definition: Polygon3d.cc:537
GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the i-th coordinate.
Definition: Polygon3d.cc:261
GeomObj::list_Pos3d getVertexList(void) const
Return a Python list containing the positions of the polygon vertices.
Definition: Polygon3d.cc:73
Segment en tres dimensiones.
Definition: Segment3d.h:41
GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the i-th coordinate.
Definition: Polygon3d.cc:266
Base class for position lists.
Definition: PolyPos.h:35
Pos3d Projection(const Pos3d &) const
Return the projection of the given point into the polyline.
Definition: Polygon3d.cc:515
Segment3d getIntersection(const Line3d &) const
Return the intersection with the line argument.
Definition: Polygon3d.cc:419
int getIndexOfProximalVertex(const Pos3d &) const
Return the proximal vertex with respect to the point argument.
Definition: Polygon3d.cc:171
Pos3d Vertice(unsigned int i) const
Return the position of the i-th vertex.
Definition: Polygon3d.h:68
GEOM_FT Ix(void) const
Moment of inertia with respect to an axis parallel to the x axis passing through the center of mass...
Definition: Polygon3d.cc:236
Pos2d Vertice(unsigned int i) const
Return the position of the i-th vertex.
Definition: Polygon2d.h:157
Segment3d Lado(unsigned int i) const
Return the i-th edge (i between 1 and num_sides).
Definition: Polygon3d.cc:95
Vector3d Base1(void) const
Return un vector ortogonal al devuelto por Normal().
Definition: Plane.cc:145
Plane in a three-dimensional space.
Definition: Plane.h:49
virtual GEOM_FT getLengthUpTo(const Pos3d &) const
Return the length along the perimeter upto the given point.
Definition: Polygon3d.cc:526
Pos2d Vertice0(unsigned int j) const
Return the position of the i-th vertex (0 based: j=0..getNumVertices()-1).
Definition: Polygon2d.h:161
bool TocaCuadrante(const int &) const
Return true if alguno de los vertices toca el cuadrante que se pasa como parámetro.
Definition: Polygon3d.cc:457
Polygon3d offset(const GEOM_FT &d) const
Return a polygon parallel to this one at the given distance.
Definition: Polygon3d.cc:498
Segment3d Clip(const Line3d &) const
Return the intersection of the polygon with the line.
Definition: Polygon3d.cc:340
Ray in a three-dimensional space.
Definition: Ray3d.h:36
std::list< Polygon3d > Corta(const Plane &p) const
Return the polygons that result form cutting the polygon with the argument plane. ...
Definition: Polygon3d.cc:436
bool counterclockwise(const Pos3d &) const
Return true if the point list is oriented counterclockwise.
Definition: Polygon3d.cc:473
int getIndexOfDistalVertex(const Pos3d &) const
Return the distal vertex with respect to the point argument.
Definition: Polygon3d.cc:151
Polígono en dos dimensiones.
Definition: Polygon2d.h:38
bool In(const Pos3d &p, const double &tol) const
Return true if the point lies inside the polygon (i.
Definition: Polygon3d.cc:202
Pos3d getCenterOfMass(void) const
Return the center of mass of the polygon.
Definition: Polygon3d.cc:218
Polygon3d buffer(const GEOM_FT &d) const
Returns the buffer (a polygon being the spatial point set collection within a specified maximum dista...
Definition: Polygon3d.cc:507
Class that places 2D objects (circle, ellipse, polygons, ...) in a 3D space.
Definition: D2to3d.h:44
GEOM_FT getArea(void) const
Return the area of the object.
Definition: Polygon3d.h:62
boost::python::list getVertexListPy(void) const
Return a Python list containing the positions of the polygon vertices.
Definition: Polygon3d.cc:84
Vector3d Base2(void) const
Return un vector ortogonal al devuelto por Normal() y al devuelto por Base1().
Definition: Plane.cc:152
D2to3d(void)
Constructor.
Definition: D2to3d.cc:40
GEOM_FT dist2(const Pos3d &p) const
Return the distance from point to polygon.
Definition: Polygon3d.cc:321
bool clockwise(const Pos3d &) const
Return true if the point list is oriented clockwise.
Definition: Polygon3d.cc:468
std::vector< double > getTributaryAreas(void) const
Return the areas of the tributary polygons (one for each vertex).
Definition: Polygon2d.cc:415
Posición en tres dimensiones.
Definition: Pos3d.h:44
GEOM_FT Iy(void) const
Moment of inertia with respect to an axis parallel to the y axis passing through the center of mass...
Definition: Polygon3d.cc:245
int getIndexOfDistalEdge(const Pos3d &) const
Return the index of the distal edge with respect to the point argument.
Definition: Polygon3d.cc:111
GEOM_FT getLength(void) const
Return the length of the object.
Definition: Polygon3d.h:59
Line in a three-dimensional space.
Definition: Line3d.h:62
GEOM_FT distSigno2(const Pos3d &p) const
Return the squared distance from from point to polygon.
Definition: Polygon3d.cc:292
virtual GEOM_FT getArea(void) const
Return the polygon area.
Definition: Polygon2d.cc:383
Pos3d Vertice0(unsigned int j) const
Return the position of the i-th vertex (0 based: j=0..getNumVertices()-1)
Definition: Polygon3d.h:72
bool intersects(const Line3d &) const
Return true if the line intersects the polygon.
Definition: Polygon3d.cc:412
Clase base para las entidades geométricas.
Definition: GeomObj.h:40
GEOM_FT dist(const Pos3d &p) const
Return the distance from point to polygon.
Definition: Polygon3d.cc:333
Two-dimensional reference system defined in a three-dimensional space.
Definition: Ref2d3d.h:41
virtual GEOM_FT getLength(void) const
Return the perimeter of the surface.
Definition: PolygonalSurface2d.cc:90
Three-dimensional reference system defined in a three-dimensional space.
Definition: Ref3d3d.h:39
Pos3d to_3d(const Pos2d &) const
Return the 3D point corresponding to the 2D point argument.
Definition: D2to3d.cc:100