← All bug reports

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

Type
Bug
Status
Closed
Resolution
Works for me
Category
ECMAScript
Severity
Very Low
Priority
Low
Reported version
3.26.1
Operating system
Windows 7
Reported
2021-03-22 by CVH
Closed
2021-04-12 by andrew
Votes
1

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

Comments (2)

andrew 2021-04-10

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 2021-04-10

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