当前位置: 首页>>代码示例>>C#>>正文


C# Polygons.CreateLineDifference方法代码示例

本文整理汇总了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);
			}
		}
开发者ID:broettge,项目名称:MatterSlice,代码行数:59,代码来源:fffProcessor.cs


注:本文中的Polygons.CreateLineDifference方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。