CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 22, 2017, 16:11:33 pm


Login with username, password and session length


  Show Posts
Pages: [1] 2 3 ... 325
1  Support / Problem dxf files etc... / Re: Pulling my hair out over circles cutting that are not there on: Today at 04:30:46
Hello

Another track is those 2 settings in the post pro

http://www.cambam.co.uk/forum/index.php?topic=6066.msg48201#msg48201

++
David
2  Support / CamBam help (General usage) / Re: Convert Polylines to arcs on: October 19, 2017, 21:29:55 pm
Hello

If your polyline already contain true arcs, just explode it and you'll get arcs objects.

If your polyline contain a bunch off small straight segments instead of true arcs, you can use polyline/arc fit to replace the segmented arcs with true arcs.

++
David
3  Support / Scripts and Plugin Help / Re: VB Script - Made a new polyligne in multi-polyline on: October 17, 2017, 18:50:59 pm
Hello

Quote
What is your idea ?

 - saying polyline 1 and 2 (poly and poly2) to test ; a function can do the following.

 - generate a point list for each polyline with the same as Draw/points/Step Around Geometry (Dessiner/points/contour geometrie par pas) with a step = 0.1mm saying ptlist1 and ptlist2
CamBam.CAD.PointListUtils.CreatePointlistFromPolyline(ByVal opoly As Polyline, ByVal steps As Integer) As PointList


- for each point in ptlist1, test if the point is contained in poly2 (or intersect with the outline)
CamBam.CAD.Polyline.PointInPolyline(ByVal p As Point2F, ByVal tolerance As Double) As Boolean
CamBam.CAD.Polyline.PointIntersect(ByVal p As Point2F, ByVal xm As Matrix4x4F, ByVal tolerance As Double, ByVal perspective As Boolean) As Boolean

- if contained, add the point to a new point list (saying ptlist3)

- if not contained, stop to adds new point to the ptlist3, make a polyline with the existing points in ptlist3 (CamBam.CAD.PointList.ToPolyline() As Polyline), store the resulting polyline in a polyline list (saying polylist1) and clear the ptlist3.

- continue to test for contained points and skip non contained point until we get contained point again.

- when we get containing point again, then start to fill ptlist3 again, make a polyline when non contained point is found again, empty the ptlist3, etc, etc up to the end of the ptlist1

so we get a bunch of polyline segments that are contained in poly2 in polylist1

redo the same but reversed, so test if points in ptlist2 are contained in poly1 and adds a new polyline segment to polylist1

we end up with a polyline list (polylist1) that only contain polyline segments that are contained in both polylines.

for the first loop (test ptlist1 > poly2) we also add the points that are ON the line, and for the second loop (test ptlist2 > poly1) we only add points that are contained and exclude points that are on the line to avoid polyline overlaps.

when finished, we can "joint" the polylines segments in polylist1, then arc fit to reduce the number of nodes and return the resulting polyline to the main function.

the main function must call the function as many time that needed to test polyline two by two.

++
David
4  Support / Scripts and Plugin Help / Re: VB Script - Made a new polyligne in multi-polyline on: October 16, 2017, 22:09:37 pm
did you have tried Silhouette instead Z slice to do the slices ; not sure it change something ; just an idea ..

Edit:

Ah ah !! ... after some coffees, brain is powered again and I think that I've an idea to do that in VB script ... but it's a job for another day (if that works), now it's bed time ! ...

++
David
5  Support / Scripts and Plugin Help / Re: VB Script - Made a new polyligne in multi-polyline on: October 16, 2017, 21:55:15 pm
Yep, it is not working when 2 polylines exactly overlaps, as at the bottom of the legs ; in this case the result is 2 or more separate polylines ; no idea on how to solve that.  Huh

++
David

6  Support / Scripts and Plugin Help / Re: VB Script - Made a new polyligne in multi-polyline on: October 16, 2017, 21:10:44 pm
All source polylines must be on the same Z position ; if polylines are on different Z levels, intersection works but you get  separate polylines distributed at different Z positions instead of an unique closed polyline.

++
David
7  Support / Scripts and Plugin Help / Re: VB Script - Made a new polyligne in multi-polyline on: October 16, 2017, 20:55:29 pm
Maybe the method in the video can do the trick.

polyline must be treated with only 2 polylines at a times

saying we have poly1, poly2 and polo3

intersect poly1 and poly2 give a resulting poly ; saying poly5,

then intersect poly5 with poly3 give the final poly contained in the 3 source polylines

++
David
8  Support / Scripts and Plugin Help / Re: VB Script - Made a new polyligne in multi-polyline on: October 16, 2017, 20:31:18 pm
Hello

Not sure to understand ... it is the same as the polyline offset command that you need ? (edit/offset = edition/decalage)

in CamBam.CAD.Polyline

Public Function CreateOffsetPolyline(ByVal offset As Double, ByVal tolerance As Double) As Polyline()

return an array of polylines.

ex ; if p is a polyline.

   Dim p1() As Polyline 'an array of polylines
    p1 = p.CreateOffsetPolyline(10, 0.01)

    Doc.Add(p1(0))  'add the first element of the array to the doc (the offseted polyline)

++
David
9  Resources / Scripts and Plugins / Re: MopInfo script on: October 16, 2017, 19:59:30 pm
Hello

Quote
David,
To that end, what if your routine automatically generated the g-code (just for reading it!) from a 'standard' PP that does have the suitable syntaxes?

Then you could read directly from the g-code, and just delete the .nc file afterwards (if it was not of the same PP as the user had selected for the job).

Lloyd

yes, it's one of the ways I think about if I can't do more with mops.

Quote
You would almost need to have machine profiles defined within CamBam like you can in some other software.

Yes, they already exists in Cambam from a while (but they are not used by the soft) and it's planed to use them in future version of the script/plugin. (picture)

Quote
It sounds like the duration is important to you however when running the machine I often increase the rates in Mach3 so times are changed outside of CamBam.

Yes, it's the major reason why I do this script, so I can optimize the mop that "slow" the things and get statistics about what cost time or not in a machined part.

++
David
10  Resources / Scripts and Plugins / Re: MopInfo script on: October 16, 2017, 15:41:48 pm
Hello

Yes cb file can give info about tools, mop name, part name, etc ... but it do not give a way to calculate machining duration / toolpath length.

IMHO, the more accurate way is to work with the GCode itself, because it is possible to know the length and the feedrate of all toolpaths, even those that are not in the MOP and that are added by the PP .. but it's a hard works and it may not works on all Gcode syntax, depending of the PP used.

++
David
11  Resources / Scripts and Plugins / MopInfo script on: October 16, 2017, 03:47:02 am
Hello

I'm starting to play with a VB script that summarize mop info, like tools, toolpaths length, machining duration etc.

It's is not perfect because a lot of things are not taken in account in cambam functions (look at the comments in the code), but it give at least the same result as what we get when generating the toolpath with diagnostic level = 2

this is a first test, and of course it needs some enhancements and to be turned into a plugin, but it is workable as is.

currently the script act on all mops, even hidden mop/parts.

Code:
' dh42 10/2017
' an attempt to get toolpath lenght, machining time and more
'
' WARNING ; calculation is an approximation !
' Drill mop only return rapids value (even with spiral mill option)
' Trochopocket and trochoprofile plugin never return value
' Thread plugin never return value
' rapids lenght (and of course duration) take only the horizontal moves in account, so move to clearance plane duration is ignored
' toolpath lenght between 2 adajacent toolpaths is not taken in account if done in normal feedrate move.(but taken in account if rapid move)
' no way currently to distinguish leadin move and normal move, so leadin move are calculaded with the normal feedrate
' vertical moves (plunge) between levels are not taken in account
' The axes acceleration is not taken in account.
' rapids between 2 mop are not taken in account
' except for Drill and Trocho mops, the values returned are the same as those obtained with diagnostic level = 2

'TODO
' exclude hiden Parts/mops
' specific treatment for Drill mop
' specific treatment for trocho mop
' specific treatment for Thread mop
' rapids between mops
' compute true rapide value (horizontal + vertical)
' display current units
' use machine definition in system tab to get rapids value for XY and Z
' display the results in an editor or a spreedsheet like display + save option


Sub main()

    Dim prt As CAMPart
    Dim mop As MachineOp
    Dim toolpathseq As ToolPathSequence
    Dim tps As System.Collections.Generic.list(Of Toolpathitem)
    Dim p As polyline
    Dim rapidvalue As Double = 600 ' rapid value(mm/min)
    
    Dim mach_time As Double = 0
    Dim rapid_time As Double = 0
    
    Dim total_machtime As Double = 0
    Dim total_rapidtime As Double = 0

    'scan all the mops in all the parts
    For Each prt In CamBamUI.MainUI.ActiveView.CADFile.Parts
        App.Log(prt.Name)

        For Each mop In prt.MachineOps
            App.Log("  Mop Type: " & mop.MOPTypeName & " - Name: " & mop.Name)

            toolpathseq = mop.Toolpaths2   'get the toolpath sequence

            app.log("    Tool Diam: " & mop.ToolDiameter.Value)
            app.log("    Tool number: " & mop.ToolNumber.Value)
            app.log("    Tool profile: " & mop.ToolProfile.Value)
            app.log("    Feedrate: " & mop.CutFeedrate.Value)

            If mop.HasToolpathSequence Then 'toolpath are existing
                app.log("    Toolpath Distance: " & format(toolpathseq.GetToolpathDistance, "0.000"))
                mach_time = val(toolpathseq.GetToolpathDistance / mop.CutFeedrate.Value * 60)
                app.log("    Rapid Distance: " & format(toolpathseq.GetRapidDistance, "0.000"))
                rapid_time = val(toolpathseq.GetRapidDistance / rapidvalue * 60)

                app.log("    machining duration: " & SecToHMS(mach_time))
                app.log("    rapids duration: " & SecToHMS(rapid_time))
            Else

                If mop.MOPTypeName = "Drill" Then
                    'only rapids are know with drill mops and HasToolpathSequence() is always false
                    ' so I need something to handle error if no rapid is calculated

                    Try
                        app.log("    Rapid Distance: " & format(toolpathseq.GetRapidDistance, "0.000"))
                        rapid_time = val(toolpathseq.GetRapidDistance / rapidvalue * 60)
                        app.log("    rapids duration: " & SecToHMS(rapid_time))
                    Catch ex As exception
                        app.log("    No Toolpaths, please run toolpath calculation")
                    End Try

                Else
                    app.log("    No Toolpaths, please run toolpath calculation")
                End If
            End If
            app.log("")

            total_machtime = total_machtime + mach_time
            total_rapidtime = total_rapidtime + rapid_time
        Next mop
    Next

    app.log("Total machining duration: " & SecToHMS(total_machtime))
    app.log("Total rapids duration: " & SecToHMS(total_rapidtime))
    app.log("")
    app.log("Overall duration (machining + rapids): " & SecToHMS(total_machtime + total_rapidtime))

End Sub

Function SecToHMS(ByVal s As Double) As String

    'return time as HH:MM:SS

    Dim Sec64 As Int64 = CType(s, Int64)
    Dim spanTM As New TimeSpan(TimeSpan.TicksPerSecond * Sec64)
    Dim TimeStr As String

    TimeStr = spanTM.Hours.ToString("00") & "h " & spanTM.Minutes.ToString("00") & "m " & spanTM.Seconds.ToString("00") & "s"

    Return TimeStr

End Function


You can copy the results in the log window with this old plugin.
http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/MessageLogCopy.html

++
David
12  Support / CamBam help (General usage) / Re: How to clean DXFs imported from Inkscape? Plugin needed. on: October 15, 2017, 00:07:05 am
Hello

have a look here

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/FileCleaner.html

++
David
13  Support / How to's and tutorials / MOVED: How to clean DXFs imported from Inkscape? Plugin needed. on: October 15, 2017, 00:06:26 am
This topic has been moved to CamBam help (General usage).

http://www.cambam.co.uk/forum/index.php?topic=6897.0
14  Resources / Scripts and Plugins / Re: Select by kind of object on: October 15, 2017, 00:05:19 am
Hello

I think that maybe this other plugin can do the trick for this usage.

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/FileCleaner.html

++
David
15  Support / CamBam help (General usage) / Re: How to cut the material along the line on: October 14, 2017, 21:29:23 pm
Hello

Quote
Could you describe what concrete MOP procedure you meant? Let's assume that no straight lines will be used.

Have a look on my example file in my first reply, one of the line is cut with an engrave MOP

Quote
I forgot to mention about holding tabs. Can I use them if cutting path is open shape?

Yes, tabs works on open polyline/spline too; if the tab is on the wrong side you can use the internal/external property in the profile mop to revert them

PS: tabs exists only with a profile MOP, no tabs or leadin/out with an engrave mop.

++
David
Pages: [1] 2 3 ... 325
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.155 seconds with 18 queries.

Copyright © 2008 HexRay Ltd. | Sitemap