I am still working on my woodworking joint plugin and I am now trying to address the inches/mm so it will work in both units. I found the .to_l that makes the variables display the correct units in the input form now I am trying to figure out how to get the calculated points to also be correct for the drawing units.
def points_DowelCircle_Comp1(x,y)
r=@@dia/2
@pt[0]=Geom;;Point3d.new(x+r,y,0)
@pt[1]=Geom;;Point3d.new(x+(0.866*r),y+(0.5*r),0)
@pt[2]=Geom;;Point3d.new(x+(0.5*r),y+(0.866*r),0)
@pt[3]=Geom;;Point3d.new(x,y+r,0)
@pt[4]=Geom;;Point3d.new(x-(0.5*r),y+(0.866*r),0)
@pt[5]=Geom;;Point3d.new(x-(0.866*r),y+(0.5*r),0)
@pt[6]=Geom;;Point3d.new(x-r,y,0)
@pt[7]=Geom;;Point3d.new(x-(0.866*r),y-(0.5*r),0)
@pt[8]=Geom;;Point3d.new(x-(0.5*r),y-(0.866*r),0)
@pt[9]=Geom;;Point3d.new(x,y-r,0)
@pt[10]=Geom;;Point3d.new(x+(0.5*r),y-(0.866*r),0)
@pt[11]=Geom;;Point3d.new(x+(0.866*r),y-(0.5*r),0)
#Debug @pt.each {|e| UI.messagebox("point = "+ e.to_s)}
end #points_DowelCircle
What do I need to do so these points are correct in mm and in? Do I need to apply the .to_l to each variable that is a distance or length or point in space before it is used in the equation? In this case the x,y,r variables. I have a lot of other calculations so I thought I would ask before making the changes to the program.
Keith