PeriDEM 0.3.0
PeriDEM -- Peridynamics-based high-fidelity model for granular media
Loading...
Searching...
No Matches
geom::OpenRectChannel2D Class Reference

2D U-shaped cavity: thick rectangular frame with the top (+y) side open. More...

#include <openRectChannel2D.h>

Inheritance diagram for geom::OpenRectChannel2D:
Collaboration diagram for geom::OpenRectChannel2D:

Public Member Functions

 OpenRectChannel2D ()
 
 OpenRectChannel2D (double x0, double y0, double x1, double y1, double t, double z, std::string description="")
 
 OpenRectChannel2D (const OpenRectChannel2D &other)
 
OpenRectChannel2Doperator= (const OpenRectChannel2D &other)
 
void buildVertices ()
 
void transform (const util::Point &translation, const double &scale, const double &angle, const util::Point &axis, const util::Point *rotationPoint) override
 Similarity about pivot \(\mathbf p\) (default: old center d_x), then rigid displacement \(\mathbf t\) = translation: \(\mathbf y = \mathbf p + s\,\mathbf R(\mathbf x-\mathbf p) + \mathbf t\). When \(\theta=0\) and \(s=1\), \(\mathbf y = \mathbf x + \mathbf t\) for every point and the center.
 
double volume () const override
 Computes the volume (area in 2d, length in 1d) of object.
 
util::Point center () const override
 Computes the center of object.
 
std::pair< util::Point, util::Pointbox () const override
 Computes the bounding box of object.
 
std::pair< util::Point, util::Pointbox (const double &tol) const override
 Computes the bounding box of object.
 
double inscribedRadius () const override
 Computes the radius of biggest circle/sphere completely within the object.
 
double boundingRadius () const override
 Computes the radius of smallest circle/sphere such that object can be fit into it.
 
bool isInside (const util::Point &x) const override
 Checks if point is inside this object.
 
bool isOutside (const util::Point &x) const override
 Checks if point is outside of this object.
 
bool isNear (const util::Point &x, const double &tol) const override
 Checks if point is within given distance of this object.
 
bool isNearBoundary (const util::Point &x, const double &tol, const bool &within) const override
 Checks if point is within given distance of this object.
 
bool doesIntersect (const util::Point &x) const override
 Checks if point lies exactly on the boundary.
 
bool isInside (const std::pair< util::Point, util::Point > &bx) const override
 Checks if box is completely inside.
 
bool isOutside (const std::pair< util::Point, util::Point > &bx) const override
 Checks if box is outside of the object.
 
bool isNear (const std::pair< util::Point, util::Point > &bx, const double &tol) const override
 Checks if box is within given distance of this object.
 
bool doesIntersect (const std::pair< util::Point, util::Point > &bx) const override
 Checks if box intersects this object.
 
std::string printStr (int nt=0, int lvl=0) const override
 Returns the string containing printable information about the object.
 
void print (int nt=0, int lvl=0) const override
 Prints the information about the object.
 
void print () const override
 Prints the information about the object.
 
- Public Member Functions inherited from geom::GeomObject
 GeomObject (std::string name="", std::string description="")
 Constructor.
 
virtual bool wallContactQuery (const util::Point &x, WallContactHit &hit) const
 Closest-point / signed-gap query for analytical wall contact. Default: unsupported (returns false, clears hit).
 

Data Fields

double d_x0 = 0.
 
double d_y0 = 0.
 
double d_x1 = 0.
 
double d_y1 = 0.
 
double d_t = 0.
 
double d_z = 0.
 
std::vector< util::Pointd_vertices
 CCW boundary of the U-shaped solid (10 vertices, uniform thickness t).
 
util::Point d_x
 Area centroid of the polygon (same convention as d_x on other GeomObjects).
 
- Data Fields inherited from geom::GeomObject
const std::string d_name
 name of object
 
const std::string d_description
 Further description of object.
 
std::vector< std::string > d_tags
 Tags/attributes about the object.
 

Private Member Functions

bool pointInPolygon2D (const util::Point &p) const
 
double polygonArea2D () const
 
util::Point polygonCentroid2D () const
 

Detailed Description

2D U-shaped cavity: thick rectangular frame with the top (+y) side open.

Parameters (createGeomObject): x0, y0, x1, y1, t, z — outer axis-aligned box [x0,x1]×[y0,y1] in the plane z = const, wall thickness t. Requires x1 − x0 > 2t, y1 − y0 > 2t, t > 0.

The polygon uses only horizontal/vertical edges: the top of each side wall at the opening is flat at y = y1 (not diagonal to the inner corner).

Definition at line 30 of file openRectChannel2D.h.

Constructor & Destructor Documentation

◆ OpenRectChannel2D() [1/3]

geom::OpenRectChannel2D::OpenRectChannel2D ( )

Definition at line 49 of file openRectChannel2D.cpp.

50 : GeomObject("open_rect_channel_2d", "") {
51}
GeomObject(std::string name="", std::string description="")
Constructor.

◆ OpenRectChannel2D() [2/3]

geom::OpenRectChannel2D::OpenRectChannel2D ( double  x0,
double  y0,
double  x1,
double  y1,
double  t,
double  z,
std::string  description = "" 
)

Definition at line 53 of file openRectChannel2D.cpp.

55 : GeomObject("open_rect_channel_2d", std::move(description)),
56 d_x0(x0),
57 d_y0(y0),
58 d_x1(x1),
59 d_y1(y1),
60 d_t(t),
61 d_z(z) {
62 validateParams(x0, y0, x1, y1, t);
64}
void validateParams(double x0, double y0, double z0, double x1, double y1, double z1, double t, int open_face)

References buildVertices().

Here is the call graph for this function:

◆ OpenRectChannel2D() [3/3]

geom::OpenRectChannel2D::OpenRectChannel2D ( const OpenRectChannel2D other)

Definition at line 66 of file openRectChannel2D.cpp.

67 : GeomObject(other.d_name, other.d_description),
68 d_x0(other.d_x0),
69 d_y0(other.d_y0),
70 d_x1(other.d_x1),
71 d_y1(other.d_y1),
72 d_t(other.d_t),
73 d_z(other.d_z),
74 d_vertices(other.d_vertices),
75 d_x(other.d_x) {
76 d_tags = other.d_tags;
77}
std::vector< std::string > d_tags
Tags/attributes about the object.
std::vector< util::Point > d_vertices
CCW boundary of the U-shaped solid (10 vertices, uniform thickness t).
util::Point d_x
Area centroid of the polygon (same convention as d_x on other GeomObjects).

References geom::GeomObject::d_tags.

Member Function Documentation

◆ boundingRadius()

double geom::OpenRectChannel2D::boundingRadius ( ) const
overridevirtual

Computes the radius of smallest circle/sphere such that object can be fit into it.

Returns
Radius Radius of bounding circle/sphere

Reimplemented from geom::GeomObject.

Definition at line 217 of file openRectChannel2D.cpp.

217 {
218 const util::Point &c = d_x;
219 double r = 0.;
220 for (const auto &v : d_vertices)
221 r = std::max(r, (v - c).length());
222 return r;
223}
T max(const std::vector< T > &data)
Returns the maximum from list of data.
Definition vecMethods.h:74
A structure to represent 3d vectors.
Definition point.h:30

References d_vertices, and d_x.

◆ box() [1/2]

std::pair< util::Point, util::Point > geom::OpenRectChannel2D::box ( ) const
overridevirtual

Computes the bounding box of object.

Returns
Pair Left-bottom-back and right-top-front corner points of box

Reimplemented from geom::GeomObject.

Definition at line 193 of file openRectChannel2D.cpp.

193 {
194 return box(0.);
195}
std::pair< util::Point, util::Point > box() const override
Computes the bounding box of object.

References box().

Referenced by box(), isNear(), and isNear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ box() [2/2]

std::pair< util::Point, util::Point > geom::OpenRectChannel2D::box ( const double &  tol) const
overridevirtual

Computes the bounding box of object.

Parameters
tolTolerance/padding used in creating bounding box
Returns
Pair Left-bottom-back and right-top-front corner points of box

Reimplemented from geom::GeomObject.

Definition at line 197 of file openRectChannel2D.cpp.

197 {
198 util::Point lo(std::numeric_limits<double>::max(), std::numeric_limits<double>::max(),
199 std::numeric_limits<double>::max());
200 util::Point hi(-std::numeric_limits<double>::max(), -std::numeric_limits<double>::max(),
201 -std::numeric_limits<double>::max());
202 for (const auto &v : d_vertices) {
203 lo.d_x = std::min(lo.d_x, v.d_x);
204 lo.d_y = std::min(lo.d_y, v.d_y);
205 lo.d_z = std::min(lo.d_z, v.d_z);
206 hi.d_x = std::max(hi.d_x, v.d_x);
207 hi.d_y = std::max(hi.d_y, v.d_y);
208 hi.d_z = std::max(hi.d_z, v.d_z);
209 }
210 return {lo - tol, hi + tol};
211}

References d_vertices, util::Point::d_x, util::Point::d_y, and util::Point::d_z.

◆ buildVertices()

void geom::OpenRectChannel2D::buildVertices ( )

Definition at line 94 of file openRectChannel2D.cpp.

94 {
95 const double x0 = d_x0, y0 = d_y0, x1 = d_x1, y1 = d_y1, t = d_t, z = d_z;
96 d_vertices.clear();
97 d_vertices.reserve(10);
98 // CCW boundary of U-shaped solid with uniform wall thickness t everywhere: bottom slab
99 // [x0,x1]×[y0,y0+t], left/right columns [x0,x0+t]×[y0+t,y1] and [x1-t,x1]×[y0+t,y1]. Cavity
100 // (x0+t,x1-t)×(y0+t,y1) open at +y. Flat tops at y=y1 on each side wall.
101 d_vertices.push_back({x0, y0, z});
102 d_vertices.push_back({x1, y0, z});
103 d_vertices.push_back({x1, y1, z});
104 d_vertices.push_back({x1 - t, y1, z});
105 d_vertices.push_back({x1 - t, y1 - t, z});
106 d_vertices.push_back({x1 - t, y0 + t, z});
107 d_vertices.push_back({x0 + t, y0 + t, z});
108 d_vertices.push_back({x0 + t, y1 - t, z});
109 d_vertices.push_back({x0 + t, y1, z});
110 d_vertices.push_back({x0, y1, z});
112}
util::Point polygonCentroid2D() const

References d_t, d_vertices, d_x, d_x0, d_x1, d_y0, d_y1, d_z, and polygonCentroid2D().

Referenced by OpenRectChannel2D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ center()

util::Point geom::OpenRectChannel2D::center ( ) const
overridevirtual

Computes the center of object.

Returns
Point Coordinates of center

Reimplemented from geom::GeomObject.

Definition at line 191 of file openRectChannel2D.cpp.

191{ return d_x; }

References d_x.

◆ doesIntersect() [1/2]

bool geom::OpenRectChannel2D::doesIntersect ( const std::pair< util::Point, util::Point > &  box) const
overridevirtual

Checks if box intersects this object.

Parameters
boxBox
Returns
True True if intersects

Reimplemented from geom::GeomObject.

Definition at line 278 of file openRectChannel2D.cpp.

278 {
279 for (auto p : geom::getCornerPoints(2, bx))
280 if (this->isInside(p))
281 return true;
282 return false;
283}
bool isInside(const util::Point &x) const override
Checks if point is inside this object.
std::vector< util::Point > getCornerPoints(size_t dim, const std::pair< util::Point, util::Point > &box)
Returns all corner points in the box.

References geom::getCornerPoints(), and isInside().

Here is the call graph for this function:

◆ doesIntersect() [2/2]

bool geom::OpenRectChannel2D::doesIntersect ( const util::Point x) const
overridevirtual

Checks if point lies exactly on the boundary.

Parameters
xPoint
Returns
True True if it lies on the boundary

Reimplemented from geom::GeomObject.

Definition at line 254 of file openRectChannel2D.cpp.

254 {
255 return isNearBoundary(x, 1.0e-8, false);
256}
bool isNearBoundary(const util::Point &x, const double &tol, const bool &within) const override
Checks if point is within given distance of this object.

References isNearBoundary().

Here is the call graph for this function:

◆ inscribedRadius()

double geom::OpenRectChannel2D::inscribedRadius ( ) const
overridevirtual

Computes the radius of biggest circle/sphere completely within the object.

Returns
Radius Radius of inscribed circle/sphere

Reimplemented from geom::GeomObject.

Definition at line 213 of file openRectChannel2D.cpp.

213 {
214 return 0.5 * d_t;
215}

References d_t.

◆ isInside() [1/2]

bool geom::OpenRectChannel2D::isInside ( const std::pair< util::Point, util::Point > &  box) const
overridevirtual

Checks if box is completely inside.

Parameters
boxBox
Returns
True True if box lies inside

Reimplemented from geom::GeomObject.

Definition at line 258 of file openRectChannel2D.cpp.

258 {
259 for (auto p : geom::getCornerPoints(2, bx))
260 if (!this->isInside(p))
261 return false;
262 return true;
263}

References geom::getCornerPoints(), and isInside().

Here is the call graph for this function:

◆ isInside() [2/2]

bool geom::OpenRectChannel2D::isInside ( const util::Point x) const
overridevirtual

Checks if point is inside this object.

Parameters
xPoint
Returns
True If point lies inside

Reimplemented from geom::GeomObject.

Definition at line 225 of file openRectChannel2D.cpp.

225 {
226 if (std::abs(x.d_z - d_z) > 1.0e-9)
227 return false;
228 return pointInPolygon2D(x);
229}
bool pointInPolygon2D(const util::Point &p) const
double d_z
the z coordinate
Definition point.h:39

References d_z, util::Point::d_z, and pointInPolygon2D().

Referenced by doesIntersect(), isInside(), isOutside(), and isOutside().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isNear() [1/2]

bool geom::OpenRectChannel2D::isNear ( const std::pair< util::Point, util::Point > &  box,
const double &  tol 
) const
overridevirtual

Checks if box is within given distance of this object.

Parameters
boxBox
tolTolerance used in checking the nearness
Returns
True True if box is inside within the tol distance

Reimplemented from geom::GeomObject.

Definition at line 273 of file openRectChannel2D.cpp.

274 {
275 return geom::areBoxesNear(this->box(), bx, tol, 2);
276}
bool areBoxesNear(const std::pair< util::Point, util::Point > &b1, const std::pair< util::Point, util::Point > &b2, const double &tol, size_t dim)
Checks if given two boxes are within given distance from each other.

References geom::areBoxesNear(), and box().

Here is the call graph for this function:

◆ isNear() [2/2]

bool geom::OpenRectChannel2D::isNear ( const util::Point x,
const double &  tol 
) const
overridevirtual

Checks if point is within given distance of this object.

Parameters
xPoint
tolTolerance used in checking the nearness
Returns
True True if within the tol distance

Reimplemented from geom::GeomObject.

Definition at line 235 of file openRectChannel2D.cpp.

235 {
236 auto bbox = box(tol);
237 return geom::isPointInsideBox(x, 2, bbox);
238}
bool isPointInsideBox(util::Point x, size_t dim, const std::pair< util::Point, util::Point > &box)
Returns true if point is inside box.

References box(), and geom::isPointInsideBox().

Referenced by isNearBoundary().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isNearBoundary()

bool geom::OpenRectChannel2D::isNearBoundary ( const util::Point x,
const double &  tol,
const bool &  within 
) const
overridevirtual

Checks if point is within given distance of this object.

Parameters
xPoint
tolTolerance used in checking the nearness
withinCheck if the point is within (inside) the object
Returns
True True if it is near within tol distance

Reimplemented from geom::GeomObject.

Definition at line 240 of file openRectChannel2D.cpp.

241 {
242 if (!isNear(x, within ? 0. : tol))
243 return false;
244 const size_t n = d_vertices.size();
245 for (size_t i = 0; i < n; ++i) {
246 const util::Point &a = d_vertices[i];
247 const util::Point &b = d_vertices[(i + 1) % n];
248 if (util::isLess(distPointToSegment2D(x, a, b), tol))
249 return true;
250 }
251 return false;
252}
bool isNear(const util::Point &x, const double &tol) const override
Checks if point is within given distance of this object.
double distPointToSegment2D(const util::Point &p, const util::Point &a, const util::Point &b)
bool isLess(const double &a, const double &b)
Returns true if a < b.
Definition function.cpp:20

References d_vertices, util::isLess(), and isNear().

Referenced by doesIntersect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isOutside() [1/2]

bool geom::OpenRectChannel2D::isOutside ( const std::pair< util::Point, util::Point > &  box) const
overridevirtual

Checks if box is outside of the object.

Parameters
boxBox
Returns
True True if box lies outside

Reimplemented from geom::GeomObject.

Definition at line 265 of file openRectChannel2D.cpp.

265 {
266 bool intersect = false;
267 for (auto p : geom::getCornerPoints(2, bx))
268 if (!intersect)
269 intersect = this->isInside(p);
270 return !intersect;
271}

References geom::getCornerPoints(), and isInside().

Here is the call graph for this function:

◆ isOutside() [2/2]

bool geom::OpenRectChannel2D::isOutside ( const util::Point x) const
overridevirtual

Checks if point is outside of this object.

Parameters
xPoint
Returns
True If point lies outside

Reimplemented from geom::GeomObject.

Definition at line 231 of file openRectChannel2D.cpp.

231 {
232 return !isInside(x);
233}

References isInside().

Here is the call graph for this function:

◆ operator=()

OpenRectChannel2D & geom::OpenRectChannel2D::operator= ( const OpenRectChannel2D other)

Definition at line 79 of file openRectChannel2D.cpp.

79 {
80 if (this != &other) {
81 d_tags = other.d_tags;
82 d_x0 = other.d_x0;
83 d_y0 = other.d_y0;
84 d_x1 = other.d_x1;
85 d_y1 = other.d_y1;
86 d_t = other.d_t;
87 d_z = other.d_z;
88 d_vertices = other.d_vertices;
89 d_x = other.d_x;
90 }
91 return *this;
92}
double d_x
the x coordinate
Definition point.h:33

References d_t, geom::GeomObject::d_tags, d_vertices, d_x, d_x0, d_x1, d_y0, d_y1, and d_z.

◆ pointInPolygon2D()

bool geom::OpenRectChannel2D::pointInPolygon2D ( const util::Point p) const
private

Definition at line 114 of file openRectChannel2D.cpp.

114 {
115 const auto &v = d_vertices;
116 if (v.size() < 3)
117 return false;
118 bool c = false;
119 const size_t n = v.size();
120 for (size_t i = 0, j = n - 1; i < n; j = i++) {
121 const double xi = v[i].d_x, yi = v[i].d_y;
122 const double xj = v[j].d_x, yj = v[j].d_y;
123 if (((yi > p.d_y) != (yj > p.d_y)) &&
124 (p.d_x < (xj - xi) * (p.d_y - yi) / (yj - yi + 1.0e-30) + xi))
125 c = !c;
126 }
127 return c;
128}
double d_y
the y coordinate
Definition point.h:36

References d_vertices, util::Point::d_x, and util::Point::d_y.

Referenced by isInside().

Here is the caller graph for this function:

◆ polygonArea2D()

double geom::OpenRectChannel2D::polygonArea2D ( ) const
private

Definition at line 130 of file openRectChannel2D.cpp.

130 {
131 const auto &v = d_vertices;
132 if (v.size() < 3)
133 return 0.;
134 double a = 0.;
135 const size_t n = v.size();
136 for (size_t i = 0; i < n; ++i) {
137 const size_t j = (i + 1) % n;
138 a += v[i].d_x * v[j].d_y - v[j].d_x * v[i].d_y;
139 }
140 return 0.5 * std::abs(a);
141}

References d_vertices.

Referenced by volume().

Here is the caller graph for this function:

◆ polygonCentroid2D()

util::Point geom::OpenRectChannel2D::polygonCentroid2D ( ) const
private

Definition at line 143 of file openRectChannel2D.cpp.

143 {
144 const auto &v = d_vertices;
145 if (v.size() < 3)
146 return {};
147 double cx = 0., cy = 0.;
148 double a = 0.;
149 const size_t n = v.size();
150 for (size_t i = 0; i < n; ++i) {
151 const size_t j = (i + 1) % n;
152 const double cross = v[i].d_x * v[j].d_y - v[j].d_x * v[i].d_y;
153 a += cross;
154 cx += (v[i].d_x + v[j].d_x) * cross;
155 cy += (v[i].d_y + v[j].d_y) * cross;
156 }
157 if (std::abs(a) < 1.0e-30)
158 return {(v[0].d_x + v[1].d_x) * 0.5, (v[0].d_y + v[1].d_y) * 0.5, v[0].d_z};
159 a *= 0.5;
160 return {cx / (6. * a), cy / (6. * a), v[0].d_z};
161}

References d_vertices, and util::Point::d_x.

Referenced by buildVertices(), and transform().

Here is the caller graph for this function:

◆ print() [1/2]

void geom::OpenRectChannel2D::print ( ) const
inlineoverridevirtual

Prints the information about the object.

Reimplemented from geom::GeomObject.

Definition at line 78 of file openRectChannel2D.h.

78{ print(0, 0); };
void print() const override
Prints the information about the object.

References print().

Referenced by print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [2/2]

void geom::OpenRectChannel2D::print ( int  nt = 0,
int  lvl = 0 
) const
inlineoverridevirtual

Prints the information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)

Reimplemented from geom::GeomObject.

Definition at line 77 of file openRectChannel2D.h.

77{ std::cout << printStr(nt, lvl); };
std::string printStr(int nt=0, int lvl=0) const override
Returns the string containing printable information about the object.

References printStr().

Here is the call graph for this function:

◆ printStr()

std::string geom::OpenRectChannel2D::printStr ( int  nt = 0,
int  lvl = 0 
) const
overridevirtual

Returns the string containing printable information about the object.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)
Returns
string String containing printable information about the object

Reimplemented from geom::GeomObject.

Definition at line 285 of file openRectChannel2D.cpp.

285 {
286 auto tabS = util::io::getTabS(nt);
287 std::ostringstream oss;
288 oss << tabS << "------- OpenRectChannel2D (U-channel, open +y) --------" << std::endl;
289 oss << tabS << "Outer box: [" << d_x0 << "," << d_y0 << "] — [" << d_x1 << "," << d_y1 << "], z="
290 << d_z << ", t=" << d_t << std::endl;
291 if (lvl > 0)
292 oss << tabS << "Vertices = " << util::io::printStr(d_vertices, 0) << std::endl;
293 return oss.str();
294}
std::string getTabS(int nt)
Returns tab spaces of a given size.
Definition io.h:39
std::string printStr(const T &msg, int nt=print_default_tab)
Returns formatted string for output.
Definition io.h:53

References d_t, d_vertices, d_x0, d_x1, d_y0, d_y1, d_z, util::io::getTabS(), and util::io::printStr().

Referenced by print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transform()

void geom::OpenRectChannel2D::transform ( const util::Point translation,
const double &  scale,
const double &  angle,
const util::Point axis,
const util::Point rotationPoint 
)
overridevirtual

Similarity about pivot \(\mathbf p\) (default: old center d_x), then rigid displacement \(\mathbf t\) = translation: \(\mathbf y = \mathbf p + s\,\mathbf R(\mathbf x-\mathbf p) + \mathbf t\). When \(\theta=0\) and \(s=1\), \(\mathbf y = \mathbf x + \mathbf t\) for every point and the center.

Parameters
translationRigid translation vector \(\mathbf t\) (added after rotate+scale about \(\mathbf p\))
scaleUniform scale factor
angleRotation angle (radians)
axisAxis of rotation
rotationPointIf non-null, use as \(\mathbf p\); if null, use old d_x as pivot.

Reimplemented from geom::GeomObject.

Definition at line 163 of file openRectChannel2D.cpp.

165 {
166 // Default pivot: cached centroid `d_x` (same as other geoms). Matches demModel when it passes
167 // p_geom->center().
168 const util::Point pivot = rotationPoint != nullptr ? *rotationPoint : d_x;
169 d_t *= scale;
170 // Same map as geom::mapSimilarity: p + s R(x-p) + t
171 for (auto &v : d_vertices) {
172 v = pivot + util::rotate(v - pivot, angle, axis) * scale + translation;
173 }
174 d_x0 = d_x1 = d_vertices[0].d_x;
175 d_y0 = d_y1 = d_vertices[0].d_y;
176 d_z = d_vertices[0].d_z;
177 for (const auto &v : d_vertices) {
178 d_x0 = std::min(d_x0, v.d_x);
179 d_x1 = std::max(d_x1, v.d_x);
180 d_y0 = std::min(d_y0, v.d_y);
181 d_y1 = std::max(d_y1, v.d_y);
182 d_z = v.d_z;
183 }
185}
util::Point rotate(const util::Point &p, const double &theta, const util::Point &axis)
Returns the vector after rotating by desired angle.

References d_t, d_vertices, d_x, util::Point::d_x, d_x0, d_x1, d_y0, d_y1, d_z, polygonCentroid2D(), and util::rotate().

Here is the call graph for this function:

◆ volume()

double geom::OpenRectChannel2D::volume ( ) const
overridevirtual

Computes the volume (area in 2d, length in 1d) of object.

Returns
Volume Volume of object

Reimplemented from geom::GeomObject.

Definition at line 187 of file openRectChannel2D.cpp.

187 {
188 return polygonArea2D();
189}

References polygonArea2D().

Here is the call graph for this function:

Field Documentation

◆ d_t

double geom::OpenRectChannel2D::d_t = 0.

Definition at line 36 of file openRectChannel2D.h.

Referenced by buildVertices(), inscribedRadius(), operator=(), printStr(), and transform().

◆ d_vertices

std::vector<util::Point> geom::OpenRectChannel2D::d_vertices

◆ d_x

util::Point geom::OpenRectChannel2D::d_x

Area centroid of the polygon (same convention as d_x on other GeomObjects).

Definition at line 42 of file openRectChannel2D.h.

Referenced by boundingRadius(), buildVertices(), center(), operator=(), and transform().

◆ d_x0

double geom::OpenRectChannel2D::d_x0 = 0.

◆ d_x1

double geom::OpenRectChannel2D::d_x1 = 0.

◆ d_y0

double geom::OpenRectChannel2D::d_y0 = 0.

◆ d_y1

double geom::OpenRectChannel2D::d_y1 = 0.

◆ d_z

double geom::OpenRectChannel2D::d_z = 0.

Definition at line 37 of file openRectChannel2D.h.

Referenced by buildVertices(), isInside(), operator=(), printStr(), and transform().


The documentation for this class was generated from the following files: