10#ifndef GEOM_OPEN_RECT_CHANNEL_2D_H
11#define GEOM_OPEN_RECT_CHANNEL_2D_H
47 std::string description =
"");
58 double volume()
const override;
60 std::pair<util::Point, util::Point>
box()
const override;
61 std::pair<util::Point, util::Point>
box(
const double &tol)
const override;
71 bool isInside(
const std::pair<util::Point, util::Point> &bx)
const override;
72 bool isOutside(
const std::pair<util::Point, util::Point> &bx)
const override;
73 bool isNear(
const std::pair<util::Point, util::Point> &bx,
const double &tol)
const override;
74 bool doesIntersect(
const std::pair<util::Point, util::Point> &bx)
const override;
76 std::string
printStr(
int nt = 0,
int lvl = 0)
const override;
77 void print(
int nt = 0,
int lvl = 0)
const override { std::cout <<
printStr(nt, lvl); };
Defines abstract geometrical domain.
2D U-shaped cavity: thick rectangular frame with the top (+y) side open.
std::pair< util::Point, util::Point > box() const override
Computes the bounding box of object.
bool pointInPolygon2D(const util::Point &p) const
bool isInside(const util::Point &x) const override
Checks if point is inside this object.
double inscribedRadius() const override
Computes the radius of biggest circle/sphere completely within the object.
util::Point center() const override
Computes the center of object.
util::Point polygonCentroid2D() const
OpenRectChannel2D & operator=(const OpenRectChannel2D &other)
void transform(const util::Point &translation, const double &scale, const double &angle, const util::Point &axis, const util::Point *rotationPoint) override
Similarity about pivot (default: old center d_x), then rigid displacement = translation: ....
std::vector< util::Point > d_vertices
CCW boundary of the U-shaped solid (10 vertices, uniform thickness t).
std::string printStr(int nt=0, int lvl=0) const override
Returns the string containing printable information about the object.
void print() const override
Prints the information about the object.
bool doesIntersect(const util::Point &x) const override
Checks if point lies exactly on the boundary.
bool isOutside(const util::Point &x) const override
Checks if point is outside 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.
double boundingRadius() const override
Computes the radius of smallest circle/sphere such that object can be fit into it.
double polygonArea2D() const
util::Point d_x
Area centroid of the polygon (same convention as d_x on other GeomObjects).
void print(int nt=0, int lvl=0) const override
Prints the information about the object.
bool isNear(const util::Point &x, const double &tol) const override
Checks if point is within given distance of this object.
double volume() const override
Computes the volume (area in 2d, length in 1d) of object.
A structure to represent 3d vectors.