-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue converting different objects to a closed dxf #480
Comments
Hello, this looks like it might be a problem with "accuracy" settings. These can be fiddly. Accuracy settings depend on your application and units. For example, if you are outputting to a computer screen, the units would be pixels, and you can probably use accuracy of 0.5 (half a pixel) for good results. In your example, you are importing SVG. Can you add your example SVG? Also, you should not use |
Thanks for your fast reply! An accuracy of 0.5 doesn't work either. It looks like the lines are a little bit shifted in direction of the y-axis. Here is a sample svg containg two lines, a semi-circle (arc) and a semi-ellipse (bezier-seed): |
Here you can find the code for the semi-ellipse if needed:
|
Here's a demo converted for use in the Playground: var makerjs = require('makerjs');
function demo() {
var svgPath1 = makerjs.importer.fromSVGPathData("M420.671875 544.25 A 130.5344782040362 71.23982803281127 178.68308759420674 0 1 159.671875 550.25");
var svgPath2 = makerjs.importer.fromSVGPathData("M149.671875 294.25 A 146.88703491966612 146.88703491966612 0 0 1 407.671875 284.25");
var line1 = new makerjs.paths.Line([159.671875, -550.25], [149.671875, -294.25]);
var line2 = new makerjs.paths.Line([407.671875, -284.25], [420.671875, -544.25]);
this.paths = {
line1, line2
};
this.models = {
svgPath1, svgPath2
};
var chains = makerjs.model.findChains(this);
console.log(chains.length)
console.log(chains[0].endless)
}
module.exports = demo; It finds one endless chain. Does it export to DXF correctly? |
Thanks. Yes, your code exports a correct and closed DXF. This is my working code (based on your demo):
|
Hi Maker.js developers!
I try to convert an SVG with lines, circles, arcs & ellipses to a DXF.
This approach is working as long as the objects are of the same type (only lines or only arcs...). As soon as the objects are mixed, they are not properly connected and are overlapping a tiny little bit or a small cap is created. Thus, it's not a chain any more.
If I zoom in very close it looks like this:

Does anyone have an idea how to fix this issue so that all objects are merged properly?
The text was updated successfully, but these errors were encountered: