… to lengthen polylines on the tangent to first or last arc.
it works fine but not for circle arcs that have to be transform into polyline.
Another little thing:
I just add some code lines to the script and to the UI filebut… svg icon is now not visible on the toolbar. Why?
LengthenInit.js (540 Bytes)
Lengthen.js (6.98 KB)
Lengthen.ui (1.24 KB)
First I have to point out that using existent class names will overwrite the original code.
All fine if you want to override the behavior of standard class of course. ![]()
QCAD looks for the icon files in the script location.
Since recently they are no longer implicitly referenced to in the init section.
Depending on your QCAD version it might that you need to include an implicit reference.
Lengthen.js is included in compiled form in a standard installation.
That virtual path and your custom path is most probably not the same.
I remember having the same issues, even with implicit referencing.
The easiest way with superseding existent classes that I know of is to include a copy of the icons in your custom path.
These can be sourced from GitHub when it is open source. Download the RAW file and store it under the same name.
There are usually 2 versions, the default one and the inverse one for the Dark mode.
If not open source then … There are ways to source the compiled ones.
But these are essentially proprietary and thus … ![]()
Regards,
CVH
Again rather custom.
For shortening it is straightforward, when logically closed there is no solution.
The logical way to lengthen a polyline is to elongate the last segment.
- A line segment would become longer.
- An arc segment sweep would become larger.
Cath22: The sweep angle can not be 360°or exceed that.
For the simple reason that bulge = tan(sweep/4) = tan(360°/4) = tan(90°) is an error.
And that tan(89°) = - tan(91°) … Or the bulge would swap sides instead of ‘growing’.
Adding something straight in the end tangent direction is nice but not my idea of elongating a polyline in a natural fashion.
There once was a request to lengthen splines but there is no natural way of doing that.
You mention ‘not for circle arcs’ but that I don’t understand.
Any arc will be lengthen by the tool but the outcome will be truncated to start and end within 0° < angle <= 360°.
You can’t convert a full circular arc into a polyline with one segment (see above) it will be 2 semi-circular segments and the starting point is free.
Elongating that tangentially at the end point should be feasible as any arc segment.
Regards,
CVH