QCAD Bugtracker

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category ECMAScript
  • Assigned To
    Andrew
  • Operating System Windows 7
  • Severity Very Low
  • Priority Very Low
  • Reported Version 3.26.1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
    • CVH (23.03.2021)
  • Private
Attached to Project: QCAD Bugtracker
Opened by CVH - 22.03.2021
Last edited by Andrew - 12.04.2021

FS#2218 - RPolyline.appendVertex() doesn't default to width = zero

When I use poly.appendVertex(vector, bulge) the polyline is finally created with NAN widths

This, while the signature explains that bulge, width1 and width2 default to zero.
https://www.qcad.org/doc/qcad/latest/developer/class_r_polyline_entity.html#a9ee706e50d6cc267fc84a85b7c81d5e6

Regards,
CVH

Closed by  Andrew
12.04.2021 06:01
Reason for closing:  Works for me
Admin
Andrew commented on 10.04.2021 08:42

I cannot reproduce:

ecma> var pl = new RPolyline();
ecma> pl.appendVertex(new RVector(0,0));
ecma> pl.appendVertex(new RVector(10,0));
ecma> pl.appendVertex(new RVector(10,10), 0.5);
ecma> pl.getStartWidthAt(0)
0
ecma> pl.getStartWidthAt(1)
0
ecma> pl.getStartWidthAt(2)
0

If you cannot solve the problem, please provide more context.

CVH commented on 10.04.2021 13:29

Sorry Andrew,
I wouldn't trouble myself with filing it ...
Nor circumvented it 8x with a fix in DrawFromCSV.

I can't reproduce it any more.
Even not in an older form: newData = new RPolylineData();
I usually test things out thourough before documenting it.
This time I didn't kept the testfiles as the goal was to create them from CSV.

Recombining with OC might introduce NaN values but I have to exclude that I exploded the created polylines and recombined them back with OC, and that every test again.

While modifiying the script back I see my mistake ...
newShape = new RPolyline(refs, true/false); with for 'refs' an array of RVectors.
@ Line:841, 888, 941 ,975 & 1000 create the NaN's!

My mistake.
Please close the bug report.
Regards,
CVH

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing