API Documentation¶
To Document¶
-
class AlignedEllipse : public ocl::Ellipse¶
an aligned ellipse, used by the edgePush function of BullCutter
Public Functions
-
AlignedEllipse(Point ¢erin, double major_length, double minor_length, double offset, Point &majorDir, Point &minorDir)¶
create an aligned ellipse
-
virtual Point normal(const EllipsePosition &position) const¶
normal vector at given EllipsePosition
-
virtual Point ePoint(const EllipsePosition &position) const¶
ellipse-point at given EllipsePosition
-
virtual Point oePoint(const EllipsePosition &pos) const¶
offset-ellipse point at given EllipsePosition
-
virtual double error(double dia) const¶
error-function for the solver
-
AlignedEllipse(Point ¢erin, double major_length, double minor_length, double offset, Point &majorDir, Point &minorDir)¶
-
class Arc¶
a finite arc segment in 3D space specified by its end points (p1, p2)
Public Functions
-
Arc(const Point &p1, const Point &p2, const Point &c, bool dir)¶
create an arc from point p1 to point p2 with center c and direction dir. direction is true for anti-clockwise arcs.
-
inline double length2d() const¶
return the length of the arc
Public Members
-
bool dir¶
direction true for anti-clockwise
-
Arc(const Point &p1, const Point &p2, const Point &c, bool dir)¶
-
class Bbox¶
axis-aligned bounding-box
Public Functions
-
Bbox()¶
default constructor
-
Bbox(double b1, double b2, double b3, double b4, double b5, double b6)¶
explicit constructor
-
double operator[](const unsigned int idx) const¶
index into maxpt and minpt returning a vector [minx maxx miny maxy minz maxz]
-
bool overlaps(const Bbox &other) const¶
return true if *this overlaps Bbox b
does this Bbox overlap with b?
-
Bbox()¶
-
class CCPoint : public ocl::Point¶
Cutter-Contact (CC) point. A Point with a CCType.
Cutter-Contact (CC) Point. A Point which also contains the type of cutter-contact.
Public Functions
-
std::string str() const¶
string repr
Public Members
-
CCType type¶
specifies the type of the Cutter Contact point.
-
std::string str() const¶
-
class CLFilter¶
CL point filter virtual base class.
Subclassed by ocl::LineCLFilter
-
class CLPoint : public ocl::Point¶
Cutter-Location (CL) point.
Public Functions
-
std::string str() const¶
string repr
-
bool liftZ_if_InsidePoints(double z, CCPoint &cc_tmp, const Point &p1, const Point &p2)¶
if cc is in the edge p1-p2, test if clpoint needs to be lifted to z if so, set cc = cc_tmp and return true
-
std::string str() const¶
-
class Ellipse¶
An Ellipse.
Subclassed by ocl::AlignedEllipse
Public Functions
-
inline Ellipse()¶
dummy constructor
-
Ellipse(Point ¢erin, double a, double b, double offset)¶
create an Ellipse with centerpoint center, X-axis a, Y-axis b, and offset distance offset.
-
virtual Point ePoint(const EllipsePosition &position) const¶
return a point on the ellipse at given EllipsePosition
-
virtual Point oePoint(const EllipsePosition &position) const¶
return a point on the offset-ellipse at given EllipsePosition
-
virtual Point normal(const EllipsePosition &position) const¶
return a normalized normal vector of the ellipse at the given EllipsePosition
-
int solver_brent()¶
offset-ellipse Brent solver
offfset-ellipse solver using Brent’s method find the EllipsePosition that makes the offset-ellipse point be at p this is a zero of Ellipse::error() returns number of iterations
called (only?) by BullCutter::singleEdgeDropCanonical()
-
void print_solutions()¶
print out the found solutions
-
bool find_EllipsePosition2()¶
given one EllipsePosition solution, find the other.
-
double error(EllipsePosition &position) const¶
error function for the solver
-
virtual double error(double dia) const¶
error function for solver
-
Point calcEcenter(const Point &up1, const Point &up2, int sln)¶
calculate ellipse center
given the two solutions EllipsePosition1 and EllipsePosition2 and the edge up1-up2 locate the ellipse center correctly
-
void setEllipsePositionHi(const Point &u1, const Point &u2)¶
set EllipsePosition_hi to either EllipsePosition1 or EllipsePosition2, depending on which has the center (given by calcEcenter() ) with higher z-coordinate
-
inline void setA(double ain)¶
set length of ellipse major axis
-
inline void setB(double bin)¶
set length of ellipse minor axis
-
inline void setOffset(double ofs)¶
set offset-ellipse offset distance
-
inline void setEccen()¶
set/calculate the eccentricity
-
inline double getCenterZ()¶
returns the z-coordinate of this->center
Public Members
-
double eccen¶
eccentricity = a/b
-
inline Ellipse()¶
-
class EllipsePosition¶
EllipsePosition defines a position in (s,t) coordinates on a unit-circle. The (s,t) pair is used to locate points on an ellipse.
s^2 + t^2 = 1 should be true at all times.
Public Functions
-
EllipsePosition()¶
create an EllipsePosition
-
inline EllipsePosition(double sin, double tin)¶
create EllipsePosition at (s,t)
-
void setDiangle(double dia)¶
set (s,t) pair to the position corresponding to diangle
-
EllipsePosition &operator=(const EllipsePosition &pos)¶
set rhs EllipsePosition (s,t) values equal to lhs EllipsePosition
-
bool isValid() const¶
return true if (s,t) is valid, i.e. lies on the unit circle checks s^2 + t^2 == 1 (to within tolerance)
-
std::string str() const¶
string repr
Public Members
-
double s¶
s-parameter in [-1, 1]
-
double t¶
t-parameter in [-1, 1]
-
double diangle¶
diamond angle parameter in [0,4] (modulo 4) this models an angle [0,2pi] and maps from the angle to an (s,t) pair using setD()
Friends
-
friend std::ostream &operator<<(std::ostream &stream, EllipsePosition pos)¶
string repr
-
EllipsePosition()¶
-
class Fiber¶
a fiber is an infinite line in space along which the cutter can be pushed into contact with a triangle. A Weave is built from many X-fibers and Y-fibers. might be called a Dexel also in some papers/textbooks.
Public Functions
-
bool missing(Interval &i) const¶
return true if Interval i is completely missing (no overlaps) from Fiber
-
void printInts() const¶
print the intervals
-
inline unsigned int size() const¶
return number of intervals
Public Members
-
bool missing(Interval &i) const¶
-
class Interval¶
interval for use by fiber and weave a parameter interval [upper, lower]
Public Types
-
typedef boost::adjacency_list_traits<boost::listS, boost::listS, boost::bidirectionalS, boost::listS>::vertex_descriptor WeaveVertex¶
intersections with other intervals are stored in this set of VertexPairs of type std::pair<VertexDescriptor, double>
-
typedef std::set<VertexPair, VertexPairCompare> VertexIntersectionSet¶
intersections stored in this set (for rapid finding of neighbors etc)
Public Functions
-
Interval(const double l, const double u)¶
create and interval [l,u] (is this ever called??)
-
void update(const double t, CCPoint &p)¶
call both updateUpper() and updateLower() with the given (t,p) pair
-
bool update_ifCCinEdgeAndTrue(double t_cl, CCPoint &cc_tmp, const Point &p1, const Point &p2, bool condition)¶
update interval with t_cl and cc_tmp if cc_tmp is in the p1-p2 edge and condition==true
-
bool empty() const¶
return true if the interval is empty
-
std::string str() const¶
string repr
-
typedef boost::adjacency_list_traits<boost::listS, boost::listS, boost::bidirectionalS, boost::listS>::vertex_descriptor WeaveVertex¶
Warning
doxygenclass: Cannot find class “ocl::VertexPairCompare” in doxygen xml output for project “opencamlib” from directory: ../src/doc/xml
-
template<class BBObj>
class KDNode¶ K-D tree node. http://en.wikipedia.org/wiki/Kd-tree.
A k-d tree is used for searching for triangles overlapping with the cutter.
Public Functions
-
inline KDNode(int d, double cv, KDNode<BBObj> *parentNode, KDNode<BBObj> *hi_child, KDNode<BBObj> *lo_child, const std::list<BBObj> *tlist, int nodeDepth)¶
Create a node which partitions(cuts) along dimension d, at cut value cv, with child-nodes hi_c and lo_c. If this is a bucket-node containing triangles, they are in the list tris depth indicates the depth of the node in the tree
-
inline std::string str() const¶
string repr
Public Members
-
int depth¶
level of node in tree
-
int dim¶
dimension of cut
-
double cutval¶
Cut value. Child node hi contains only triangles with a higher value than this. Child node lo contains triangles with lower values.
-
bool isLeaf¶
flag to indicate leaf in the tree. Leafs or bucket-nodes contain triangles in the list tris.
-
inline KDNode(int d, double cv, KDNode<BBObj> *parentNode, KDNode<BBObj> *hi_child, KDNode<BBObj> *lo_child, const std::list<BBObj> *tlist, int nodeDepth)¶
-
template<class BBObj>
class KDTree¶ a kd-tree for storing triangles and fast searching for triangles that overlap the cutter
Public Functions
-
inline void setBucketSize(int b)¶
set the bucket-size
-
inline void setXYDimensions()¶
set the search dimension to the XY-plane
-
inline void setYZDimensions()¶
set search-plane to YZ
-
inline void setXZDimensions()¶
set search plane to XZ
-
inline std::list<BBObj> *search(const Bbox &bb)¶
search for overlap with input Bbox bb, return found objects
-
inline std::list<BBObj> *search_cutter_overlap(const MillingCutter *c, CLPoint *cl)¶
search for overlap with a MillingCutter c positioned at cl, return found objects
-
std::string str() const¶
string repr
-
inline void setBucketSize(int b)¶
-
class Line¶
A finite line segment in 3D space specified by its end points (p1, p2)
Public Functions
-
double length2d() const¶
return the length of the line-segment in the xy-plane
-
double length2d() const¶
-
class LineCLFilter : public ocl::CLFilter¶
LineCLFilter takes a sequence of cutter-location (CL) points as input and produces another sequence as output.
The number of CL-points is reduced by finding co-linear points, to within a set tolerance, and deleting redundant ones.
-
class Point¶
a point or vector in 3D space specified by its coordinates (x, y, z)
Subclassed by ocl::CCPoint, ocl::CLPoint
Public Functions
-
Point()¶
create a point at (0,0,0)
-
Point(double x, double y, double z)¶
create a point at (x,y,z)
-
Point(double x, double y)¶
create a point at (x,y,0)
-
inline virtual ~Point()¶
destructor. empty.
-
double norm() const¶
norm of vector, or distance from (0,0,0) to *this
-
double xyNorm() const¶
length of vector in the XY plane
-
void xyNormalize()¶
normalize so that length xyNorm == 1.0
-
void z_projectOntoEdge(const Point &p1, const Point &p2)¶
move *this along z-axis so it lies on p1-p2 line-segment
-
void xyRotate(double cosa, double sina)¶
rotate point in the xy-plane by angle theta inputs are cos(theta) and sin(theta)
-
void xyRotate(double angle)¶
rotate point in xy-plane bu angle theta (radians or degrees??)
-
void xRotate(double theta)¶
rotate around x-axis
-
void yRotate(double theta)¶
rotate around y-axis
-
void zRotate(double theta)¶
rotate around z-axis
-
double xyDistanceToLine(const Point &p1, const Point &p2) const¶
distance from Point to infinite line through p1 and p2. In the XY plane.
-
Point closestPoint(const Point &p1, const Point &p2) const¶
return closest Point to line through p1 and p2. in 3D.
return Point on p1-p2 line which is closest in 3D to this.
-
Point xyClosestPoint(const Point &p1, const Point &p2) const¶
return closest Point to line through p1 and p2. Works in the XY plane.
return Point on p1-p2 line which is closest in XY-plane to this
-
bool isRight(const Point &p1, const Point &p2) const¶
returns true if point is right of line through p1 and p2 (works in the XY-plane)
-
bool isInside(const Point &p1, const Point &p2) const¶
return true if Point within line segment p1-p2
-
bool xParallel() const¶
return true if the x and y components are both zero.
-
bool yParallel() const¶
return true if vector parallel to y-axis
-
bool zParallel() const¶
return true if vector parallel to z-axis
-
std::string str() const¶
string repr
-
Point()¶
-
class Span¶
A finite curve which returns Point objects along its length.
location along span is based on a parameter t for which 0 <= t <= 1.0
Subclassed by ocl::ArcSpan, ocl::LineSpan
-
class Spread¶
KDTree spread, a measure of how spread-out a list of triangles are.
simple struct-like class for storing the “spread” or maximum extent of a list of triangles. Used by the kd-tree algorithm.
Public Functions
-
inline Spread(int dim, double v, double s)¶
constructor
-
inline Spread(int dim, double v, double s)¶
-
class STLSurf¶
STL surface, essentially an unordered list of Triangle objects.
STL surfaces consist of triangles. There is by definition no structure or order among the triangles, i.e. they can be positioned or connected in arbitrary ways.
Public Functions
-
inline STLSurf()¶
Create an empty STL-surface.
-
inline virtual ~STLSurf()¶
destructor
-
unsigned int size() const¶
return number of triangles in surface
-
void rotate(double xr, double yr, double zr)¶
call Triangle::rotate on all triangles
-
inline STLSurf()¶
-
class Triangle¶
a Triangle defined by its three vertices
Public Functions
-
Triangle()¶
default constructor
-
inline virtual ~Triangle()¶
destructor
-
bool zslice_verts(Point &p1, Point &p2, double zcut) const¶
return true if Triangle is sliced by a z-plane at z=zcut modify p1 and p2 so that they are intesections of the triangle edges and the plane. These vertices are used by CylCutter::edgePush()
-
void rotate(double xrot, double yrot, double zrot)¶
rotate triangle xrot radians around X-axis, yrot radians around Y-axis and zrot radians around Z-axis
Public Members
-
Triangle()¶