Skip to content

Commit 91ca94a

Browse files
committed
Integrate gsSlicerPro extensions into base gsSlicer classes.
1 parent d1bb463 commit 91ca94a

File tree

8 files changed

+382
-504
lines changed

8 files changed

+382
-504
lines changed

generators/PrintMeshAssembly.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public class PrintMeshOptions
1414
public bool IsCropRegion = false; // treat as crop region
1515
public bool IsOpen = false; // treat as open mesh (ie do not fill)
1616

17+
public double ClearanceXY = 0;
18+
public double OffsetXY = 0;
19+
1720
public enum OpenPathsModes
1821
{
1922
Embedded = 0, Clipped = 1, Ignored = 2, Default = 10

generators/SingleMaterialFFFPrintGenPro.cs

Lines changed: 0 additions & 303 deletions
This file was deleted.

generators/ThreeAxisPrintGenerator.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,11 +717,54 @@ protected virtual void fill_bridge_region(GeneralPolygon2d poly, IFillPathSchedu
717717
scheduler.AppendCurveSets(fill_gen.GetFillCurves());
718718
}
719719

720+
protected virtual void fill_bridge_region_decompose(GeneralPolygon2d poly, IFillPathScheduler2d scheduler, PrintLayerData layer_data)
721+
{
722+
poly.Simplify(0.1, 0.01, true);
723+
724+
double minLength = Settings.MaxBridgeWidthMM * 0.75;
725+
double minArea = minLength * minLength;
726+
727+
var polys = PolygonDecomposer.Compute(poly, minArea);
728+
729+
double spacing = Settings.BridgeFillPathSpacingMM();
730+
731+
foreach (Polygon2d polypart in polys)
732+
{
720733

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

738+
GeneralPolygon2d gp = new GeneralPolygon2d(polypart);
722739

740+
ShellsFillPolygon shells_fill = new ShellsFillPolygon(gp);
741+
shells_fill.PathSpacing = Settings.SolidFillPathSpacingMM();
742+
shells_fill.ToolWidth = Settings.Machine.NozzleDiamMM;
743+
shells_fill.Layers = 1;
744+
shells_fill.InsetFromInputPolygonX = 0.25;
745+
shells_fill.ShellType = ShellsFillPolygon.ShellTypes.BridgeShell;
746+
shells_fill.FilterSelfOverlaps = false;
747+
shells_fill.Compute();
748+
scheduler.AppendCurveSets(shells_fill.GetFillCurves());
749+
var fillPolys = shells_fill.InnerPolygons;
723750

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

754+
foreach (var fp in fillPolys)
755+
{
756+
BridgeLinesFillPolygon fill_gen = new BridgeLinesFillPolygon(fp)
757+
{
758+
InsetFromInputPolygon = false,
759+
PathSpacing = spacing,
760+
ToolWidth = Settings.Machine.NozzleDiamMM,
761+
AngleDeg = angle,
762+
};
763+
fill_gen.Compute();
764+
scheduler.AppendCurveSets(fill_gen.GetFillCurves());
765+
}
766+
}
767+
}
725768

726769
/// <summary>
727770
/// Determine the sparse infill and solid fill regions for a layer, given the input regions that

0 commit comments

Comments
 (0)