Polyline edit functions

Usually there is, but A) These are mostly interactive tools that require user input, indicating entities, cursor positions, options …
B) It is uncertain if these remain the same, they may change or be removed without notice.

Although (A), there is mostly a piece of code that preforms the actually offset and returns shapes. :wink:
OC: PolylineFromSelection and getAffectedObjects
OR: No example but basically: QCAD: RPolylineProxy Class Reference
OF in general:

Here is a complex story about proper offsets: How to get coordinates according to step value - QCAD Script Programming & Contributions - QCAD Forum
Bottom line … It ain’t finished, it might or might not work out.
All fine for basic stuff, for simple geometry, but it might fail when it gets more complex.
With the knowledge on this matter I can construct an arbitrary polyline where OQ would fail.

Especially problematic if the base entity self-intersects or if the resulting offset self-intersects.
The problems with polylines usually start with bulging segments (aka Arc-segments) and how they are joined to form a polyline.
Then, tangentially connected is more prone to errors. Basically a clash of tolerances.
Handling polylines is about always done by deconstructing them to segments (RShape’s) and joining segments back to a RPolyline shape.

General advice: Trim segment entities pair-wise before joining (OC) them to a polyline entity.
For Arcs this would ensure that the polar form matches as good as it gets with the end-point so far.
Arcs don’t have start and end-points, they have ending angles, a bulging segment has two ending points.

Regards,
CVH