Skip to content

Commit c67d16e

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

File tree

9 files changed

+383
-507
lines changed

9 files changed

+383
-507
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

gsSlicer.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,8 @@
4646
<Compile Include="compilers\ThreeAxisMillingCompiler.cs" />
4747
<Compile Include="generators\PrintGeneratorDefaults.cs" />
4848
<Compile Include="generators\PrintMeshAssembly.cs" />
49-
<Compile Include="generators\SingleMaterialFFFPrintGenPro.cs" />
5049
<Compile Include="slicing\BaseSlicer.cs" />
5150
<Compile Include="slicing\MeshPlanarMillSlicer.cs" />
52-
<Compile Include="slicing\MeshPlanarSlicerPro.cs" />
53-
<Compile Include="slicing\PlanarSlicePro.cs" />
5451
<Compile Include="sls\GenericPathsAssembler.cs" />
5552
<Compile Include="sls\GenericSLSPrintGenerator.cs" />
5653
<Compile Include="sls\SLSCompiler.cs" />
@@ -60,6 +57,7 @@
6057
<Compile Include="toolpathing\GroupScheduler2d.cs" />
6158
<Compile Include="toolpathing\LayerShellSelector.cs" />
6259
<Compile Include="toolpathing\PathPostProcessor.cs" />
60+
<Compile Include="utility\PolygonDecomposer.cs" />
6361
<Compile Include="toolpathing\SortingScheduler2d.cs" />
6462
<Compile Include="toolpathing\SparseLinesFillPolygon.cs" />
6563
<Compile Include="toolpathing\SupportPostProcessors.cs" />

0 commit comments

Comments
 (0)