本文整理汇总了C#中Polygons.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# Polygons.RemoveAt方法的具体用法?C# Polygons.RemoveAt怎么用?C# Polygons.RemoveAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygons
的用法示例。
在下文中一共展示了Polygons.RemoveAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateSkirt
public void GenerateSkirt(int distance, int extrusionWidth_um, int numberOfLoops, int minLength, int initialLayerHeight, ConfigSettings config)
{
LayerDataStorage storage = this;
bool externalOnly = (distance > 0);
for (int skirtLoop = 0; skirtLoop < numberOfLoops; skirtLoop++)
{
int offsetDistance = distance + extrusionWidth_um * skirtLoop + extrusionWidth_um / 2;
Polygons skirtPolygons = new Polygons(storage.wipeTower.Offset(offsetDistance));
for (int extrudeIndex = 0; extrudeIndex < storage.Extruders.Count; extrudeIndex++)
{
if (config.continuousSpiralOuterPerimeter && extrudeIndex > 0)
{
continue;
}
if (storage.Extruders[extrudeIndex].Layers.Count < 1)
{
continue;
}
SliceLayer layer = storage.Extruders[extrudeIndex].Layers[0];
for (int partIndex = 0; partIndex < layer.Islands.Count; partIndex++)
{
if (config.continuousSpiralOuterPerimeter && partIndex > 0)
{
continue;
}
if (externalOnly)
{
Polygons p = new Polygons();
p.Add(layer.Islands[partIndex].IslandOutline[0]);
//p.Add(IntPointHelper.CreateConvexHull(layer.parts[partIndex].outline[0]));
skirtPolygons = skirtPolygons.CreateUnion(p.Offset(offsetDistance));
}
else
{
skirtPolygons = skirtPolygons.CreateUnion(layer.Islands[partIndex].IslandOutline.Offset(offsetDistance));
}
}
}
if (storage.support != null)
{
skirtPolygons = skirtPolygons.CreateUnion(storage.support.GetBedOutlines().Offset(offsetDistance));
}
//Remove small inner skirt holes. Holes have a negative area, remove anything smaller then 100x extrusion "area"
for (int n = 0; n < skirtPolygons.Count; n++)
{
double area = skirtPolygons[n].Area();
if (area < 0 && area > -extrusionWidth_um * extrusionWidth_um * 100)
{
skirtPolygons.RemoveAt(n--);
}
}
storage.skirt.AddAll(skirtPolygons);
int lenght = (int)storage.skirt.PolygonLength();
if (skirtLoop + 1 >= numberOfLoops && lenght > 0 && lenght < minLength)
{
// add more loops for as long as we have not extruded enough length
numberOfLoops++;
}
}
}