OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Oberon Products > New product ideas

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-07-2010, 23:35
cncrouter
Guest
 
Posts: n/a
Default CAD/CAM cutter tool paths in Corel Draw

I'm not a sign maker, but I carve out text and silhouettes in metal using a cnc milling machine. Same concept as routing out a wood sign on a cnc router table, just a much smaller scale.

I create the tool cutter paths for my cnc milling machine with the Corel Draw inside Offset Contour function. So, if I’m milling out a rectangle pocket, I create a series of inside contours which the rotary cutter will follow.

The problem with this approach to creating tool paths is that each inside contour is an "island" not connected to the others, and so the tool must rise when finished with one contour, move to the next contour, drop back down to cutting height, and continue cutting the new contour.

These unwanted up-down moves take up 20% of the total run time. More importantly, each time the cutter moves down (plunge cutting) the probability of the cutter breaking goes way up (my engraving cutter is only 0.012” in diameter, equivalent to about four human hairs).

CAD/CAM programs designed for this type of application can generate a spiral tool path within a closed polygon and the tool cuts out the pocket in one continuous path. I would save a lot of time if Corel Draw could generate this type of path. This would be ideal, but not something I would expect a macro to be able to perform.

Another idea is to have a macro that draws connector lines between the inside contours (islands) and the outer path. If a macro could produce those kinds of lines and make the entire group a single polygon, the cutter could remain engaged in the work and save time while also reducing broken cutters. The connector lines would cause a very small amount of redundant cutting, but that’s a minor disadvantage.

Does anyone have any ideas for producing continuous cutter paths using Corel Draw?
Reply With Quote
  #2  
Old 11-07-2010, 00:33
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Cutting Path

If you could include an example .cdr file of the cutting paths you wish to generate I am sure we could take a look and let you know if it is possible or not.

-Shelby
Reply With Quote
  #3  
Old 11-07-2010, 01:37
cncrouter
Guest
 
Posts: n/a
Default

Thanks - I have attached a CDR file with examples.

There are probably several possible solutions, but the attached examples should explain the desired outcome.
Attached Files
File Type: cdr Sample Cutter Paths.cdr (35.5 KB, 738 views)
Reply With Quote
  #4  
Old 11-07-2010, 07:47
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi Ed.

Here's what I have so far. I'm not sure if it's what you're looking for.
It takes 2 combines items and connects the inner path to the outer.

Code:
Option Explicit

Sub connectSegments()
    Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double
    Dim sh1 As Shape, sh2 As Shape
    Dim n1 As Node
    Dim connLine As Shape
    Dim sr As ShapeRange
    Dim sp As SubPath, shTemp As Shape
    Dim lineLen As Double, marker As Double
    
    Dim xt As Double
    
    Dim closeX As Double, closeY As Double
    
    Set sr = ActiveSelectionRange
    
    If (sr(1).SizeHeight * sr(1).SizeWidth) > (sr(2).SizeHeight * sr(2).SizeWidth) Then
        Set sh1 = sr(1)
        Set sh2 = sr(2)
    Else
        Set sh1 = sr(2)
        Set sh2 = sr(1)
    End If
    
    sh1.Fill.ApplyUniformFill CreateCMYKColor(0, 0, 100, 0)
    sh2.Fill.ApplyNoFill
    sh1.Outline.Width = 0.003
    sh2.Outline.Width = 0.003
    'sh1 is large shape
    'sh2 is inside shape
    
    Dim sr1 As ShapeRange
    Set sr1 = sh1.BreakApartEx
    
    For Each sp In sh2.Curve.SubPaths
        sp.Nodes(1).GetPosition x1, y1
        Set shTemp = ActivePage.SelectShapesAtPoint(x1, y1, False)

        'get closest x value
        marker = 1000 'marker starting point for less and less distance value
        For Each n1 In shTemp.Shapes(1).Curve.Nodes
            lineLen = n1.GetDistanceFrom(sp.Nodes(1))
            If lineLen < marker Then
                n1.GetPosition x2, y2
                marker = lineLen
            End If

        Next n1

        Set connLine = ActiveLayer.CreateLineSegment(x1, y1, x2, y2)
    Next sp

    sr1.CreateSelection
    ActiveSelection.Fill.ApplyNoFill
    ActiveSelection.Combine
            
End Sub
Select all and run.
Use this attached cdr to do initial test.

-John
Attached Files
File Type: cdr test.cdr (31.8 KB, 740 views)
Reply With Quote
  #5  
Old 11-07-2010, 14:10
cncrouter
Guest
 
Posts: n/a
Smile

John - Thanks for providing the macro!

Visually, it works great

However, to see the path and direction the cutter will take, double-click to reveal the nodes, then tab though the nodes.

The path to the inside contours is not via the connection line added by the macro. Instead, the cutter still "hops" across the gap.

It looks like some intelligent re-ordering of the lines & nodes are needed so that the inside contour is cut, then exits via the connection line, and continues to cut the outside contour.

Is this possible? If so, this would be a great solution!

Ed
Reply With Quote
  #6  
Old 12-07-2010, 21:35
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Hi.
After trying a straight forward approach it proved really difficult.
Try this workaround method and see if it works for you.

-John

Code:
Option Explicit

Sub connectSegments()
    Dim x1 As Double, y1 As Double, x2 As Double, y2 As Double
    Dim sh1 As Shape, sh2 As Shape
    Dim n1 As Node
    Dim connLine As Shape
    Dim sr As ShapeRange
    Dim sp As SubPath, shTemp As Shape
    Dim lineLen As Double, marker As Double
    Dim mainSh As Shape
    Dim e As Effect, connLines As Shape
    Dim contSh As Shape, contShSr As ShapeRange
    Dim sr1 As ShapeRange, targSh As Shape
    
    On Error Resume Next
    
    
    Set sr = ActiveSelectionRange
    
    If (sr(1).SizeHeight * sr(1).SizeWidth) > (sr(2).SizeHeight * sr(2).SizeWidth) Then
        Set sh1 = sr(1)
        Set sh2 = sr(2)
    Else
        Set sh1 = sr(2)
        Set sh2 = sr(1)
    End If
    
    sh1.Fill.ApplyUniformFill CreateCMYKColor(0, 0, 100, 0)
    sh2.Fill.ApplyNoFill
    sh1.Outline.Width = 0.003
    sh2.Outline.Width = 0.003
    'sh1 is large shape 'sh2 is inside shape
    
    Set sr1 = sh1.BreakApartEx

    For Each sp In sh2.Curve.SubPaths
        If sp Is Nothing Then GoTo 1001
        Dim origNode As Node
        Set origNode = sp.Nodes(1)
        origNode.GetPosition x1, y1
        Set shTemp = ActivePage.SelectShapesAtPoint(x1, y1, False)

        'get closest x value
        marker = 1000 'marker starting point for less and less distance value
        For Each n1 In shTemp.Shapes(1).Curve.Nodes
            lineLen = n1.GetDistanceFrom(sp.Nodes(1))
            If lineLen < marker Then
                n1.GetPosition x2, y2
                marker = lineLen
            End If

        Next n1
        
        
        Set targSh = shTemp.Shapes(1)

        Set connLine = ActiveLayer.CreateLineSegment(x1, y1, x2, y2)
        connLine.Name = "connLine"
        
1001:
    Next sp

    sr1.CreateSelection
    sh2.AddToSelection
    ActiveSelection.Fill.ApplyNoFill
    ActiveSelection.Combine
    
    Set mainSh = ActiveShape
    Set connLines = ActivePage.FindShapes("connLine").Combine
    Set e = connLines.CreateContour(cdrContourOutside, 0.001, 1)
    Set contShSr = e.Separate()
    Set contSh = contShSr(1)
    contSh.Trim mainSh, True, True
    mainSh.Delete: contSh.Delete: connLines.Delete
    
            
End Sub

Last edited by runflacruiser; 12-07-2010 at 21:41. Reason: uncommented on error resume next...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Draw X4 - Stinking dimension tool gorgo2 General 0 26-02-2010 12:22
Plot Graphics With Rolan CX-300 Cutter m31uk3 Code Critique 1 12-10-2007 01:46
Please HELP! import CorelDraw paths into Corel Painter hotdog10 New product ideas 0 06-02-2007 12:41
text tool causes app hang Corel Suite 11 BEAMA General 3 27-02-2006 19:47
Draw X3 contour tool interface small bug wOxxOm General 6 31-01-2006 14:19


All times are GMT -5. The time now is 02:41.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com