Author Topic: Vectorization Example  (Read 28696 times)

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3287
    • View Profile
Re: Vectorization Example
« Reply #15 on: June 16, 2015, 22:28:33 pm »
The script act only on selected objects ; (and only on polyline, of course) ... you must select all first.
**********
Yes , did that.. 8)
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1738
    • View Profile
Re: Vectorization Example
« Reply #16 on: June 17, 2015, 08:18:32 am »
Those cnc ready files look good.
When I first looked for files to practice on with the file cleaner I went here:
http://www.cnczone.com/forums/general-metalwork-discussion/19346-share-files-part-art.html    link to thread
A couple of observations
1. the files early on in the thread needed more cleaning up than those now, I put this down to earlier versions of Inkscape not being as capable as the new versions and people simply getting better at using the software and sharing their experiences tips/tricks with the other members of the forum.
Here is a direct link to the files http://www.cnczone.com/forums/misc.php?do=showattachments&t=19346

The thread Moderator Switcher also has a blog with files and information on how to convert files to .dxf just click on his icon.
2. If you can use, an outside program to process the file as much as possible, as I have a hunch that Gimp/Inkscape/Illistrator  using identical files will perform faster than CB.
I think that the extra duplicates in the file from Inkscape/Illistrator  ect are from flattening the file, so I'll have a play with that.
Bubba Just a thought if your running out of memory you could break up the geometry into four layers and process each layer separately.
Dave

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3287
    • View Profile
Re: Vectorization Example
« Reply #17 on: June 17, 2015, 10:51:56 am »
Very good info Dave, Thanks for sharing.
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5142
  • Made in England
    • View Profile
Re: Vectorization Example
« Reply #18 on: June 17, 2015, 13:32:46 pm »
It's true there might not be many items the script picks up from the Inkscape dxf.

I've attached two pictures showing what the script found for both CW and CCW with the dxf I got from Inkscape ( and the Inkscape settings I used are likely to be different to anyone else's so results will vary )


« Last Edit: June 17, 2015, 13:36:33 pm by EddyCurrent »
Filmed in Supermarionation

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7121
    • View Profile
    • Cambam V1.0 French Doc
Re: Vectorization Example
« Reply #19 on: June 17, 2015, 15:00:31 pm »
Hello,

Yes, very few lines in CW-CCW .... that means the other lines are all opened ?

++
David

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1738
    • View Profile
Re: Vectorization Example
« Reply #20 on: June 18, 2015, 22:54:10 pm »
HI David
I played around with you jbt Honda file in Inkscape and produced the file below.
It has no splines just lines so you need no file cleaning. Because their just lines everything works really fast
So this is what I did:
1. Load up the image file in Inkscape
2. Applied a filter desaturate
3. traced the bitmap with Edge Detection you can see the settings in the picture
4. I then saved the picture as a .dxf with "Saveas" then selected from the extension list "BetterDXF output"
5 Loaded up in CamBam (just lines) no cleaning required CamBam worked really fast with this file.
I hope this helps you with your engraving adventures. Have Fun ;D
Dave

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3287
    • View Profile
Re: Vectorization Example
« Reply #21 on: June 18, 2015, 23:37:12 pm »
Hmmm, Dave.
Followed your instructions to a tee including downloading and installing a "Better DXF Output" and my dxf file is not even close to what you have shown. The tracing in inscape was set as yours.. Any suggestions?
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1738
    • View Profile
Re: Vectorization Example
« Reply #22 on: June 19, 2015, 02:30:09 am »
HI Bubba
I got caught with this before  ;D and saved the original image instead of the new worked on image
because Inkscape overlays the two images it's hard to see and I didn't have the right one selected for output to .dxf have a look at the file below.
Dave

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1909
    • View Profile
    • pixelmaker
Re: Vectorization Example
« Reply #23 on: June 19, 2015, 07:48:24 am »
David

in Illustrator in the vectorize panel there I have a "Ignore white" option. I don´t remember if it is there in CS3.
You can see in the screenshot that I have 66 path with 1501 nodes.
I delete all colors, the lines are visible with strg+Y.
I export with R13/LT95 dxf export because this opens in mm in CB.
I get the same number of path  ( 66 ) in CB. There are no double lines.
For the export the white is a second object.
And I don´t convert the splines to polylines for cutting.

ralf

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5142
  • Made in England
    • View Profile
Re: Vectorization Example
« Reply #24 on: June 19, 2015, 08:10:05 am »
I get a result very much like Bubba's, the reason being that I just installed the latest version of Inkscape and the Better DXF Output throws up errors and does not work so I used the built in dxf export method.

Here's the problem; https://answers.launchpad.net/inkscape/+question/265186
« Last Edit: June 19, 2015, 08:11:42 am by EddyCurrent »
Filmed in Supermarionation

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3287
    • View Profile
Re: Vectorization Example
« Reply #25 on: June 19, 2015, 10:52:00 am »
I got caught with this before  Grin and saved the original image instead of the new worked on image
***************
Thanks for the 'heads up' but I was aware of it because I use Inkscape trace feature pretty often.. As it turned out, out of habit I saved it as the other dxf format(autocad v14 I believe). Redid in new format and all is well. Thanks. ;D
« Last Edit: June 19, 2015, 15:37:36 pm by Bubba »
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1738
    • View Profile
Re: Vectorization Example
« Reply #26 on: June 19, 2015, 12:18:06 pm »
HI eddy
I'm sorry to hear that the new version of Inkscape doesn't output the lines like the better dxf output script
as I've done a few files now playing around, and everything  has worked nicely I'm using 0.48 I still have the original download if you want it. The files it outputs need no cleaning and are half to one third the size and process very fast.
Dave

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7121
    • View Profile
    • Cambam V1.0 French Doc
Re: Vectorization Example
« Reply #27 on: June 20, 2015, 16:35:39 pm »
Hello,

I tried your settings Ralf ... and ... no more duplicate splines, and only closed shape  :D ... thanks, that works well .. ;D

Quote
And I don´t convert the splines to polylines for cutting.

When you generate the Gcode, CB converts first (internally) the splines/texts to polylines, that means that each time you creates a Gcode the conversion spline/polyline must be done ... that eats time if you need to regenerate the Gcode more that one time ..

++
David

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7121
    • View Profile
    • Cambam V1.0 French Doc
Re: Vectorization Example
« Reply #28 on: June 20, 2015, 18:30:38 pm »
Hello,

Another test with the RemoveDuplicatePoints() method (Polyline)

It's the same as the 'clean' function in the polyline menu to remove points, except that with programming, we can use a tolerance.

I try to use this function to remove 'stairs' that appears with some digitizer (I don't know which soft is used, it's a file that an user given me)

I attach the CB example, the left drawing is the original with stairs ; the right drawing receive the RemoveDuplicatePoints with a value of 0.2mm followed by an Arc fit with the same tolerance.

Here is the script that remove the points ; maybe it can be useful for other ;)

Code: [Select]
   ' remove points closest to the given value
    ' dh42 06/2015

    Sub main()
        Dim rep As String
        Dim tol As Double
        Dim p As polyline
        Dim nbpt1 As Integer

        CamBamConfig.Defaults.ReloadTreeAfterScript = False

        rep = inputbox("Max distance between 2 points", , 0)

        tol = val(rep)

        If CamBamUI.MainUI.ActiveView.SelectedEntities.Length > 0 Then


            For Each ent As Entity In CamBamUI.MainUI.ActiveView.SelectedEntities

                If TypeOf ent Is Polyline Then

                    p = ent

                    CamBamUI.MainUI.UndoBuffer.AddUndoPoint("RemovePoints")
                    CamBamUI.MainUI.UndoBuffer.Add(ent)

                    nbpt1 = p.Points.Count

                    If p.RemoveDuplicatePoints(tol) = True Then

                        App.Log("Polyline: " & ent.ID & "  #Points before: " & nbpt1 & "  #Points after: " & p.Points.Count & "  #Points removed: " & nbpt1 - p.Points.Count)

                    End If

                    p.Update()

                End If

            Next ent


            CamBamUI.MainUI.ActiveView.RefreshView()

        End If

    End Sub

++
David

Offline Robocutter

  • Ewok
  • *
  • Posts: 1
    • View Profile
Re: Vectorization Example
« Reply #29 on: June 08, 2016, 16:49:29 pm »
I just want to throw something into the mix here, it's a paid for program and I am a reseller in the UK for it but I am driven to inform people that the vectorisation in the program is very, very good, and very fast. The program is a 'signmaking' program but can also be used for many, many other applications as well, including creating fast designs for DXF export for CNC appications.

Vectorising:

Here is a video of the process in real time: http://www.robocutters.co.uk/vectorise.swf

1. The trace needs no cleaning up
2. I didn't tweak anything, this is shown in basic mode and in real time
3. The trace is by colour, more colours add more detail

Using the other parameters makes the trace clearer, but ultimately the more colours you trace the better the resultant black image is as shown in this next video. I can add tweaks which make small differences, (actually that depends on the image) but adding a 4th colour to trace really ups the detail.

This is me playing with the trace parameters, at the end I am trying to select the original image to pull away from the main converted section and then pull away the black portion to demonstrate the better trace. I had to reduce the window size so you could see what I was doing which make the selecting a bit fiddly, but the result is worthwhile.

http://www.robocutters.co.uk/vectorise2.swf

I would be interested in comments!