Skip to content

Commit

Permalink
Remove default value of divisions parameter, added BoundedCurve.ToPol…
Browse files Browse the repository at this point in the history
…yline witout parameter
  • Loading branch information
DmytroMuravskyi committed Oct 27, 2023
1 parent be6a540 commit f41338c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Elements/src/Geometry/BoundedCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,21 @@ public virtual Transform[] Frames(double startSetbackDistance = 0.0,
return transforms;
}

/// <summary>
/// Create a polyline through a set of points along the curve.
/// </summary>
/// <returns>A polyline.</returns>
public virtual Polyline ToPolyline()
{
return ToPolyline(10);
}

/// <summary>
/// Create a polyline through a set of points along the curve.
/// </summary>
/// <param name="divisions">The number of divisions of the curve.</param>
/// <returns>A polyline.</returns>
public virtual Polyline ToPolyline(int divisions = 10)
public virtual Polyline ToPolyline(int divisions)
{
var pts = new List<Vector3>(divisions + 1);
var step = this.Domain.Length / divisions;
Expand Down
4 changes: 2 additions & 2 deletions Elements/src/Geometry/IndexedPolycurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ internal static void CheckSelfIntersectionAndThrow(Transform t, IEnumerable<(Vec
/// Create a polyline through curves of IndexedPolycurve, interpolating any curves that are not lines.
/// </summary>
/// <returns>A polyline.</returns>
public virtual Polyline ToPolyline()
public override Polyline ToPolyline()
{
List<Vector3> vertices = new List<Vector3>();
foreach (var curve in _curves)
Expand Down Expand Up @@ -698,7 +698,7 @@ public virtual Polyline ToPolyline()
/// <param name="divisions">The number of divisions of the curve.
/// This can lead to highly distorted result.</param>
/// <returns>A polyline.</returns>
public override Polyline ToPolyline(int divisions = 10)
public override Polyline ToPolyline(int divisions)
{
//
if (divisions < _curves.Count)
Expand Down

0 comments on commit f41338c

Please sign in to comment.