williamjbronskii / heekscnc

Automatically exported from code.google.com/p/heekscnc
0 stars 0 forks source link

Its no more possible to add objects to ScriptOp #349

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,
thank you for your great work!

I'm using 1.0.0+svn201407270103~ubuntu10.04.1

What steps will reproduce the problem?
1. Select an object (Face, Line, Point) and create a Script Operation 
2. The Script Operation is created but does not contain the selected
   Geometrical objects. So it is not possible to write scripts depending
   on geometrical objects any more. 

this was a very useful feature for e.g. thread milling where you have a 
script producing a helix and get the x/y starting positions from the center 
points from the geometry you need for your drilling operation anyway.

Following script producing 1 1/4" thread works great in previous HeeksCNC 
versions
uncomment the lines and comment the last two ones for the actual HeeksCNC 
version. 
#--------------------------------------------------------------------------
from math import fabs
def helical_hole2(xPos, yPos, dia,  final_depth, clearance, step_down, 
step_over, tool_dia, start_depth):
    '''
    inner helical bore
    '''
    if (tool_dia > dia):
        raise "tool wider than inner bore diameter"

    if (step_over > fabs(yPos+dia/2.0- tool_dia/2.0)):
        raise "step over too big"

    ydelta = (yPos+dia/2.0- tool_dia/2.0)
    rapid(z=clearance)
    rapid(x=xPos,y=ydelta)

    feed(z=start_depth)

    currentDepth = start_depth- step_down
    while currentDepth > final_depth :
        arc_cw(x=xPos,y=ydelta,z=currentDepth,i=xPos,j=yPos)
        currentDepth = currentDepth - step_down
    feed(xPos,yPos)
    rapid(z=clearance)
    end_CRC()

bore_diameter = 42.1
tool_diameter = .25
start_depth = 0.0
final_depth = -10
step_down =2.309
step_over = .01
clearance = 5.0

#helical_hole2(0.0,0.0,bore_diameter,final_depth,clearance, step_down, 
step_over, #tool_diameter,start_depth)

for i in graphics.points:
    helical_hole2(i.x,i.y,bore_diameter,final_depth,clearance, step_down, step_over, tool_diameter,start_depth)

#----------------------------------------------------------------------

Original issue reported on code.google.com by wul...@gmx.at on 27 Jul 2014 at 11:30

GoogleCodeExporter commented 8 years ago
Hi,

When you said previous versions, is it a recent one or an old one?

Original comment by neomil...@gmail.com on 11 Mar 2015 at 11:46