Cutters

class AdaptivePathDropCutter : public ocl::Operation

path drop cutter finish Path generation

Public Functions

AdaptivePathDropCutter()

construct an empty PathDropCutter object

virtual void run()

run drop-cutter on the whole Path

inline void setMinSampling(double s)

set the minimum sapling interval

inline void setCosLimit(double lim)

set the cosine limit for the flat() predicate

class BallCutter : public ocl::MillingCutter

Ball or Spherical MillingCutter (ball-nose endmill)

Public Functions

explicit BallCutter(double d, double l)

create a BallCutter with diameter d (radius d/2) and length l

inline virtual MillingCutter *offsetCutter(double d) const

offset of Ball is Ball

virtual std::string str() const

return a string representation of the MillingCutter

Friends

friend std::ostream &operator<<(std::ostream &stream, BallCutter c)

string repr

class BatchDropCutter : public ocl::Operation

BatchDropCutter takes a MillingCutter, an STLSurf, and a list of CLPoint’s and calls MillingCutter::dropCutter() for each CLPoint. To find triangles overlapping the cutter a kd-tree data structure is used. The list of CLPoint’s will be updated with the correct z-height as well as corresponding CCPoint’s Some versions of this algorithm use OpenMP for multi-threading.

Public Functions

virtual void setSTL(const STLSurf &s)

set the STL-surface and build kd-tree to enable optimized algorithm

virtual void appendPoint(CLPoint &p)

append to list of CL-points to evaluate

inline virtual void run()

run drop-cutter on all clpoints

inline virtual std::vector<CLPoint> getCLPoints()

return a vector of CLPoints, the result of this operation

inline virtual void clearCLPoints()

clears the vector of CLPoints

class BatchPushCutter : public ocl::Operation

BatchPushCutter takes a MillingCutter, an STLSurf, and many Fibers and pushes the cutter along the fibers into contact with the surface. When this runs the Fibers will be updated with the correct interval data. This is then used to build a weave and extract a waterline.

Public Functions

virtual void setSTL(const STLSurf &s)

set the STL-surface and build kd-tree

inline virtual void setXDirection()

set this bpc to be x-direction

inline virtual void setYDirection()

set this bpc to be Y-direction

virtual void appendFiber(Fiber &f)

append to list of Fibers to evaluate

inline virtual void run()

run push-cutter

inline virtual std::vector<Fiber> *getFibers() const

return the result of a push-cutter type operation

class BallConeCutter : public ocl::CompositeCutter

CompositeCutter with a spherical central part of diameter diam1 and a conical outer part sloping at angle, with a max diameter diam2 the cone is positioned so that the tangent of the cone matches the tangent of the sphere.

Public Functions

BallConeCutter(double diam1, double diam2, double angle)

create ballconecutter

class BullConeCutter : public ocl::CompositeCutter

CompositeCutter with a toroidal central part of diameter diam1 and corner radius radius1 The outer part is conical sloping at angle, with a max diameter diam2 the cone is positioned so that the tangent of the cone matches the tangent of the torus.

Public Functions

BullConeCutter(double diam1, double radius1, double diam2, double angle)

create bullconecutter

class BullCutter : public ocl::MillingCutter

Bull-nose or Toroidal MillingCutter (filleted endmill)

defined by the cutter diameter and by the corner radius

Public Functions

BullCutter(double diameter, double radius, double length)

Create bull-cutter with diameter d, corner radius r, and length l.

virtual MillingCutter *offsetCutter(double offset) const

offset of Bull is Bull

virtual std::string str() const

return a string representation of the MillingCutter

Friends

friend std::ostream &operator<<(std::ostream &stream, BullCutter c)

string repr

class CompBallCutter : public ocl::CompositeCutter

for testing, a single ballcutter

class CompCylCutter : public ocl::CompositeCutter

a composite cutter for testing, consisting only of a cylindrical cutter

class CompositeCutter : public ocl::MillingCutter

a CompositeCutter is composed one or more MillingCutters the cutters are stored in a vector cutter and their axial offsets from eachother in zoffset. The different cutters apply in different radial regions. cutter[0] from r=0 to r=radius[0] after that cutter[1] from r=radius[0] to r=radius[1] and so on.

Subclassed by ocl::BallConeCutter, ocl::BullConeCutter, ocl::CompBallCutter, ocl::CompCylCutter, ocl::ConeConeCutter, ocl::CylConeCutter

Public Functions

CompositeCutter()

create an empty CompositeCutter

void addCutter(MillingCutter &c, double radius, double height, double zoff)

add a MillingCutter to this CompositeCutter the cutter is valid from the previous radius out to the given radius and its axial offset is given by zoffset

virtual MillingCutter *offsetCutter(double d) const

return a MillingCutter which is larger than *this by d

virtual bool facetDrop(CLPoint &cl, const Triangle &t) const

CompositeCutter can not use the base-class facetDrop, instead we here call facetDrop() on each cutter in turn, and pick the valid CC/CL point as the result for the CompositeCutter

virtual bool edgeDrop(CLPoint &cl, const Triangle &t) const

call edgeDrop on each cutter and pick the correct (highest valid CL-point) result

virtual std::string str() const

return a string representation of the MillingCutter

class ConeConeCutter : public ocl::CompositeCutter

CompositeCutter with a conical central part with diam1/angle1 and a conical outer part with diam2/angle2 we assume angle2 < angle1 and diam2 > diam1.

Public Functions

ConeConeCutter(double diam1, double angle1, double diam2, double angle2)

create cone-cone cutter with lower cone (diam1,angle1) and upper cone (diam2,angle2) we assume angle2 < angle1 and diam2 > diam1.

class ConeCutter : public ocl::MillingCutter

Conical MillingCutter.

cone defined by diameter and the cone half-angle(in radians). sharp tip. 60 degrees or 90 degrees are common

Public Functions

ConeCutter(double d, double angle, double l = 10)

create a ConeCutter with specified maximum diameter and cone-angle for a 90-degree cone specify the half-angle angle= pi/4

virtual MillingCutter *offsetCutter(double d) const

offset of ConeCutter is BallConeCutter (should be Ball-Cone-Bull??)

virtual bool facetDrop(CLPoint &cl, const Triangle &t) const

Cone facet-drop is special, since we can make contact with either the tip or the circular rim.

virtual std::string str() const

return a string representation of the MillingCutter

Friends

friend std::ostream &operator<<(std::ostream &stream, ConeCutter c)

string repr

class CylConeCutter : public ocl::CompositeCutter

CompositeCutter with a cylindrical/flat central part of diameter diam1 and a conical outer part sloping at angle, with a max diameter diam2.

Public Functions

CylConeCutter(double diam1, double diam2, double angle)

create cylconecutter

class CylCutter : public ocl::MillingCutter

Cylindrical MillingCutter (flat-endmill)

defined by one parameter, the cutter diameter

Public Functions

explicit CylCutter(double d, double l)

create CylCutter with diameter d and length l

inline virtual MillingCutter *offsetCutter(double d) const

offset of Cylinder is BullCutter

virtual std::string str() const

return a string representation of the MillingCutter

Friends

friend std::ostream &operator<<(std::ostream &stream, CylCutter c)

string repr

class MillingCutter

MillingCutter is a base-class for all milling cutters.

Subclassed by ocl::BallCutter, ocl::BullCutter, ocl::CompositeCutter, ocl::ConeCutter, ocl::CylCutter

Public Functions

inline MillingCutter()

default constructor

inline double getDiameter() const

return the diameter of the cutter

inline double getRadius() const

return the radius of the cutter

inline double getLength() const

return the length of the cutter

virtual MillingCutter *offsetCutter(double d) const

return a MillingCutter which is larger than *this by d

bool overlaps(Point &cl, const Triangle &t) const

Test if the cutter bounding-box, positioned at cl, overlaps with the bounding-box of Triangle t. works in the xy-plane

bool vertexDrop(CLPoint &cl, const Triangle &t) const

drop cutter at (cl.x, cl.y) against the three vertices of Triangle t. calls this->height(r) on the subclass of MillingCutter we are using. if cl.z is too low, updates cl.z so that cutter does not cut any vertex.

virtual bool facetDrop(CLPoint &cl, const Triangle &t) const

drop cutter at (cl.x, cl.y) against facet of Triangle t calls xy_normal_length(), normal_length(), and center_height() on the subclass. if cl.z is too low, updates cl.z so that cutter does not cut the facet. CompositeCutter may be the only sub-class that needs to reimplement this function.

virtual bool edgeDrop(CLPoint &cl, const Triangle &t) const

drop cutter at (cl.x, cl.y) against the three edges of input Triangle t. calls the sub-class MillingCutter::singleEdgeDrop on each edge if cl.z is too low, updates cl.z so that cutter does not cut any edge.

bool dropCutter(CLPoint &cl, const Triangle &t) const

drop the MillingCutter at Point cl down along the z-axis until it makes contact with Triangle t. This function calls vertexDrop, facetDrop, and edgeDrop to do its job. Follows the template-method, or “self-delegation” design pattern. if cl.z is too low, updates cl.z so that the cutter does not cut Triangle t.

bool dropCutterSTL(CLPoint &cl, const STLSurf &s) const

call dropCutter on all Triangles in an STLSurf drops the MillingCutter at Point cl down along the z-axis until it makes contact with a triangle in the STLSurf s NOTE: no kd-tree optimization, this function will make dropCutter() calls for each and every Triangle in s. NOTE: should not really be used for real work, demo/debug only

bool pushCutter(const Fiber &f, Interval &i, const Triangle &t) const

push cutter along Fiber f against Triangle t by calling vertexPush, facetPush, and edgePush Interval i will be updated so that it contains the interval where the cutter would violate/gouge the Triangle. Return true if contact was made with the Triangle

inline virtual std::string str() const

return a string representation of the MillingCutter