A simple DXF generation library.
yarn add dxf-composerimport { DxfDocument, DxfBlock } from 'dxf-composer';const dxfDocument = new DxfDocument(units);dxfDocument.addLine(x1, y1, x2, y2, layer);
dxfDocument.addCircle(x, y, radius, layer);
dxfDocument.addArc(x, y, radius, startAngle, endAngle, layer);dxfDocument.addRectangle(width, depth, x, y, layer);
dxfDocument.addRoundedRectangle(width, depth, radius, x, y, layer);dxfDocument.addAlignedDimension(x1, y1, x2, y2, extX, extY, textX, textY, layer);
dxfDocument.addSimpleAlignedDimension(x1, y1, x2, y2, 'up', layer);
dxfDocument.addDiameterDimension(x1, y1, x2, y2, textX, textY, layer);
dxfDocument.addSimpleDiameterDimension(x, y, diameter, angle, layer);const dxfBlock = new DxfBlock('aBlock');
dxfBlock.addRectangle(width, depth, x, y, layer);
dxfDocument.addBlock(dxfBlock);
dxfDocument.addBlockReference('aBlock', x, y, layer);const dxfString = dxfDocument.toString();yarn installyarn devyarn watchyarn prod