Skip to content

Commit

Permalink
Merge pull request #111 from SOFAgh/FixSplineDxfEport
Browse files Browse the repository at this point in the history
Fix error The number of control points must be the same as the number…
  • Loading branch information
dsn27 committed Oct 26, 2022
2 parents 0117f6f + 6c53305 commit 2418191
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions CADability/ExportDxf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,11 @@ private netDxf.Entities.Spline ExportBSpline(BSpline bspline)
{
for (int j = 0; j < bspline.Multiplicities[i]; j++) knots.Add(bspline.Knots[i]);
}

//TODO: Check if bspline.IsClosed means the same as Spline.IsClosedPeriodic
//TODO: Check if it's okay to pass an empty array as weights

if (bspline.HasWeights)
return new netDxf.Entities.Spline(poles, bspline.Weights, knots, (short)bspline.Degree, bspline.IsClosed);
else
return new netDxf.Entities.Spline(poles, Array.Empty<double>(), knots, (short)bspline.Degree, bspline.IsClosed);
return new netDxf.Entities.Spline(poles, null, knots, (short)bspline.Degree, bspline.IsClosed);
}

private netDxf.Entities.Polyline3D ExportPolyline(GeoObject.Polyline polyline)
Expand Down

0 comments on commit 2418191

Please sign in to comment.