70001869 Offset issue with complex polyline

Article 70001869
Type Wish
Product Engine
Version 8006
Date Added 11/10/2020 12:00:00 AM
Fixed 9.9001.0.1 (1/14/2021 12:00:00 AM)
Submitted by Patty Snow

Summary

Offset issue with complex polyline

Solution

In version 8007.0.1 offset algorithm was improved to support kepping of arc segments in the ofssetresults and with better performance.
A new static property VectorDraw.Geometry.PlineOperations.UseAdvancedAlgorithm was added
Get / Set if the new Advanced Offset Algorithm is used.
It can be one or more of the VectorDraw.Geometry.PlineOperations.AdvancedAlgorithm enum values
AdvancedAlgorithm.None No advanced geometry algorithm is used.
AdvancedAlgorithm.UseOffset Use the advanced geometry algorithm for offset that keep the bulges for the created curves
AdvancedAlgorithm.UseUnion Use the advanced geometry algorithm for union between polylines. see vdPolyline.Union method
Defalt value is AdvancedAlgorithm.UseOffset

Example for advanced offset

PlineOperations.AdvancedAlgorithm ov = VectorDraw.Geometry.PlineOperations.UseAdvancedAlgorithm;
VectorDraw.Geometry.PlineOperations.UseAdvancedAlgorithm |= PlineOperations.AdvancedAlgorithm.UseOffset;
vddocument.CommandAction.CmdOffset(null, null, null);

VectorDraw.Geometry.PlineOperations.UseAdvancedAlgorithm = ov;//restore the UseAdvancedAlgorithm if you like.




Example of vdPolyline Union with advanced algorithm


                doc.Prompt("Select objects");
                vdSelection set = doc.ActionUtility.getUserSelection();
                doc.Prompt(null);
                vdPolyline pl = new vdPolyline(doc);

                PlineOperations.AdvancedAlgorithm ov = VectorDraw.Geometry.PlineOperations.UseAdvancedAlgorithm;
                VectorDraw.Geometry.PlineOperations.UseAdvancedAlgorithm |= PlineOperations.AdvancedAlgorithm.UseUnion;
                bool suc = pl.UnionEx(set, false);
                VectorDraw.Geometry.PlineOperations.UseAdvancedAlgorithm = ov;//restore the UseAdvancedAlgorithm if you like.

               //if succed start a cmdmove with the result polyline
                if (suc)
                {
                    doc.Model.Entities.AddItem(pl);
                    suc = doc.CommandAction.CmdMove(pl, pl.BoundingBox.MidPoint, null);
                    if (!suc) pl.Deleted = true;
                }

Send comments on this topic.