LaserWeb/deprecated-LaserWeb2

Check this .dxf

r0773nluck opened this issue · 12 comments

when i try to generate this .dxf into gcode it takes all circles/ovals/arcs and places them at the origin. I am exporting the dxf out of fushion 360 and also tried and addon to convert polylines and had the same error. it does it with all arcs in dxf i generate in fushion 360, but no always to the origin sometimes just to the y0 location.

controlpanel2
control panel

I dont see a problem when opening on my side?

Show screenshot?

Ok, managed to replicate...

weird

Investigating cause now (suspect it started happening after the recent cnc-cam additions, was still working fine last week )

NB: This happens with CIRCLE objects, so exploding circles into polylines will still fix the issue. Polylines are awesome for cam. really worth learning the skill

I could replicate yesterday as seen bellow but i remembered i did a mini
wheel plate last week and should have had the issue then

On Sun, Jul 10, 2016 at 6:45 AM, Peter van der Walt <
notifications@github.com> wrote:

Ok, managed to replicate...

[image: weird]
https://cloud.githubusercontent.com/assets/7695323/16713319/6ec93ce0-46a4-11e6-9c3e-8d8f2cb1ae10.PNG

Investigating cause now (suspect it started happening after the recent
cnc-cam additions, was still working fine last week )


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#75 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/APrsFsTUq8hlioSYbYfhtQSxGAWj-nbQks5qUNtDgaJpZM4JIw-u
.

Ariel Yahni

i just noticed when you opened my file you did not convert to gcode the issue only shows up after converting to gcode and selecting gcode view

Yeah figured that out eventually. Thats why adding a screenshot when opening an issue helps so much - less guesswork (;

Anyway, in LaserWeb2 (openhardwarecoza.github.io/LaserWeb2) it still works. (Good think, proves it was working and broke recently - since LaserWeb3 isnt even a month old yet)

Since the Preview looks correct, it means the DXFrender etc is fine. So the issue must be in the ->gcode part.
Thats entirely done in threegcode.js. Luckily with Github we have a full version history of all the changes to that file: See https://github.com/openhardwarecoza/LaserWeb3/commits/master/public/js/threegcode.js

I made a LOT of changes to it to support the CNC cam, so likely one of them broke it. Its now a timoues task to roll back and bisect these changes to find which broke it.

It should take a day or two to hunt it down. In the meantime, pass your DXF through draftsight/qcad/autocad and explode the arcs/circles to plain polylines.

Cool thank you so much ill try processing thorugh draftsight sorry for the late screenshot response

I figured out why it happens!

DXF circle geometry is drawn with two sets of coordinates: Local (references line segments in relation to the center point of the circle) and "World" which relates to the rest of the drawing.
In laserWeb2 the object used to create the Gcode is present in the THREE.js scene, thus when I call localToWorld() in threegcode.js, since it is in the scene, the maths knows how to relate its local coordinates and compensate those to world coordinates.

In Laserweb3 - we dont generate off the Scene, we generate from THREE.objects in an array. Since this array isnt in the scene, the localToWorld() can't compute where they are in relation to the drawing.

Now to come up with a solution to this. Not as easy. I recall I had a similar issue with the preview stage back in February... Got to figure out how to convert local to world for objects without using the dom.

i wish i could help with that but on a side note i imported my dxf into draftsight how do i convert all things to poly lines?

i shared a link in G+ this morning with you in that comment thread

Here we go: See LaserWeb/deprecated-LaserWeb3@c8afc0b

And now it looks like:

after fix

Test and let me know if this fixed your issue (:
If it did, consider buying me a beer (; http://openhardwarecoza.github.io/donate/

well you did it amazing