mtimmerm / gearcutter

Creative Commons Attribution 4.0 International
2 stars 0 forks source link

DXF export produces strange lines #1

Closed Tobias4git closed 9 months ago

Tobias4git commented 10 months ago

I tried to use your tool to generate a 6 tooth pinion using your online instance. I clicked chose DXF for format. It was named svg but the file content was clearly dxf. Autodesk Inventor (2014) imported it like this:

image

You wrote that the idea was to use arc's only to ease machining. I'm appreciating this approach. The generated dxf contains many splines (the dotted lines lead to the anchors of the splines). IMHO splines are always the beginning of disaster, because there interpretation is highly software dependent. Do you use splines for the svg as well?

Thanks for clarification, Tobias

mtimmerm commented 10 months ago

Send me the link to your gear in gearcutter and I'll have a look.

The tool generates only circular arcs. In DXF, though, these are represented by SPLINE objects They're "rational b-splines" with the parameters set to make perfect circular arcs. DXF has a separate primitive for circular arcs, but I don't use it, because the way that the arcs are specified causes disconnected outlines that break Fusion 360. 2014 was a long time ago – it might be that your version of inventor doesn't understand the format properly.

The misnaming of the downloaded file seems very strange. What browser do you use?

Cheers,

Matt


From: Tobias @.> Sent: January 14, 2024 4:30 PM To: mtimmerm/gearcutter @.> Cc: Subscribed @.***> Subject: [mtimmerm/gearcutter] DXF export produces strange lines (Issue #1)

I tried to use your tool to generate a 6 tooth pinion using your online instance. I clicked chose DXF for format. It was named svg but the file content was clearly dxf. Autodesk Inventor (2014) imported it like this:

image.png (view on web)https://github.com/mtimmerm/gearcutter/assets/72009731/6ae44668-07de-4313-acde-8a90fdb53cf7

You wrote that the idea was to use arc's only to ease machining. I'm appreciating this approach. The generated dxf contains many splines (the dotted lines lead to the anchors of the splines). IMHO splines are always the beginning of disaster, because there interpretation is highly software dependent. Do you use splines for the svg as well?

Thanks for clarification, Tobias

— Reply to this email directly, view it on GitHubhttps://github.com/mtimmerm/gearcutter/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABXYLQRP4S3UJT2HVN74NDTYORE65AVCNFSM6AAAAABB2MBM76VHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DAOJQGQ4TMMQ. You are receiving this because you are subscribed to this thread.

mtimmerm commented 10 months ago

Oh, I forgot to answer your question about SVG: No, in SVG I use the circular arc primitive, which doesn't have the problem that the DXF primitive does. Because of the way SVG makes arcs, though, rounding errors in the SVG might​ create tiny line segments between arcs that should be connected, depending on how your tool converts SVG arcs to its own internal format.


From: Tobias @.> Sent: January 14, 2024 4:30 PM To: mtimmerm/gearcutter @.> Cc: Subscribed @.***> Subject: [mtimmerm/gearcutter] DXF export produces strange lines (Issue #1)

I tried to use your tool to generate a 6 tooth pinion using your online instance. I clicked chose DXF for format. It was named svg but the file content was clearly dxf. Autodesk Inventor (2014) imported it like this: image.png (view on web)https://github.com/mtimmerm/gearcutter/assets/72009731/6ae44668-07de-4313-acde-8a90fdb53cf7 You wrote that the idea was to use arc's only to ease machining. I'm appreciating this approach. The generated dxf contains many splines (the dotted lines lead to the anchors of the splines). IMHO splines are always the beginning of disaster, because there interpretation is highly software dependent. Do you use splines for the svg as well?

Thanks for clarification, Tobias

— Reply to this email directly, view it on GitHubhttps://github.com/mtimmerm/gearcutter/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABXYLQRP4S3UJT2HVN74NDTYORE65AVCNFSM6AAAAABB2MBM76VHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DAOJQGQ4TMMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Tobias4git commented 10 months ago

Thank you for your quick response. If you click on https://mtimmerm.github.io/webStuff/gearcutter.html or click on the 6 teeth gear link https://mtimmerm.github.io/webStuff/gearcutter.html#cr=1.5&gt=30&pt=6&ps=40 it happens the same, the file has the ending .svg. I'm using Firefox on OSX: image

It is true that my Autodesk version is pretty old. I dont like their new licence model so 360 is not an option for me. Autodesk is the inventor of the dxf format, I would assume they still have people who know how to decode it.

You're right in not using the circle primitive. I think you have to use the polyline with the bulge feature. Nearly all machine interfaces use dxf - exactly for that reason: to have an uninterupted path consisting of lines and arcs. GCode M2 and M3 have the same logic like svg, use implicitly the current point and specify the endpoint of the next segment - even if it is an arc. Hopefully I have next week some time to look into it. I'll will report my findings.

Tobias4git commented 10 months ago

Cambam displays your file correctly. I transformed it (using Cambam) into a polyline and exported it again as dxf. Now it is usable by autodesk. So I have a working solution :-) Still I still think the polyline would be the "nicer" solution. github doesnt like dxf's, I'm trying as zip:

pinion6pa20.zip

Kind regards

Tobias

PS: Sorry I should think first, the polyline consists still of many paths. The corrected version with two closed polylines, one circle and one for the shape: pinion6pa20-onePolyline.zip

mtimmerm commented 10 months ago

Ah, thanks! I didn't know about the polyline bulge feature in DXF. That's actually how I represent the arcs internally, and I would like that a lot better than using NURBS. I'll switch it when I get a chance, if it works just as well in Fusion 360.


From: Tobias @.> Sent: Monday, January 15, 2024 1:35 PM To: mtimmerm/gearcutter @.> Cc: Matt Timmermans @.>; Comment @.> Subject: Re: [mtimmerm/gearcutter] DXF export produces strange lines (Issue #1)

Cambam displays your file correctly. I transformed it (using Cambam) into a polyline and exported it again as dxf. Now it is usable by autodesk. So I have a working solution :-) Still I still think the polyline would be the "nicer" solution. github doesnt like dxf's, I'm trying as zip:

pinion6pa20.ziphttps://github.com/mtimmerm/gearcutter/files/13943171/pinion6pa20.zip

Kind regards Tobias

— Reply to this email directly, view it on GitHubhttps://github.com/mtimmerm/gearcutter/issues/1#issuecomment-1892788133, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABXYLQXWK5URQJSLIR3TUBDYOWOKJAVCNFSM6AAAAABB2MBM76VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJSG44DQMJTGM. You are receiving this because you commented.Message ID: @.***>

mtimmerm commented 10 months ago

export extension fixed. I was sending the SVG Content-Type with the DXF download, and firefox actually renames the file to match it.

Tobias4git commented 10 months ago

Works as expected, Thanks!

mtimmerm commented 9 months ago

Switched DXF export to a simpler version R12 format with POLYLINEs

Tobias4git commented 9 months ago

Works as expected. Just One closed polyline. Thank you!