本文整理汇总了C#中Polygons.CreateLineDifference方法的典型用法代码示例。如果您正苦于以下问题:C# Polygons.CreateLineDifference方法的具体用法?C# Polygons.CreateLineDifference怎么用?C# Polygons.CreateLineDifference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygons
的用法示例。
在下文中一共展示了Polygons.CreateLineDifference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueuePolygonsConsideringSupport
private void QueuePolygonsConsideringSupport(int layerIndex, GCodePlanner gcodeLayer, Polygons polygonsToWrite, GCodePathConfig fillConfig, SupportWriteType supportWriteType)
{
if (config.generateSupport
&& layerIndex > 0
&& !config.continuousSpiralOuterPerimeter)
{
Polygons supportOutlines = slicingData.support.GetRequiredSupportAreas(layerIndex);
if (supportWriteType == SupportWriteType.UnsupportedAreas)
{
if (supportOutlines.Count > 0)
{
Polygons polygonsNotOnSupport;
// don't write the bottoms that are sitting on supported areas (they will be written at air gap distance later).
polygonsToWrite = PolygonsHelper.ConvertToLines(polygonsToWrite);
polygonsNotOnSupport = polygonsToWrite.CreateLineDifference(supportOutlines);
gcodeLayer.QueuePolygonsByOptimizer(polygonsNotOnSupport, fillConfig);
}
else
{
gcodeLayer.QueuePolygonsByOptimizer(polygonsToWrite, fillConfig);
}
}
else
{
if (supportOutlines.Count > 0)
{
if (supportOutlines.Count > 0)
{
// write the bottoms that are sitting on supported areas.
Polygons polygonsOnSupport;
polygonsToWrite = PolygonsHelper.ConvertToLines(polygonsToWrite);
polygonsOnSupport = supportOutlines.CreateLineIntersections(polygonsToWrite);
// ensure that all the segments have only 2 points
foreach(Polygon poly in polygonsOnSupport)
{
while(poly.Count > 2)
{
// This is an error and I'm not sure why it happened. It needs to be investigated. // LBB 2016 01 12
poly.RemoveAt(poly.Count - 1);
}
}
gcodeLayer.QueuePolygonsByOptimizer(polygonsOnSupport, fillConfig);
}
else
{
gcodeLayer.QueuePolygonsByOptimizer(polygonsToWrite, fillConfig);
}
}
}
}
else if (supportWriteType == SupportWriteType.UnsupportedAreas)
{
gcodeLayer.QueuePolygonsByOptimizer(polygonsToWrite, fillConfig);
}
}