Closed prcdslnc13 closed 8 years ago
Thanks, will invesigate, would be in millcrums dxf parser, dxf.js.
Tried a drawing from autocad and got similar but actually less consistent results. 1 of the arcs at the lower right corner actually output correctly, which is interesting.
Ties in with https://github.com/openhardwarecoza/LaserWeb/issues/27 to a degree
My personal workflow is sketchup -> Guitarlist plugin as polyline dxf -> Laserweb Sketchup renders arcs and circles as line segments anyway - always much easier. Arcs is tough, since the standard is "each has their own standard"
https://github.com/openhardwarecoza/LaserWeb/blob/master/i/millcrum/inc/dxf.js#L201 would be where to start digging, along with http://www.autodesk.com/techpubs/autocad/acad2000/dxf/arc_dxf_06.htm and some sample files to check. Anyone want to help?
@prcdslnc13, in autocad, can you try https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-Core/files/GUID-0C422AA9-23DD-4650-AD66-68E9D7989E3F-htm.html = split the Arcs into Polylines? Revert with feedback
I fixed a bug in the 3D viewer's handling of G3 arcs, but still looks like a DXF parser issue in your case
@buserror - I note you too have been playing with Millcrum.
Any chance you can assist in fixing some bugs in the Arc handling - Andrew doesnt want to spend any time on it anymore and I don't have the skills
@openhardwarecoza that is actually what I do for all these. It makes LaserCAD and most of the CNC software I use work right. Ill pull down the latest version, Im curious what happens when I explode the lines and what they look like. But right now everything is a poly line.
@openhardwarecoza exploded lines and arcs dont process at all so thats a bad plan. I did a quick try of different dxf versions. r12 2000-2002, 02-04, and 2013 in both binary and ascii. Binary didnt process at all in any of the versions. R12 didnt bring the polylines over. The 00-02, 02-04 versions had the issue I sent earlier. I typically use 00-02. The 2013 failed. I can try again and copy some of the errors if its useful. Sorry I looked at the code but I am not a coder by heart so its a bit over my head. I sent it to a fiend of mine thats a big js guy. He may or may not be able to help.
Some DXF with arcs, done in inkscape. Export via regular save as and openscad dxf output plugin Archive.zip
@openhardwarecoza well not sure, I submitted a small merge request a few weeks ago and he hasn't replied, or merged so I don't see the point at the minute..
Thanks @buserror , sadly https://github.com/openhardwarecoza/LaserWeb/issues/27#issuecomment-167587329 is the reason I guess. Well, I'll follow you here (: If you do anything cool with CAM let me know (:
Ok, so today I sat down and started playing with this:
Both find the same data ... so millcrum's dxf.js isnt broken too badly in the parsing department - it is lacking a few entity types though so I think we will move away from it still if possible (plus upstream support is a big plus we need - someone who actually merges pulls, and helps fix bugs)
Where MC then presumably chokes completely would be in the code where it takes 'arcs' and converts them to 'polylines' or rather a bunch of G1 moves. We don't really need that, I think. Grbl, Marlin, Smoothie all have G2/G3 arc support? I presume MC used the lines to more easily calculate paths (since the original purpose of dxf.js was to parse dxfs to millcrum for use on millcrum.com - not really as a direct to gcode generator)
So to push forward with this we need to take: https://github.com/openhardwarecoza/LaserWeb/blob/master/i/dxf/renderer.js and for each of:
https://github.com/openhardwarecoza/LaserWeb/blob/master/i/dxf/renderer.js#L113 https://github.com/openhardwarecoza/LaserWeb/blob/master/i/dxf/renderer.js#L173 https://github.com/openhardwarecoza/LaserWeb/blob/master/i/dxf/renderer.js#L259 (Text is a tricky one - easy to do in three.js but not easy to do in gcode) https://github.com/openhardwarecoza/LaserWeb/blob/master/i/dxf/renderer.js#L241 (solid - I dont think we want to support that one) https://github.com/openhardwarecoza/LaserWeb/blob/master/i/dxf/renderer.js#L204
we need to just add gcode writers (currently it creates three.js objects)
simply gcode += 'G.......F....' is all I need to integrate it deeper into laserweb...
My new setup would then be (since this can draw straight to three.js)
@bzuillsmith - we love your library!
@cojarbi - this new library even opens the Inkscape DXFs! WOW!
heres a few trouble DXFs you can test with - laserweblogo works in Millcrums doesnt work in dxf-parser+https://github.com/gdsestimating/three-dxf) (Because dxf-parser/three-dxf does not have polyline support - see https://github.com/gdsestimating/three-dxf/issues/1) - hope we can help the upstream author and add it (:
The rest works not at all in millcrum (or works but displays totally wrong) but draws really nicely in dxf-parser+https://github.com/gdsestimating/three-dxf)
Will try it today
@cojarbi read the rest of what i wrote above it. Nowhere near testing phase. We know it can read it. But its not spitting gcode just yet
@openhardwarecoza Thanks! Haven't had as much time to continue developing three-dxf (just had a baby!) but if you post some issues, I will certainly continue to do so when I have time. I also take pull requests. Posting some issues to dxf-parser and three-dxf would also motivate me to continue the work. I think it mainly handles lightweight (LW) dxf entities and not the more complex stuff yet.
Congrats on the little one! Mines turning 6 this year. Sleep does return! But i will be very forgiving of slow Replies (:
Your lib is knocking the socks of the one we use at the moment. Just need to sit down, crunch through, and add the gcode writers. But having three.js in there (and its already a big part of laserweb) just fits the two together like a glove!
Ps: if you have a to do list, open an issue on your projects. We have around 10-12 people here contributing code and about 20+ testing (: - would be beneficial to plough back some effort to you too (:
Great, Just opened a couple. The biggest ones are about block insert support. Currently they are not supported, but I don't think it would take too much effort to get some basic block support going.
PS: I also enjoy pair/mob programming, so if any of you would like to do that for any dxf-parser/three-dxf stuff, you can find me on Google Hangouts
(: better than teaming up with a rubber ducky
https://github.com/gdsestimating/three-dxf/issues/1 explains why laserweblogo.dxf in the zipped samples above doesnt show up (: - thats just polylines
Also started taking a closer look at the code & issue, thanks for the detailed writeup & examples !
I finally got the SVG issues sorted, so hopefully I can start looking at this one soon (:
Hi All.
Just checking in if anyone has made any headway with adding gcode output
(https://github.com/openhardwarecoza/LaserWeb/issues/42#issuecomment-170259893 relates)
@kaosat-dev @bzuillsmith
We have a potential sponsor for an extra laser diode, @cojarbi approached JJohnson@jtechphotonics.com - hold thumbs. It could go to the community to help polish out this feature
I've commented out the new lib for the time being - new users got tripped up when they see a render.
As a side note, any Fusion 360 users who can test drive this and report back?
Got an error while cutting a Dxf file material thickness=6mm Z down per pass=2 circle.zip
Machine stopped during the 3rd pass error: Bad number format
dxf file generated using sketchup and scaled down to 20% in laserweb
@openhardwarecoza that app didn't work for me, I will try again
Thanks for the feedback (: - would have been nice if it did. No worries, @bzuillsmith 's three-dxf has no problems reading it, so we just need to add the gcode writing (;
I'll check the circle shortly
Something is changing the S param during scaling. Bug indeed but not in the DXF, thats in the transform tool! Will fix asap
I have asked @johnlauer over in thread on https://groups.google.com/forum/#!topic/chilipeppr/VWho6tuvLJM about the possibility of working together on getting dxf support into CP (first)
@kaosat-dev @bzuillsmith - i had a sponsor approach me today and he offered a new 40w CO2 Tube + Mirrors to me to donate to a contributor. As soon as he offered, this issue sprung to mind. Any chance either of you would be up for some free bounty in exchange for adding gcode output to three-dxf (or a new library based off it) - we have so much success parsing test dxfs with @bzuillsmits 's dxf-parser and three-dxf, its really just gcode output thats missing.
If your bribe
Hi Guys
@johnlauer released a new SVG -> Gcode widget for Chilipeppr today that contained some golden code! A function to take three-js geometry from a three-js group and convert it to gcode! See https://github.com/chilipeppr/widget-svg2gcode/blob/master/widget.js#L452
This was part of the missing link we have had so far. @bzuillsmith 's library already works perfectly to get dxf data into three-js geometry. Three.js already contains code to do the heavy lifting of breaking arcs/circles into line segments (https://github.com/mrdoob/three.js/blob/ddab1fda4fd1e21babf65aa454fc0fe15bfabc33/src/extras/geometries/CircleBufferGeometry.js - also a big thanks to Ben for pointing this out to me) so with John's code, the magic storm is brewing and we are very very close to having the best DXF -> gcode parser the world has ever seen!
So far I have a tat for tat equivalent to the old millcrum code so good riddance to that (; - I'll make the frontend switch today
What is still broken is that the line segments in arcs/circles above are drawn relative to point 0,0,0 at the moment - and LocaltoWorld() function of DXF doesnt seem to be able to find their world coordinates.
Investigating, but i am already celebrating. Fixing this will be easier than fixing the old millcrum code, and most of the hard work of a new DXF library is done
Great job Peter! This was an important function to get working, and it seems that you are almost all the way there.
This is awesome news! I've been head hunting people but have had issues finding people that are as interested in this stuff as we are. Glad you are making headway Peter!
On Mon, Feb 29, 2016 at 10:33 AM, Anthony Bolgar notifications@github.com wrote:
Great job Peter! This was an important function to get working, and it seems that you are almost all the way there.
— Reply to this email directly or view it on GitHub https://github.com/openhardwarecoza/LaserWeb/issues/42#issuecomment-190279184 .
Thanks, Joe Spanier
"*No Trees were harmed in the sending of this email, but a great
number of electrons were terribly inconvenienced" *
And this now LIVE!
I temporarilly disabled OpenJSCAD (will switch it to the new toolchain over the next few days) - but please jump in and start testing DXFs!
If you find funnies, post the DXF in a new issue. Closing this Issue since it is now WRITTEN!
PS: You all owe @johnlauer a beer!
Arcs and trimmed circles in polylines come out with incorrect radii or are skipped entirely when opening .dxfs. The .dxfs are generated in the latest version of DraftSight on windows 10.
arc-test.zip