/// <summary> /// Performs the offset operation. /// Can be called multiple times, offsetting the same paths by different amounts (ie using different deltas). /// </summary> /// <param name="output">The List that will receive the result of the offset operation.</param> /// <param name="delta"> /// The amount to which the supplied paths will be offset. /// Positive values expand polygons and negative values shrink them. /// Scaled by <see cref="ClipperUtility.ClipperScale"/>. /// </param> public void Offset(ref List <List <Vector2> > output, double delta) { var intOutput = new List <List <IntPoint> >(); clipperOffset.Execute(ref intOutput, delta * ClipperUtility.ClipperScale); ClipperUtility.ToVector2Paths(intOutput, ref output); }
/// <summary> /// Performs the clipping operation. /// Can be called multiple times without reassigning subject and clip polygons /// (ie when different clipping operations are required on the same polygon sets). /// </summary> /// <param name="clipType"> Type of the clipping operation. </param> /// <param name="output"> The List that will receive the result of the clipping operation. </param> /// <param name="subjectFillType"> Fill rule that will be applied to the subject paths. </param> /// <param name="clipFillType"> Fill rule that will be applied to the clip paths. </param> /// <returns> True if the operation was successful, false otherwise. </returns> public bool Clip(ClipType clipType, ref List <List <Vector2> > output, PolyFillType subjectFillType, PolyFillType clipFillType) { var intOutput = new List <List <IntPoint> >(); bool succeeded = clipper.Execute(clipType, intOutput, subjectFillType, clipFillType); ClipperUtility.ToVector2Paths(intOutput, ref output); return(succeeded); }