svenhb / GRBL-Plotter

A GCode sender (not only for lasers or plotters) for up to two GRBL controller. SVG, DXF, HPGL import. 6 axis DRO.
https://grbl-plotter.de/
GNU General Public License v3.0
663 stars 175 forks source link

SVG Line stroke-width map to Z value #127

Closed wwwlxs closed 4 years ago

wwwlxs commented 4 years ago

Hi sven, Feature request: Line stroke-width map to Z value(Z-Min , Z-Max)(or constrain Z-Min & Z-Max ) 1 2 line.svg.zip

svenhb commented 4 years ago

Yes, I was also thinking about that, but could not generate data for this. I planned to support a graphic-tablet and take drawing data (including pen-pressuse) inside GRBL-Plotter, but I couldnt find example code for windows-form application to include graphic-tablet (examples are always in WPF)... Anyway I will check how I could support that.

wwwlxs commented 4 years ago

or Feature request:Can GCode (with different" Z values" by pen-pressure) be imported into GRBL-Poltter just like SVG is imported into GRBL-Poltter for automatically add" A value"?

svenhb commented 4 years ago

or Feature request:Can GCode (with different" Z values" by pen-pressure) be imported into GRBL-Poltter just like SVG is imported into GRBL-Poltter for automatically add" A value"?

I don't understand. You can replace 'Z' by 'A' using the editors-replace function (also available via menu). What do you mean with "for automatically add" A value" - from where should the 'A' value come?

wwwlxs commented 4 years ago

or Feature request:Can GCode (with different" Z values" by pen-pressure) be imported into GRBL-Poltter just like SVG is imported into GRBL-Poltter for automatically add" A value"?

I don't understand. You can replace 'Z' by 'A' using the editors-replace function (also available via menu). What do you mean with "for automatically add" A value" - from where should the 'A' value come?

for example,when I draw a curve in adobe illustrator and make GCode ( with pen-pressure" Z values" , But at this time there is still a lack of tangential value) with GCode plugin ,then I import the GCode to GRBLPlotter for adding tangential axis (A value)and tool change ,then send it to plotter. if I paste the curve (SVG) from illustrator to GRBLPlotter,tangential axis value and tool change code can be add to GCode from 'G-Code modification 'setting ,but lack of "pen-pressure- Z values" . if I paste GCode that exported from adobe illustrator , all of" Pen-pressure-Z values" are works, but lack of tangential axis value and tool change code. So Feature request: Paste GCode like SVG

svenhb commented 4 years ago

Check new option Translate pen with to Z value in new release.

wwwlxs commented 4 years ago

Check new option Translate pen with to Z value in new release.

thanks, I will test it,There may be a bug in version 1.46. I wonder if it has been fixed? That is, when" tangential axis" and "drag tool compensation" are used together, the angle of rotation and the new track is incorrect. If you create a square track, you can find it

svenhb commented 4 years ago

That is, when" tangential axis" and "drag tool compensation" are used together

I don't think this is a usefull combination... But this could be fixed because of "new backbone" during import and path modification.

wwwlxs commented 4 years ago

Useful for correcting the position deviation of the tool( brush )and the axis

在 2020年7月24日,13:39,Sven notifications@github.com 写道:

 That is, when" tangential axis" and "drag tool compensation" are used together I don't think this is a usefull combination... But this could be fixed because of "new backbone" during import and path modification.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

svenhb commented 4 years ago

I checked the code - it will not work, because: 1st I calculate the tangential angle of the original graphic - if option is enabled 2nd I calculate new drag-knife path - if option is enabled

For the next version I will switch the order - than it could work as expected.

wwwlxs commented 4 years ago

HI svennb,In the same svg file, some lines have variable z values, but the z values ​​of some lines do not change with the line width.SVG file: A5.zip The red marked lines have the same z value for each segment, and the black ones are variable

截屏2020-07-25 下午1 55 45
wwwlxs commented 4 years ago

C_.nc.zip C.zip A similar problem occurs in one line C

wwwlxs commented 4 years ago

Dragtool Will this ( green line)change with the z value of each line? Or can it only be based on the setting of z-Height engrave?

wwwlxs commented 4 years ago

B2

svenhb commented 4 years ago

Version 1) is my current implementation You mean like version 2) ? image

svenhb commented 4 years ago

From your post above:

Will this ( green line)change with the z value of each line? Or can it only be based on the setting of z-Height engrave?

Nice graphics to show the relationship z-depth and radius - It will be calculated from the initial 'Z-Heigth engrave'

svenhb commented 4 years ago

Check new release for missing z-depth - because of path reversing, z-data got lost

wwwlxs commented 4 years ago

Version 1) is my current implementation You mean like version 2) ? image

Yes, I mean that Version2 as default , if the length of each green line is very short ,V2 will be suitable for the actual soft brush (anti-aliasing), if the length of each green line is very long, you can leave version1 as an option for hard pen (preserve aliasing)

wwwlxs commented 4 years ago

Check new release for missing z-depth - because of path reversing, z-data got lost

z-data got lost:)

image image image
wwwlxs commented 4 years ago

H.zip I tested the svg file on V15.02 and it doesn't seem to work.
"A generic error occurred in GDI+ "pops up, and the generated gcode is still the same as version 15.01

wwwlxs commented 4 years ago

From your post above:

Will this ( green line)change with the z value of each line? Or can it only be based on the setting of z-Height engrave?

Nice graphics to show the relationship z-depth and radius - It will be calculated from the initial 'Z-Heigth engrave'

If the length of the green line can be changed with different Z values, it will be more accurate

svenhb commented 4 years ago

image

New option to make a ramp instead of steps... Check new release

wwwlxs commented 4 years ago

image

New option to make a ramp instead of steps... Check new release

Thank you very much, you are great! I test by this file: https://github.com/svenhb/GRBL-Plotter/files/4991852/H.zip,The new version is work!

lianzaozi commented 4 years ago

Why is the GCode generated by opening H.SVG different from the uploaded H.nc

image2 is a screenshot of my opening H.SVG image2

image3 is a screenshot of my opening H.nc image3

wwwlxs commented 4 years ago

Why is the GCode generated by opening H.SVG different from the uploaded H.nc

image2 is a screenshot of my opening H.SVG image2

image3 is a screenshot of my opening H.nc image3

Try to increase the range of “z-height engrave”

7C7427EA-74D2-490F-BE06-7D4C514D38D1

svenhb commented 4 years ago

I don't know when you saved the .nc file.... Gcode (like your H.nc) can not be modified with all the new options - it is only for import of SVG or DXF files.... And there is no chance for implementation. The difference is because of the new option "Apply ramp instead of a step" to get the Z movement as shown in example 2).

image

wwwlxs commented 4 years ago

And there is no chance for implementation.

hi svenhb, I uploaded the newest calligraphy test video to my instagram, you are welcome to take a look. if “drag tool compensation”can be calculated from pen width,it will be better. But it's pretty good now.thank you very much. 3C2BC090-13F8-4475-A022-1BA8E0C96A52

lianzaozi commented 4 years ago

Thank you very much for your reply I used the H.SVG file you uploaded, but I can't get the Z-axis coordinates of the gradient. I don't know why. From the gif animation, I can see that the Z-axis coordinates of the GCode I get are all -1. The whole process of operating the software can be seen in the gif animation

gif1

svenhb commented 4 years ago

The maximum depth (or minimum Z value) is limited by the engrave depth - for safety reasons... image

lianzaozi commented 4 years ago

You are right, thank you, now i can get the Gcode where the value of the Z axis changes with the line width. After your guidance, the software is now working properly.

svenhb commented 4 years ago

Before: "Drag tool Offset in % of Z-depth" used the "Z-heigth engrave" value.
Now with Version 1.5.0.4 : it uses the Z-depth, calculated by penWith (if option is enbaled
image

wwwlxs commented 4 years ago

Thank you! I will try again later, my arduino board is broken again, I need to buy a new one to replace

wwwlxs commented 4 years ago

Before: "Drag tool Offset in % of Z-depth" used the "Z-heigth engrave" value. Now with Version 1.5.0.4 : it uses the Z-depth, calculated by penWith (if option is enbaled image

image

thanks you very much,It work now! Maybe there is a problem with my SVG file, or there is a problem with my settings, the lines are a bit jittery,I will try further and submit to you if there is any problem

svenhb commented 4 years ago

Seems to work