// // ablator: ROOT c++ class implementing the capability to analyze a surface // profile image of a diamond sample (eg. from a Zygo microscope) // and create a laser ablation sequence file that can be used to // mill that sample down to match an arbitrary target surface. // // author: richard.t.jones at uconn.edu // version: february 10, 2015 // #include "Map2D.h" class ablator { public: ablator(): fSpotHsize(0.067), // mm fSpotVsize(0.047), // mm fSpotDepth(0.183), // microns fRaster_dx(0.010), // mm fRaster_dy(0.010), // mm fTaperFactor(1.0), // multiplies steady-state pulse energy fTaperLength(10.), // pulses fReps(10) {} int getReps() const { return fReps; } double getRaster_dx() const { return fRaster_dx; } double getRaster_dy() const { return fRaster_dy; } double getSpotHsize() const { return fSpotHsize; } double getSpotVsize() const { return fSpotVsize; } double getSpotDepth() const { return fSpotDepth; } double getTaperFactor() const { return fTaperFactor; } double getTaperLength() const { return fTaperLength; } void setReps(int reps) { fReps = reps; } void setRaster(double dx, double dy) { fRaster_dx = dx; fRaster_dy = dy; } void setSpotSize(double xsize, double ysize) { fSpotHsize = xsize; fSpotVsize = ysize; } void setSpotDepth(double depth) { fSpotDepth = depth; } void setTaperFactor(double taper_factor) { fTaperFactor = taper_factor; } void setTaperLength(double taper_pulses) { fTaperLength = taper_pulses; } Map2D *smooth(Map2D *target_map, double smear_factor = 2.0); Map2D *unsmooth(Map2D *target_map, double min_eigenvalue = 0.2); Map2D *fillvoids(Map2D *part_map, double max_void_sigmas = 3); Map2D *mill(Map2D *part_map, Map2D *target_map); Map2D *mill_sparse(Map2D *part_map, Map2D *target_map); Map2D *discretize(Map2D *pulse_map); Map2D *detrench(Map2D *program_map); Map2D *simulate_mill(Map2D *program_map, Map2D *part_map); int rasterize(Map2D *program_map, const char *seqfile); private: double fSpotHsize; double fSpotVsize; double fSpotDepth; double fRaster_dx; double fRaster_dy; double fTaperFactor; double fTaperLength; int fReps; Map2D *spot_filter(const Map2D *shape) const; }; class Pulse { public: Pulse() : ix(0), iy(0) {} int ix; int iy; }; inline bool operator<(Pulse &p1, Pulse &p2) { if (p1.iy != p2.iy) { return (p1.iy < p2.iy); } else { return (p1.ix < p2.ix); } }