*
This commit is contained in:
parent
86c56dd6b3
commit
148fffa73e
@ -20,21 +20,22 @@ function Generator(layer)
|
||||
return l;
|
||||
}
|
||||
|
||||
this.render = function(id,segment,mirror = 0)
|
||||
this.render = function(last_seg,segment,mirror = 0)
|
||||
{
|
||||
var type = segment.type;
|
||||
var vertices = segment.vertices;
|
||||
var html = '';
|
||||
var skip = 0;
|
||||
|
||||
for(i in vertices){
|
||||
for(id in vertices){
|
||||
if(skip > 0){ skip -= 1; continue; }
|
||||
|
||||
var vertex = vertices[i]
|
||||
var next = vertices[parseInt(i)+1]
|
||||
var after_next = vertices[parseInt(i)+2]
|
||||
var vertex = vertices[id]
|
||||
var last = last_seg && last_seg.vertices[last_seg.vertices.length-1] ? last_seg.vertices[last_seg.vertices.length-1] : null
|
||||
var next = vertices[parseInt(id)+1]
|
||||
var after_next = vertices[parseInt(id)+2]
|
||||
|
||||
if(id == 0 && i == 0){
|
||||
if(id == 0 ){
|
||||
html += `M${vertex.x},${vertex.y} `
|
||||
}
|
||||
|
||||
@ -68,10 +69,9 @@ function Generator(layer)
|
||||
this.convert = function(layer,mirror)
|
||||
{
|
||||
var s = ""
|
||||
|
||||
for(id in layer){
|
||||
var seg = layer[id];
|
||||
s += `${this.render(id,seg,mirror)}`
|
||||
s += `${this.render(layer[id-1],seg,mirror)}`
|
||||
}
|
||||
|
||||
return s;
|
||||
|
@ -20,9 +20,9 @@ function Guide()
|
||||
{
|
||||
this.clear();
|
||||
|
||||
if(dotgrid.tool.index == 2){ this.draw_markers() ;this.draw_vertices() }
|
||||
if(dotgrid.tool.index == 2){ this.draw_markers() ; this.draw_vertices() }
|
||||
this.draw_path(new Generator(dotgrid.tool.layers[2]).toString({x:15,y:15},scale),dotgrid.tool.styles[2])
|
||||
if(dotgrid.tool.index == 1){ this.draw_markers() ;this.draw_vertices() }
|
||||
if(dotgrid.tool.index == 1){ this.draw_markers() ; this.draw_vertices() }
|
||||
this.draw_path(new Generator(dotgrid.tool.layers[1]).toString({x:15,y:15},scale),dotgrid.tool.styles[1])
|
||||
if(dotgrid.tool.index == 0){ this.draw_markers(); this.draw_vertices() }
|
||||
this.draw_path(new Generator(dotgrid.tool.layers[0]).toString({x:15,y:15},scale),dotgrid.tool.styles[0])
|
||||
|
Loading…
Reference in New Issue
Block a user