#include "split.h"
#include "coutln.h"
#include "tprintf.h"
#include <algorithm>
Go to the source code of this file.
◆ make_edgept()
Definition at line 139 of file split.cpp.
139 {
141
143 this_edgept->
pos.
x = x;
144 this_edgept->
pos.
y = y;
145
147 if (prev_ol !=
nullptr && prev->
next == next) {
148
151 double cut_fraction = target_vec.length() / segment_vec.length();
152
157 ICOORD step_vec = step_end - step_start;
158 double target_length = step_vec.
length() * cut_fraction;
159
162 double best_dist = target_length;
163 for (
int s = prev->
start_step; s < end_step; ++s) {
164 total_step += prev_ol->
step(s % step_length);
165 double dist = fabs(target_length - total_step.length());
166 if (dist < best_dist) {
167 best_dist = dist;
168 best_step = s + 1;
169 }
170 }
171
173 this_edgept->
step_count = end_step - best_step;
174 this_edgept->
start_step = best_step % step_length;
176 } else {
177
181 }
182
183 this_edgept->
next = next;
184 this_edgept->
prev = prev;
185 prev->
next = this_edgept;
186 next->
prev = this_edgept;
187
192 return this_edgept;
193}
ICOORD step(int index) const
ICOORD position_at_index(int index) const
int32_t pathlength() const
float length() const
find length
◆ remove_edgept()
void remove_edgept |
( |
EDGEPT * |
point | ) |
|
Definition at line 200 of file split.cpp.
200 {
203
206 }
211 delete point;
212}
◆ kBadPriority
const double kBadPriority = 999.0 |
◆ kCenterGradeCap
const int kCenterGradeCap = 25 |
◆ wordrec_display_splits
bool wordrec_display_splits = 0 |
"Display splits"
Definition at line 41 of file split.cpp.