uint Printlines::divideline(uint lineindex, const vector<Vector2d> points) { vector<PLine> newlines; PLine l = lines[lineindex]; for (int i = -1; i < (int)points.size(); i++) { Vector2d from, to; if (i < 0) from = l.from; else from = points[i]; if (i > (int)points.size()-2) to = l.to; else to = points[i+1]; newlines.push_back(PLine(from, to, l.speed, l.feedrate)); } if (newlines.size() > 0 && lines.size() > lineindex) { //cerr << newlines.size() << " new lines" << endl; lines.erase(lines.begin()+lineindex); lines.insert(lines.begin()+lineindex, newlines.begin(), newlines.end()); return newlines.size()-1; // return how many more lines now } return 0; }
void qline_( float *x1 , float *y1 , float *x2 , float *y2 ) { PLine( *x1 , *y1 , *x2 , *y2 ); }
static void Pdrawline3d(float x0, float y0, float z0, float x1, float y1, float z1, long col) { lines.push_back(PLine(1024-y0, 1024-x0, 256-z0, 1024-y1, 1024-x1, 256-z1, col)); }