70001855 VdPolyhatch does not export Clipping Operation on VDS format

Article 70001855
Type Wish
Product WebJS
Version 8005
Date Added 11/2/2020
Fixed 8.8006.0.4 (11/3/2020)
Submitted by VectorDraw Team

Summary

VdPolyhatch does not export Clipping Operation on VDS format when it contains PolyCurves with Operation other than ClippingOperation.XOr

Solution

Clipping Operation supported in version 8006.0.4
Clipping Operation of each polycurve is saved to web control vds file format
the following clipping operations are supported:

gpc.OPER_DIFF = 0;
gpc.OPER_INT = 1;
gpc.OPER_XOR = 2;
gpc.OPER_UNION = 3;
Also a new property Opers is added for vdPolyhatch object (see following example)

//Example: 
                //add a polyhatch filled with a main rect and 2 holes inside
                var outsiderect = [[0, 0, 0], [6, 0, 0], [6, 6, 0], [0, 6, 0], [0, 0, 0]];//main outside rect
                var insiderect1 = [[2, 1, 0], [4, 1, 0], [4, 2, 0], [2, 2, 0], [2, 1, 0]]; //inside hole 1
                var insiderect2 = [[2, 3, 0], [4, 3, 0], [4, 4, 0], [2, 4, 0], [2, 3, 0]]; //inside hole 2
                
                var outlines = [outsiderect, insiderect1, insiderect2];
                
                var polyhatch = vdcanvas.AddPolyHatch(null, outlines);//NOTE: we not set filled curves they will be calculated by clipping passed outlines with  polyhatch.Opers 
                polyhatch.Opers = { Items: [gpc.OPER_DIFF, gpc.OPER_DIFF, gpc.OPER_DIFF] };//NOTE: number of items must be equal to the number of polyhatch.OutLines.Items
                polyhatch.PenColor = vdConst.colorFromString("0,255,0,255");//outline color
                polyhatch.HatchProperties = vdcanvas.createNewHatchProperties('solid', null, vdConst.colorFromString("255,0,0,255"), 1.0, 0.0);
                polyhatch.HatchProperties.DrawBoundary = true;//support draw outlines
                vdcanvas.UpdateFig(polyhatch);
                setTimeout(vdcanvas.redraw);

Send comments on this topic.