|
V3FIT
|
34 if (this->
next !=
nullptr) {
79 return (norm_vector2 + norm_vector1)/2.0;
134 const double a_value =
a(v1, v2);
135 const double b_value =
b(v1, v2);
136 return (b_value*(b_value*p.x - a_value*p.y) - a_value*
c(v1, v2))/(a_value*a_value + b_value*b_value);
150 const double a_value =
a(v1, v2);
151 const double b_value =
b(v1, v2);
152 return (a_value*(-b_value*p.x + a_value*p.y) - b_value*
c(v1, v2))/(a_value*a_value + b_value*b_value);
166 const double a_value =
a(v1, v2);
167 const double b_value =
b(v1, v2);
168 return fabs(a_value*p.x + b_value*p.y +
c(v1, v2))/sqrt(a_value*a_value + b_value*b_value);
181 return (v.point - p).length();
226 for (
vertex *v = start; v->next != start; v = v->next) {
227 const double x =
x_min(*v, *(v->next), p);
228 const double y =
y_min(*v, *(v->next), p);
229 if (
in_range(*v, *(v->next), x, y)) {
239 const double x =
x_min(*(start->
last), *start, p);
240 const double y =
y_min(*(start->
last), *start, p);
258 std::cout << start->
point.
x <<
" " << start->
point.
y << std::endl;
259 for (
vertex *v = start->
next; v != start; v = v->next) {
260 std::cout << v->point.x <<
" " << v->point.y << std::endl;
static const double y_min(const vertex &v1, const vertex &v2, const vector3d &p)
Minimum distance in the y direction.
vertex * next
Vertex next vertex.
static void print(vertex *start)
Print out all vertices.
static const double a(const vertex &v1, const vertex &v2)
a coefficient.
static const double b(const vertex &v1, const vertex &v2)
b coefficient.
const vector3d point
Vertex point.
static const double direction(const vertex &v, const vector3d &n, const vector3d &p)
Finds which side of the limiter face the point is on.
const double x
x component.
vertex(const vector3d point_)
vertex constructor.
static const double dot_product(const vector3d &v1, const vector3d &v2)
Takes the doc product of two vectors.
~vertex()
vertex destructor.
static const double length(const vertex &v1, const vertex &v2, const vector3d &p)
Distance to a limiter face.
const vector3d normalize() const
Normalize vector3d instance.
static const vector3d get_normal(const vertex &v1, const vertex &v2)
Normal to a line.
static const bool in_range(const vertex &v1, const vertex &v2, const double x, const double y)
Finds if the line to the point is in range.
static const double c(const vertex &v1, const vertex &v2)
c coefficient.
static void distance(vertex *start, const vector3d &p, std::vector< double > &d)
Find the distances to the limiter.
vertex * last
Vertex last vertex.
static const double x_min(const vertex &v1, const vertex &v2, const vector3d &p)
Minimum distance in the x direction.
const double y
y component.
void insert(vertex *v)
Insert a new vertex.