Fix GCode line endcaps

This commit is contained in:
John Lewin 2017-11-17 19:25:21 -08:00
parent d4ffe20d50
commit 068bfc2d9a
2 changed files with 2 additions and 2 deletions

View file

@ -80,7 +80,7 @@ namespace MatterHackers.GCodeVisualizer
colorVertexData.Add(new ColorVertexData(tubeEnd, tubeNormal, color));
// create cap verts
Vector3 rotateAngle = Vector3.Cross(direction, startSweepDirection);
Vector3 rotateAngle = Vector3.Cross(startSweepDirection, direction);
Vector3 capStartNormal = Vector3.Transform(startSweepDirection, Matrix4X4.CreateRotation(rotateAngle, MathHelper.Tau / 8));
capStartNormal = Vector3.Transform(capStartNormal, Matrix4X4.CreateRotation(direction, MathHelper.Tau / (steps * 2) + MathHelper.Tau / (steps) * i));
capStartNormal = (capStartNormal * scale).GetNormal();