@@ -58,11 +58,13 @@ console.log('RapidSpeed', rapidSpeed);
58
58
var isLaserOn = false ;
59
59
var isAtClearanceHeight = false ;
60
60
var isFeedrateSpecifiedAlready = false ;
61
+ subj_paths = [ ] ;
61
62
console . log ( txtGrp ) ;
62
63
txtGrp . traverse ( function ( child ) {
63
64
if ( child . type == "Line" ) {
64
65
// let's create gcode for all points in line
65
66
for ( i = 0 ; i < child . geometry . vertices . length ; i ++ ) {
67
+
66
68
var localPt = child . geometry . vertices [ i ] ;
67
69
var worldPt = grp . localToWorld ( localPt . clone ( ) ) ;
68
70
if ( i == 0 ) {
@@ -80,6 +82,8 @@ console.log('RapidSpeed', rapidSpeed);
80
82
g += "G0 X" + worldPt . x . toFixed ( 3 ) +
81
83
" Y" + worldPt . y . toFixed ( 3 ) + " F" + rapidSpeed + "\n" ;
82
84
85
+
86
+ //subj_paths.push(worldPt.x.toFixed(3) +',' + worldPt.y.toFixed(3));
83
87
// if milling move back to depth cut
84
88
if ( options . mode == "mill" ) {
85
89
var halfDistance = ( options . millclearanceheight - options . milldepthcut ) / 2 ;
@@ -131,6 +135,7 @@ console.log('RapidSpeed', rapidSpeed);
131
135
g += " X" + worldPt . x . toFixed ( 3 ) ;
132
136
g += " Y" + worldPt . y . toFixed ( 3 ) ;
133
137
g += " S" + options . lasersvalue + "\n" ;
138
+ subj_paths . push ( worldPt . x . toFixed ( 3 ) + ',' + worldPt . y . toFixed ( 3 ) ) ;
134
139
135
140
136
141
}
@@ -155,10 +160,15 @@ console.log('RapidSpeed', rapidSpeed);
155
160
g += "G0 Z" + options . millclearanceheight + "\n" ;
156
161
isAtClearanceHeight = true ;
157
162
}
163
+ //subj_path2 = getInflatedPath(subj_paths, 3, 3);
164
+ console . log ( 'Subj Path' , subj_path2 ) ;
165
+
158
166
}
159
167
} ) ;
160
168
161
169
console . log ( "generated gcode. length:" , g . length ) ;
170
+ //subj_paths = ClipperLib.Clipper.SimplifyPolygons(subj_paths, ClipperLib.PolyFillType.pftEvenOdd);
171
+ console . log ( 'Subj Path' , subj_paths ) ;
162
172
//console.log("gcode:", g);
163
173
// $('#' + this.id + " .gcode").val(g).prop('disabled', false);
164
174
// $('#' + this.id + " .btn-sendgcodetows").prop('disabled', false);
0 commit comments