Skip to content

Commit

Permalink
Integrate gsSlicerPro extensions into base gsSlicer classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmeess committed Nov 3, 2019
1 parent d1bb463 commit 91ca94a
Show file tree
Hide file tree
Showing 8 changed files with 382 additions and 504 deletions.
3 changes: 3 additions & 0 deletions generators/PrintMeshAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class PrintMeshOptions
public bool IsCropRegion = false; // treat as crop region
public bool IsOpen = false; // treat as open mesh (ie do not fill)

public double ClearanceXY = 0;
public double OffsetXY = 0;

public enum OpenPathsModes
{
Embedded = 0, Clipped = 1, Ignored = 2, Default = 10
Expand Down
303 changes: 0 additions & 303 deletions generators/SingleMaterialFFFPrintGenPro.cs

This file was deleted.

43 changes: 43 additions & 0 deletions generators/ThreeAxisPrintGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,54 @@ protected virtual void fill_bridge_region(GeneralPolygon2d poly, IFillPathSchedu
scheduler.AppendCurveSets(fill_gen.GetFillCurves());
}

protected virtual void fill_bridge_region_decompose(GeneralPolygon2d poly, IFillPathScheduler2d scheduler, PrintLayerData layer_data)
{
poly.Simplify(0.1, 0.01, true);

double minLength = Settings.MaxBridgeWidthMM * 0.75;
double minArea = minLength * minLength;

var polys = PolygonDecomposer.Compute(poly, minArea);

double spacing = Settings.BridgeFillPathSpacingMM();

foreach (Polygon2d polypart in polys)
{

Box2d box = polypart.MinimalBoundingBox(0.00001);
Vector2d axis = (box.Extent.x > box.Extent.y) ? box.AxisY : box.AxisX;
double angle = Math.Atan2(axis.y, axis.x) * MathUtil.Rad2Deg;

GeneralPolygon2d gp = new GeneralPolygon2d(polypart);

ShellsFillPolygon shells_fill = new ShellsFillPolygon(gp);
shells_fill.PathSpacing = Settings.SolidFillPathSpacingMM();
shells_fill.ToolWidth = Settings.Machine.NozzleDiamMM;
shells_fill.Layers = 1;
shells_fill.InsetFromInputPolygonX = 0.25;
shells_fill.ShellType = ShellsFillPolygon.ShellTypes.BridgeShell;
shells_fill.FilterSelfOverlaps = false;
shells_fill.Compute();
scheduler.AppendCurveSets(shells_fill.GetFillCurves());
var fillPolys = shells_fill.InnerPolygons;

double offset = Settings.Machine.NozzleDiamMM * Settings.SolidFillBorderOverlapX;
fillPolys = ClipperUtil.MiterOffset(fillPolys, offset);

foreach (var fp in fillPolys)
{
BridgeLinesFillPolygon fill_gen = new BridgeLinesFillPolygon(fp)
{
InsetFromInputPolygon = false,
PathSpacing = spacing,
ToolWidth = Settings.Machine.NozzleDiamMM,
AngleDeg = angle,
};
fill_gen.Compute();
scheduler.AppendCurveSets(fill_gen.GetFillCurves());
}
}
}

/// <summary>
/// Determine the sparse infill and solid fill regions for a layer, given the input regions that
Expand Down
Loading

0 comments on commit 91ca94a

Please sign in to comment.