CadLwPolyline Coordinates including (0,0) cause incorrect shape

Any CadLwPolyline with a coordinate of 0,0 ignores that point as valid coordinate. You can use the following example from another post to view the issue. This will render a triangle rather than a rectangle.

using (CadImage cadImage = (CadImage)new DxfImage(CadAcadVersion.AC1032))
{

CadLwPolyline polyline = new CadLwPolyline();
polyline.Coordinates = new List();
polyline.Coordinates.Add(new Cad2DPoint(0d, 0d));
polyline.Coordinates.Add(new Cad2DPoint(0d, 10d));
polyline.Coordinates.Add(new Cad2DPoint(20d, 10d));
polyline.Coordinates.Add(new Cad2DPoint(20d, 0d));
polyline.Flag = CadLwPolylineFlag.Closed;
polyline.ConstantWidth = 0.1;

CadHatch hatch = new CadHatch();
hatch.PatternName = “SOLID”;
hatch.ColorId = 1; // index of color: AutoCAD Color Index RGB Equivalents
hatch.HatchPatternType = 1; // 0 = User-defined; 1 = Predefined; 2 = Custom, we support only predefined now
hatch.BoundaryPaths = new List();
CadHatchBoundaryPathContainer container = new CadHatchBoundaryPathContainer();
container.BoundaryPath = new List();

CadEdgeBoundaryPath path = new CadEdgeBoundaryPath();
path.Objects = new List();
path.Objects.Add(new CadBoundaryPathLine() { FirstPoint = new Point2D(-5, -5), SecondPoint = new Point2D(-5, 10) });
path.Objects.Add(new CadBoundaryPathLine() { FirstPoint = new Point2D(-5, 10), SecondPoint = new Point2D(20, 10) });
path.Objects.Add(new CadBoundaryPathLine() { FirstPoint = new Point2D(20, 10), SecondPoint = new Point2D(20, -5) });
path.Objects.Add(new CadBoundaryPathLine() { FirstPoint = new Point2D(20, -5), SecondPoint = new Point2D(-5, -5) });

container.BoundaryPath.Add(path);
hatch.BoundaryPaths.Add(container);

List entities = new List();
entities.Add(polyline);
entities.Add(hatch);
cadImage.Entities = entities.ToArray();
cadImage.UpdateSize();

}

@kevin.kilburn,
we can confirm the issue, and have created CADNET-10039 to cover it.

Thanks. Can you set the transparency on the hatch? i want to generate something similar to the attached image. the blue box has a #7099C64C color.

image.png (148.9 KB)

@kevin.kilburn,
please try if this is helpful:

CadHatch hatch = new CadHatch();
hatch.Transparency = 100;

If not please attach the DXF file with the sample of required hatch, we will try to reproduce.