Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error The number of control points must be the same as the number… #111

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

dsn27
Copy link
Collaborator

@dsn27 dsn27 commented Oct 26, 2022

Wrong parameter was set here. It should be null if the spline has no 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);

Fix the error:

Exception Source: CADability
Exception Type: System.ArgumentException
Exception Message: The number of control points must be the same as the number of weights.
Parametername: weights
Exception Target Site: .ctor

---- Stack Trace ----
netDxf.Entities.Spline..ctor(controlPoints As IEnumerable1, weights As IEnumerable1, knots As IEnumerable1, degree As Int16, fitPoints As IEnumerable1, method As SplineCreationMethod, closedPeriodic As Boolean)
Spline.cs: line 0286, col 17
netDxf.Entities.Spline..ctor(controlPoints As IEnumerable1, weigths As IEnumerable1, knots As IEnumerable`1, degree As Int16, closedPeriodic As Boolean)
Spline.cs: line 0220, col 15
CADability.DXF.Export.ExportBSpline(bspline As BSpline)
ExportDxf.cs: line 0173, col 17
CADability.DXF.Export.GeoObjectToEntity(geoObject As IGeoObject)
ExportDxf.cs: line 0053, col 49
CADability.DXF.Export.WriteToFile(toExport As Project, filename As String)
ExportDxf.cs: line 0038, col 17
CADability.Project.Export(fileName As String, format As String)
Project.cs: line 1210, col 21
LogiCal.WiCamExportHelper.SaveCadDrawing(pos As Position, filename As String)
WiCamExportHelper.cs: line 0445, col 17
LogiCal.WiCamExportHelper.ProcessPosition(keepOrigFileName As Boolean, PosCount As Int32&, sb As StringBuilder, pos As Position)
WiCamExportHelper.cs: line 0366, col 25
LogiCal.WiCamExportHelper.FillCsvDetailsPart(keepOrigFileName As Boolean)
WiCamExportHelper.cs: line 0283, col 35
LogiCal.WiCamExportHelper.FillCsvContent(keepOrigFileName As Boolean)
WiCamExportHelper.cs: line 0210, col 13
LogiCal.WiCamExportHelper.MakeCsv(csvFile As String, keepOrigFileName As Boolean, saveCsv As Boolean)
WiCamExportHelper.cs: line 0107, col 13
LogiCal.WiCamExportHelper.ExportToWiCam(outputPath As String, keepOrigFileName As Boolean, saveCsv As Boolean)
WiCamExportHelper.cs: line 0090, col 17
LogiCal.MainForms.Orders.<>c__DisplayClass720_0.<bbiExportWiCam_ItemClick>b__0()
frmAuftrag.cs: line 4175, col 21
System.Threading.ExecutionContext.RunInternal(executionContext As ExecutionContext, callback As ContextCallback, state As Object, preserveSyncCtx As Boolean)
: N 00370
System.Threading.ExecutionContext.Run(executionContext As ExecutionContext, callback As ContextCallback, state As Object, preserveSyncCtx As Boolean)
: N 00021
System.Threading.ExecutionContext.Run(executionContext As ExecutionContext, callback As ContextCallback, state As Object)
: N 00085
System.Threading.ThreadHelper.ThreadStart()
: N 00085

@dsn27 dsn27 added the bug Something isn't working label Oct 26, 2022
@dsn27 dsn27 self-assigned this Oct 26, 2022
@dsn27 dsn27 merged commit 2418191 into master Oct 26, 2022
@dsn27 dsn27 deleted the FixSplineDxfEport branch November 9, 2022 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant