mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-19 04:27:55 +01:00
step before layer part integration
This commit is contained in:
parent
3a41b73c75
commit
5ac9364cc3
@ -2876,8 +2876,8 @@
|
||||
};
|
||||
ClipperLib.ClipperBase.prototype.AddPaths = function (ppg, polyType, closed)
|
||||
{
|
||||
// console.log("-------------------------------------------");
|
||||
// console.log(JSON.stringify(ppg));
|
||||
// console.warn("-------------------------------------------");
|
||||
// console.warn(JSON.stringify(ppg));
|
||||
var result = false;
|
||||
for (var i = 0, ilen = ppg.length; i < ilen; ++i)
|
||||
if (this.AddPath(ppg[i], polyType, closed))
|
||||
@ -3100,7 +3100,7 @@
|
||||
if (this.m_ExecuteLocked)
|
||||
return false;
|
||||
if (this.m_HasOpenPaths)
|
||||
ClipperLib.Error("Error: PolyTree struct is need for open path clipping.");
|
||||
//ClipperLib.Error("Error: PolyTree struct is need for open path clipping.");
|
||||
this.m_ExecuteLocked = true;
|
||||
ClipperLib.Clear(solution);
|
||||
this.m_SubjFillType = subjFillType;
|
||||
@ -3185,7 +3185,7 @@
|
||||
if (this.m_Scanbeam === null)
|
||||
break;
|
||||
var topY = this.PopScanbeam();
|
||||
//console.log("botY:" + botY + ", topY:" + topY);
|
||||
//console.warn("botY:" + botY + ", topY:" + topY);
|
||||
if (!this.ProcessIntersections(botY, topY))
|
||||
return false;
|
||||
this.ProcessEdgesAtTopOfScanbeam(topY);
|
||||
@ -4747,7 +4747,7 @@
|
||||
return;
|
||||
//prepare for sorting ...
|
||||
var e = this.m_ActiveEdges;
|
||||
//console.log(JSON.stringify(JSON.decycle( e )));
|
||||
//console.warn(JSON.stringify(JSON.decycle( e )));
|
||||
this.m_SortedEdges = e;
|
||||
while (e !== null)
|
||||
{
|
||||
@ -4766,13 +4766,13 @@
|
||||
{
|
||||
var eNext = e.NextInSEL;
|
||||
var pt = new ClipperLib.IntPoint();
|
||||
//console.log("e.Curr.X: " + e.Curr.X + " eNext.Curr.X" + eNext.Curr.X);
|
||||
//console.warn("e.Curr.X: " + e.Curr.X + " eNext.Curr.X" + eNext.Curr.X);
|
||||
if (e.Curr.X > eNext.Curr.X)
|
||||
{
|
||||
if (!this.IntersectPoint(e, eNext, pt) && e.Curr.X > eNext.Curr.X + 1)
|
||||
{
|
||||
//console.log("e.Curr.X: "+JSON.stringify(JSON.decycle( e.Curr.X )));
|
||||
//console.log("eNext.Curr.X+1: "+JSON.stringify(JSON.decycle( eNext.Curr.X+1)));
|
||||
//console.warn("e.Curr.X: "+JSON.stringify(JSON.decycle( e.Curr.X )));
|
||||
//console.warn("eNext.Curr.X+1: "+JSON.stringify(JSON.decycle( eNext.Curr.X+1)));
|
||||
ClipperLib.Error("Intersection error");
|
||||
}
|
||||
if (pt.Y > botY)
|
||||
@ -4884,8 +4884,8 @@
|
||||
else ClipperLib.Clipper.Round = R2; // eg. browser.chrome || browser.firefox || browser.opera
|
||||
ClipperLib.Clipper.TopX = function (edge, currentY)
|
||||
{
|
||||
//if (edge.Bot == edge.Curr) console.log ("edge.Bot = edge.Curr");
|
||||
//if (edge.Bot == edge.Top) console.log ("edge.Bot = edge.Top");
|
||||
//if (edge.Bot == edge.Curr) console.warn ("edge.Bot = edge.Curr");
|
||||
//if (edge.Bot == edge.Top) console.warn ("edge.Bot = edge.Top");
|
||||
if (currentY == edge.Top.Y)
|
||||
return edge.Top.X;
|
||||
return edge.Bot.X + ClipperLib.Clipper.Round(edge.Dx * (currentY - edge.Bot.Y));
|
||||
@ -6469,7 +6469,7 @@
|
||||
if (solution.length > 0)
|
||||
solution.splice(0, 1);
|
||||
}
|
||||
//console.log(JSON.stringify(solution));
|
||||
//console.warn(JSON.stringify(solution));
|
||||
}
|
||||
else // function (polytree, delta)
|
||||
{
|
||||
@ -6596,7 +6596,7 @@
|
||||
}
|
||||
catch (err)
|
||||
{
|
||||
console.log(err.message);
|
||||
console.warn(err.message);
|
||||
}
|
||||
};
|
||||
// ---------------------------------
|
||||
|
506
models/diamond.stl
Executable file
506
models/diamond.stl
Executable file
@ -0,0 +1,506 @@
|
||||
solid OpenSCAD_Model
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 24 0 45.03
|
||||
vertex 12 0 54.03
|
||||
vertex 20.7846 -12 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 8.48528 8.48528 54.03
|
||||
vertex 12 0 54.03
|
||||
vertex 20.7846 12 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 -20.7846 45.03
|
||||
vertex -20.7846 -12 45
|
||||
vertex -12 -20.7846 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 1.46953e-015 54.03
|
||||
vertex 8.48528 8.48528 54.03
|
||||
vertex 7.34764e-016 12 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 0 54.03
|
||||
vertex -8.48528 -8.48528 54.03
|
||||
vertex 8.48528 -8.48528 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 0 54.03
|
||||
vertex 8.48528 -8.48528 54.03
|
||||
vertex 20.7846 -12 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 0 54.03
|
||||
vertex 8.48528 8.48528 54.03
|
||||
vertex -8.48528 -8.48528 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 7.34764e-016 12 54.03
|
||||
vertex 1.46953e-015 24 45.03
|
||||
vertex -12 20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 20.7846 45.03
|
||||
vertex 20.7846 12 45
|
||||
vertex 12 20.7846 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 7.34764e-016 12 54.03
|
||||
vertex 8.48528 8.48528 54.03
|
||||
vertex 12 20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -0.15 -0.259808 15
|
||||
vertex 0.15 0.259808 15
|
||||
vertex 0.15 -0.259808 15
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 20.7846 -12 45.03
|
||||
vertex 12 -20.7846 45
|
||||
vertex 20.7846 -12 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 1.46953e-015 54.03
|
||||
vertex -20.7846 12 45.03
|
||||
vertex -24 2.93906e-015 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -24 2.93906e-015 45.03
|
||||
vertex -20.7846 -12 45
|
||||
vertex -20.7846 -12 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 8.48528 8.48528 54.03
|
||||
vertex 20.7846 12 45.03
|
||||
vertex 12 20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -20.7846 -12 45
|
||||
vertex -12 -20.7846 45.03
|
||||
vertex -20.7846 -12 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -0.15 0.259808 15
|
||||
vertex -12 20.7846 45
|
||||
vertex 1.46953e-015 24 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 0.15 0.259808 15
|
||||
vertex 20.7846 12 45
|
||||
vertex 0.3 0 15
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -2.20429e-015 -12 54.03
|
||||
vertex -4.40858e-015 -24 45.03
|
||||
vertex 12 -20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -2.20429e-015 -12 54.03
|
||||
vertex -8.48528 -8.48528 54.03
|
||||
vertex -12 -20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -24 2.93906e-015 45
|
||||
vertex -20.7846 12 45.03
|
||||
vertex -20.7846 12 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -0.15 0.259808 15
|
||||
vertex -0.15 -0.259808 15
|
||||
vertex -0.3 3.67382e-017 15
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 20.7846 12 45
|
||||
vertex 20.7846 12 45.03
|
||||
vertex 24 0 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 20.7846 12 45.03
|
||||
vertex 12 0 54.03
|
||||
vertex 24 0 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -8.48528 -8.48528 54.03
|
||||
vertex 8.48528 8.48528 54.03
|
||||
vertex -12 1.46953e-015 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 20.7846 12 45.03
|
||||
vertex 20.7846 12 45
|
||||
vertex 12 20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 1.46953e-015 24 45.03
|
||||
vertex -12 20.7846 45
|
||||
vertex -12 20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 7.34764e-016 12 54.03
|
||||
vertex -12 20.7846 45.03
|
||||
vertex -8.48528 8.48528 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 20.7846 12 45
|
||||
vertex 0.15 0.259808 15
|
||||
vertex 12 20.7846 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 1.46953e-015 24 45.03
|
||||
vertex 7.34764e-016 12 54.03
|
||||
vertex 12 20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -4.40858e-015 -24 45.03
|
||||
vertex 12 -20.7846 45
|
||||
vertex 12 -20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 8.48528 -8.48528 54.03
|
||||
vertex -8.48528 -8.48528 54.03
|
||||
vertex -2.20429e-015 -12 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 20.7846 45
|
||||
vertex 1.46953e-015 24 45.03
|
||||
vertex 1.46953e-015 24 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -4.40858e-015 -24 45.03
|
||||
vertex -2.20429e-015 -12 54.03
|
||||
vertex -12 -20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -0.15 -0.259808 15
|
||||
vertex -20.7846 -12 45
|
||||
vertex -0.3 3.67382e-017 15
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -0.15 0.259808 15
|
||||
vertex 0.15 0.259808 15
|
||||
vertex -0.15 -0.259808 15
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 0.15 -0.259808 15
|
||||
vertex 0.3 0 15
|
||||
vertex 20.7846 -12 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -20.7846 -12 45
|
||||
vertex -0.15 -0.259808 15
|
||||
vertex -12 -20.7846 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 -20.7846 45
|
||||
vertex 20.7846 -12 45.03
|
||||
vertex 12 -20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 0.15 -0.259808 15
|
||||
vertex 0.15 0.259808 15
|
||||
vertex 0.3 0 15
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -24 2.93906e-015 45.03
|
||||
vertex -20.7846 12 45.03
|
||||
vertex -24 2.93906e-015 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 1.46953e-015 54.03
|
||||
vertex -24 2.93906e-015 45.03
|
||||
vertex -20.7846 -12 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 20.7846 45
|
||||
vertex -20.7846 12 45.03
|
||||
vertex -12 20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 1.46953e-015 54.03
|
||||
vertex 7.34764e-016 12 54.03
|
||||
vertex -8.48528 8.48528 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 1.46953e-015 24 45.03
|
||||
vertex 12 20.7846 45
|
||||
vertex 1.46953e-015 24 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 1.46953e-015 24 45.03
|
||||
vertex 12 20.7846 45.03
|
||||
vertex 12 20.7846 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 20.7846 -12 45.03
|
||||
vertex 8.48528 -8.48528 54.03
|
||||
vertex 12 -20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 8.48528 -8.48528 54.03
|
||||
vertex -2.20429e-015 -12 54.03
|
||||
vertex 12 -20.7846 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 20.7846 45
|
||||
vertex 0.15 0.259808 15
|
||||
vertex 1.46953e-015 24 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 0.15 0.259808 15
|
||||
vertex -0.15 0.259808 15
|
||||
vertex 1.46953e-015 24 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 -20.7846 45
|
||||
vertex -4.40858e-015 -24 45.03
|
||||
vertex -4.40858e-015 -24 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -4.40858e-015 -24 45.03
|
||||
vertex -12 -20.7846 45.03
|
||||
vertex -12 -20.7846 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -4.40858e-015 -24 45.03
|
||||
vertex -12 -20.7846 45
|
||||
vertex -4.40858e-015 -24 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 -20.7846 45
|
||||
vertex -0.15 -0.259808 15
|
||||
vertex -4.40858e-015 -24 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 -20.7846 45
|
||||
vertex -4.40858e-015 -24 45
|
||||
vertex 0.15 -0.259808 15
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -4.40858e-015 -24 45
|
||||
vertex -0.15 -0.259808 15
|
||||
vertex 0.15 -0.259808 15
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -0.15 0.259808 15
|
||||
vertex -0.3 3.67382e-017 15
|
||||
vertex -20.7846 12 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -0.3 3.67382e-017 15
|
||||
vertex -24 2.93906e-015 45
|
||||
vertex -20.7846 12 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 -20.7846 45.03
|
||||
vertex -8.48528 -8.48528 54.03
|
||||
vertex -20.7846 -12 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -8.48528 -8.48528 54.03
|
||||
vertex -12 1.46953e-015 54.03
|
||||
vertex -20.7846 -12 45.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 20.7846 45.03
|
||||
vertex -20.7846 12 45.03
|
||||
vertex -8.48528 8.48528 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -20.7846 12 45.03
|
||||
vertex -12 1.46953e-015 54.03
|
||||
vertex -8.48528 8.48528 54.03
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 0.3 0 15
|
||||
vertex 20.7846 12 45
|
||||
vertex 24 0 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 12 -20.7846 45
|
||||
vertex 0.15 -0.259808 15
|
||||
vertex 20.7846 -12 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -0.3 3.67382e-017 15
|
||||
vertex -20.7846 -12 45
|
||||
vertex -24 2.93906e-015 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -20.7846 -12 45
|
||||
vertex -24 2.93906e-015 45.03
|
||||
vertex -24 2.93906e-015 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 20.7846 12 45
|
||||
vertex 24 0 45.03
|
||||
vertex 24 0 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 24 0 45.03
|
||||
vertex 20.7846 -12 45.03
|
||||
vertex 20.7846 -12 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 24 0 45.03
|
||||
vertex 20.7846 -12 45
|
||||
vertex 24 0 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex 20.7846 -12 45
|
||||
vertex 0.3 0 15
|
||||
vertex 24 0 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -20.7846 12 45.03
|
||||
vertex -12 20.7846 45
|
||||
vertex -20.7846 12 45
|
||||
endloop
|
||||
endfacet
|
||||
facet normal 0 0 0
|
||||
outer loop
|
||||
vertex -12 20.7846 45
|
||||
vertex -0.15 0.259808 15
|
||||
vertex -20.7846 12 45
|
||||
endloop
|
||||
endfacet
|
||||
endsolid OpenSCAD_Model
|
@ -70,7 +70,7 @@ var printerConfig = {
|
||||
var printer = new D3D.Printer(printerConfig);
|
||||
|
||||
var localIp = location.hash.substring(1);
|
||||
//var doodleBox = new D3D.Box(localIp);
|
||||
var doodleBox = new D3D.Box(localIp);
|
||||
//var printer = doodleBox.printer;
|
||||
|
||||
var scene = new THREE.Scene();
|
||||
@ -116,13 +116,14 @@ mesh.position.z = 100;
|
||||
//scene.add(mesh);
|
||||
|
||||
var loader = new THREE.STLLoader();
|
||||
loader.load("models/cube.stl", function (geometry) {
|
||||
loader.load("models/diamond.stl", function (geometry) {
|
||||
var geometry = new THREE.BoxGeometry(10, 10, 10, 1, 1, 1);
|
||||
|
||||
//var geometry = new THREE.TorusGeometry(20, 10, 30, 30);
|
||||
var mesh = new THREE.Mesh(geometry, material);
|
||||
|
||||
mesh.position.x = 100;
|
||||
mesh.position.z = 100;
|
||||
|
||||
/*
|
||||
mesh.rotation.x = -Math.PI/2;
|
||||
mesh.scale.x = mesh.scale.y = mesh.scale.z = 3;
|
||||
@ -136,7 +137,7 @@ loader.load("models/cube.stl", function (geometry) {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var context = canvas.getContext("2d");
|
||||
|
||||
var img = slicer.drawPaths(printer, 0, 1);
|
||||
var img = slicer.drawPaths(printer, 0, 10);
|
||||
context.drawImage(img, 0, 0);
|
||||
|
||||
gcode = slicer.getGcode(printer);
|
||||
|
@ -193,6 +193,8 @@ D3D.Slicer.prototype.slice = function (height, step) {
|
||||
|
||||
//stop when ther are no intersects
|
||||
if (slice.length > 0) {
|
||||
var layerParts = [];
|
||||
|
||||
slices.push(slice);
|
||||
}
|
||||
else {
|
||||
@ -257,8 +259,6 @@ D3D.Slicer.prototype.slicesToData = function (slices, printer) {
|
||||
var highFillTemplate = this.getFillTemplate(dimensionsZ, wallThickness, (layer % 2 === 0), (layer % 2 === 1));
|
||||
fills.join(highFillTemplate.intersect(highFillArea));
|
||||
|
||||
console.log(highFillTemplate.intersect(highFillArea));
|
||||
|
||||
outerLayers.push(outerLayer);
|
||||
}
|
||||
|
||||
@ -411,7 +411,7 @@ D3D.Slicer.prototype.drawPaths = function (printer, min, max) {
|
||||
for (var layer = min; layer < max; layer ++) {
|
||||
var slice = data[layer % data.length];
|
||||
|
||||
slice.insets.draw(context, "blue");
|
||||
//slice.insets.draw(context, "blue");
|
||||
slice.outerLayer.draw(context, "green");
|
||||
slice.fill.draw(context, "red");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user