mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
Some more work on wireframe
This commit is contained in:
@@ -491,6 +491,12 @@ GCodeWriter::unlift()
|
||||
return gcode;
|
||||
}
|
||||
|
||||
Pointf3
|
||||
GCodeWriter::get_position() const
|
||||
{
|
||||
return this->_pos;
|
||||
}
|
||||
|
||||
#ifdef SLIC3RXS
|
||||
REGISTER_CLASS(GCodeWriter, "GCode::Writer");
|
||||
#endif
|
||||
|
||||
@@ -45,6 +45,7 @@ class GCodeWriter {
|
||||
std::string unretract();
|
||||
std::string lift();
|
||||
std::string unlift();
|
||||
Pointf3 get_position() const;
|
||||
|
||||
private:
|
||||
std::string _extrusion_axis;
|
||||
|
||||
@@ -161,10 +161,15 @@ Point::ccw(const Line &line) const
|
||||
}
|
||||
|
||||
// returns the CCW angle between this-p1 and this-p2
|
||||
// i.e. this assumes a CCW rotation from p1 to p2 around this
|
||||
double
|
||||
Point::ccw_angle(const Point &p1, const Point &p2) const
|
||||
{
|
||||
return Line(*this, p1).orientation() - Line(*this, p2).orientation();
|
||||
double angle = atan2(p1.x - this->x, p1.y - this->y)
|
||||
- atan2(p2.x - this->x, p2.y - this->y);
|
||||
|
||||
// we only want to return only positive angles
|
||||
return angle <= 0 ? angle + 2*PI : angle;
|
||||
}
|
||||
|
||||
Point
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
std::string unretract();
|
||||
std::string lift();
|
||||
std::string unlift();
|
||||
Clone<Pointf3> get_position() const;
|
||||
%{
|
||||
|
||||
SV*
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
%code{% RETVAL = THIS->distance_to(*line); %};
|
||||
double ccw(Point* p1, Point* p2)
|
||||
%code{% RETVAL = THIS->ccw(*p1, *p2); %};
|
||||
double ccw_angle(Point* p1, Point* p2)
|
||||
%code{% RETVAL = THIS->ccw_angle(*p1, *p2); %};
|
||||
Clone<Point> projection_onto_polygon(Polygon* polygon)
|
||||
%code{% RETVAL = new Point(THIS->projection_onto(*polygon)); %};
|
||||
Clone<Point> projection_onto_polyline(Polyline* polyline)
|
||||
|
||||
Reference in New Issue
Block a user