microsoft / microsoft/maker.js
Unexpected output when using usePOLYLINE with DXF exporter
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 302
- Avg merge
- 21h 28m
- Merged PRs (30d)
- 5
Description
I'm seeing an inconsistency in the output of the DXF exporter between having usePOLYLINE enabled and disabled. I'm in the process of reducing a reproducible case to the point where looking at the generated DXF text is manageable; but I thought I'd share what I have now.
To reproduce:
- Run the following in a Maker.js playground:
var makerjs = require('makerjs');
function polylineBug() {
var pathData = `
M48,30 L50,30
M50,15 L50,20 Z
M50,25 L55,20 L50,20 Z
L50,30
`;
return makerjs.importer.fromSVGPathData(pathData);
}
module.exports = polylineBug;
- Export as a DXF via button beneath model view. Enable the Use POLYLINE option, and choose Max accuracy. (Bug appears to happen on any accuracy.)
Here's what I'm seeing in the exported DXF with POLYLINEs enabled. Note the missing segment on the left side of the triangle:

Here's a DXF of the same model, exported with Use POLYLINE disabled. The segment on the left side of the triangle is back:

Some other interesting values for pathData which do not trigger the bug:
M48,30 L50,30
M50,15 L50,20 Z
M50,20 L55,20 L50,25 Z // reversing the direction of the problem triangle
L50,30
M48,30 L50,30
M50,15 L50,19 Z // breaking the chain between y=19, y=20
M50,25 L55,20 L50,20 Z
L50,30
From fiddling around with values in pathData, it seems like the bug is not triggered when the chain including the segments at x = 50 is broken. (Uncertain if this would be considered a real "chain" in Maker.js's terminology – I'm realizing that I should read through the chain documentation.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided Maker.js playground example and export it as DXF with Use POLYLINE enabled and disabled. Inspect the DXF exporter’s POLYLINE handling and chain processing while comparing the generated output. Done means the reproducer preserves the missing triangle segment when POLYLINE is enabled, with coverage for the reported path data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100