Closed DeepankarGupta13 closed 1 year ago
I think this is wrong, this is confusing give me some time to investigate please.
I said this wrong because there is 2 private functions: pattern and gradient each one handle a hatch type, because of that I hard coded those values. I think this is not the correct way, sorry for the inconvenience.
Okay Sir Thank You
I have added solid hatching, by changing the group code 450 to 0 I have added a variable hatchType, when set to solid will export the hatch as solid. For gradient it should be 1. Please check once before approving. It's working but I am not sure about the methodology whether it is correct or not.
HOW TO USE:
const polyline = new HatchPolylineBoundary(); polyline.add(vertex(0, 0)); polyline.add(vertex(0, 20)); polyline.add(vertex(10, 20)); polyline.add(vertex(10, 0));
const boundary = new HatchBoundaryPaths(); // Add the defined path boundary.addPolylineBoundary(polyline);
const mysolid = gradient({ hatchType: HatchType.SOLID, // firstColor: 2, // secondColor: 2, })
const hatch = dxf.addHatch(boundary, mysolid, { colorNumber: 30, });