PDA

View Full Version : Rotating a SBP around a point (Array)



stickman
06-14-2004, 12:38 PM
Here is what I am wanting to do. I need to create a rosette. I'm going to write out the shopbot code by hand, in order to get the affect that I want. However, I don't want to write it out for each vane that I am doing. Is there anyway to array the code. So that one single line of code will run a certain number of times, each time rotating a set amount?

Thanks, Jay

gerald_d
06-14-2004, 12:55 PM
Write the sbp code by hand -> take it to Vector and reverse compile the vectors -> Draw array in a CAD program -> convert back to sbp code.

Or:

Clamp workpiece on a turntable

Brady Watson
06-14-2004, 06:52 PM
Jay,
The best and easiest way to do this is in CAD. Most CAD programs have a rotate copy function or will generate a circular array.

You can also use CorelDraw and under the Transform menu, choose rotate. Pick the center of rotation and create an array that way.

What software do you currently have?

-Brady

stickman
06-15-2004, 09:05 AM
Brady,

I use AutoCad. I've got the pattern arrayed. I just got to thinking, I can run that through PartWizard, to get my initial sbp codes and then edit them from there with my depth changes and such. I think. Hopefully when I get home tonight I can work on it. NOT enough hours in the day.

Thanks.

mrdovey
06-15-2004, 10:24 PM
Jay...

Yuppers. Polar coordinates are your friends.

...Morris

gerald_d
06-16-2004, 03:10 AM
If the parts are already arrayed and .sbp'ed, and you only want to do a bunch of depth changes in the .sbp file, then suggest that you use a text editor (like WordPad) or spreadsheet (like Excel).

mrdovey
06-16-2004, 07:58 AM
Oops! Sorry - I didn't catch that the thread is being presented upside-down. My comment about polars was a response to Jay's original question.

I commonly write sbp subroutines to cut a "feature" and then cut that feature several times, each time rotated to a different angle. The locking lap joint that I described in the tilting shop cart has a subroutine that cuts the pillars and another that cuts the wells; and both of these routines simply rotate their standard feature by a specified amount at run time.

If the feature is originally in terms of cartesian coordinates, convert to polar coordinates consisting of a distance (r) from the point of rotation (x0,y0) and the angle (a) from the point of rotation. To rotate the feature, just add the amount of rotation (d) to the angle a and convert back to cartesian coordinates using:

x = x0 + r * cos(a + d) and
y = y0 + r * sin(a + d)

I usually just use these expressions right in a M2 command:

M2 &X0 + &R * COS(&A + &D),&Y0 + &R * SIN(&A + &D)

...Morris

ecnerwal
06-27-2004, 09:08 AM
Well, I just got done fiddling with some 3-D rosette cuts, which I did by laying out 500 points from -1 to 1 in a spreadsheet and then calculating a parabolic Z curve, taking the results and converting to an sbp file. Then I manipulated the XY to cut angles. I noticed that I could write about half the cuts I actually wanted to make by simply calling the part files with either x or y (not both) scaling set to -1.0 (or -whatever size I've scaled the whole thing to). So I've defined one along the x (no point reversing) and one along the y (no point reversing [yup, you could swap axes, but I prefer not to]) and then one for pi/6 one for pi/4 and one for pi/3 - I've done these as calculations in a loop in an SBP file in the past, but I found that the tool stopped when the loop recycled (well, it did back in 1.8c, and I assume it still does), so I get faster/better cuts by getting a series of M3's written out with a spreadsheet or C program.

With the individual cuts defined in their own files, I can then cut a 4-point rosette by calling either x-para.sbp and y-para.sbp or by calling pi4-para.sbp and then pi4-para.sbp with negative scaling on the x. I can cut a 6-point by calling x-para.sbp and pi3-para.sbp twice (once with negative scaling) or y-para.sbp and pi6-para twice. I can cut a 12-point by calling x, y, pi6 twice and pi3 twice.

It's a little bit more work, but I've yet to spend money on 3d software, and I like getting 3d work done.

phil_o
07-17-2004, 10:26 AM
Part Wizard 2 has an array function.

pappy
07-17-2004, 11:24 PM
That's nice to know Phil! Next question, where is Part Wizard 2 ?