CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > CAD Software > Rhino 3D


Rhino 3D Discuss Rhino 3D software here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 03-07-2007, 05:40 PM
 
Join Date: Jun 2003
Location: Australia
Posts: 431
Splint is on a distinguished road
Scripting a constant offset curve over a contoured surface?

Hi,
I'm looking at trying to write a script to generate 5 axis toolpaths in rhino. The area where I'm having trouble is working out how to acheive a constant offset from the outer edge of the surface as a toolpath. I have looked at using the edge curve as a rail and extruding a circle along the curve to form a tube, the next line would be created by using the intersection of the tube and the surface but this dosen't work too well because loops and irregularities can occour in sharp corners. Can anyone suggest how to draw the lines to form a 5 axis toolpath which covers the entire surface?

Thanks
Splint
Reply With Quote

  #2   Ban this user!
Old 03-07-2007, 07:56 PM
 
Join Date: Nov 2004
Location: USA
Posts: 435
spoiledbrat is on a distinguished road

Would offsetting the surface and generating curves from isocurves (on the new surface) work? Seems like you would have to project curves onto whatever you do in order to have a parallel toolpath curves. Sounds like a neat project your into...
Reply With Quote

  #3   Ban this user!
Old 03-07-2007, 08:17 PM
 
Join Date: Jun 2003
Location: Australia
Posts: 431
Splint is on a distinguished road

I'd doubt it would work, it's the sort of thing that needs to have the lines an equal distance (step over of the tool) from the previous pass over all types of shapes and contours. It would start from the outer edge of the surface and then make another line a predetermined distance inward of that line, repeating until the entire surface is covered, then the line is midified to allow the tool move from one pass to the next. Once that is established x,y,z and normal to surface measurements are converted into g-code.
I suspect it may involve a sphere "rolling" around the inside of the line, using the centre of the sphere to draw a curve as it goes. I'm just not clear on how this could be done in rhino. I dont think projecting lines or anything of that nature is the way to do it.

Cheers
Splint
Reply With Quote

  #4   Ban this user!
Old 03-07-2007, 09:41 PM
 
Join Date: Nov 2004
Location: USA
Posts: 435
spoiledbrat is on a distinguished road

I am suggesting that once you offset all of your surfaces, an array of curves could be created, with the desired stepover, and then projected to the offset surfaces. This would give you the effect of the rolling ball, with the curve created at the center of it. Definately a workaround for what could easily be accomplished with 20,000 dollar software.

Your script keeps the toolpath normal to the curve?

That sounds so cool.
Reply With Quote

  #5   Ban this user!
Old 03-07-2007, 10:21 PM
 
Join Date: Feb 2005
Location: Canada
Posts: 15
id 10 t is on a distinguished road

Hello Splint,

In the “Rhino to G-code” thread Dan B posted a snippet of his five axis script that does exactly what you are asking. He offsets the points on the tool path along the surface normal.

I have been playing around with a 5 axis script of my own. It is full of bugs and probably not useful but it does spit out numbers.

You have to project a curve (tool path) on to a surface then run the script and follow the prompts.

Colin
Attached Files
File Type: txt normal3_1.txt‎ (10.0 KB, 77 views)
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-08-2007, 05:09 AM
 
Join Date: Jun 2003
Location: Australia
Posts: 431
Splint is on a distinguished road

Originally Posted by spoiledbrat View Post

Your script keeps the toolpath normal to the curve?

That sounds so cool.
The reason for the normal to surface bit is so the g-code includes the B and C position of the tool as well as the X,Y and Z so it is true 5 axis, otherwise the tool would remain in the virtical position and be 3 axis.
Here is a video of the sort of thing I would like to be able to do.

<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/kJl4WgOxzW4"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/kJl4WgOxzW4" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>

At this point in time my main issue is getting the consistent step over on a contoured surface, the surface itself that is, not a consistent step over tool path which is then projected onto a surface as the step over changes with the contour of the surface when projected.
On the rhino screen shot I used the contour command which effectively projects a series of lines down onto the surface. In the Top and front views the step over is consistent but in the perspective and right views, the step over changes dramatically on the steep face, this is what I'm trying to sort out, how to get a consistent step over regardless of the shape or angle of the surface. From what I understand any method of projecting lines will result with variable step overs.

Here's a couple more images to help explain what I'm trying to achieve, the pink toolpath would be fine for a 3 axis machine but not for a 5 axis. The green toolpath is a better example of what I would like. When I talk about the rolling ball, what I'm trying to say is that the center of the ball stays at the surface at all times and the outer edge of the surface acts as a border which the ball rolls on. When the ball has done a full lap it moves inboard and uses the newly created line as the border and starts drawing the next line.

Thanks Colin for the tip in Dan Bs script, I have seen that thread but I cant understand exactly how the snipit of script works. I tried out your script but couldn't produce any code, apart from that it looked to be working normally.

Thanks again
Splint
Attached Thumbnails
Click image for larger version

Name:	3 axis toolpath.gif‎
Views:	65
Size:	12.1 KB
ID:	33195   Click image for larger version

Name:	5 axis toolpath.gif‎
Views:	78
Size:	12.5 KB
ID:	33196   Click image for larger version

Name:	projected lines.jpg‎
Views:	84
Size:	85.3 KB
ID:	33197  
Reply With Quote

  #7   Ban this user!
Old 03-08-2007, 05:12 AM
 
Join Date: Jun 2003
Location: Australia
Posts: 431
Splint is on a distinguished road

Ok, the embeded video didn't work, here's a link.

http://www.youtube.com/watch?v=kJl4WgOxzW4
Reply With Quote

  #8   Ban this user!
Old 03-08-2007, 09:53 PM
 
Join Date: Feb 2005
Location: Canada
Posts: 15
id 10 t is on a distinguished road

Could you post some sample models/scripts.
I was thinking OffsetCrvOnSrf in V4 might work but it to makes loops and irregularities (it must be using the intersection of the tube also).
Reply With Quote

  #9   Ban this user!
Old 03-08-2007, 10:26 PM
 
Join Date: Jun 2003
Location: Australia
Posts: 431
Splint is on a distinguished road

I dont have any scripts at this point, I'm just trying to work out the mechanics of how to do it, when I have a plan I will work on creating the script.

I had a thaught on an alternative which isn't ideal but may be workable. Create a sphere double the size of the intended step over, move the sphere along the outer edge of the surface in small incriments (center of the sphere on the edge), trim the edge of the surface using the sphere as the cutting tool all the way around the surface until it gets back to the point where it started. Draw a curve or a polyline using object snaps along the new outer egde of the surface. Move the center of the sphere onto the new line and repeat the process over and over until there is no surface left to trim. Add in the lines to step from one path to the next, add in plunge and retract paths, specify the direction of travel (start from the inside for a pocket, start from the outside for an island) specify the reference distance along the lines to take xyzbc data and generate the code from there. Totally confused?

Cheers
Splint
Reply With Quote

  #10   Ban this user!
Old 03-09-2007, 02:28 AM
 
Join Date: Jun 2003
Location: Australia
Posts: 431
Splint is on a distinguished road

After playing with the sphere idea I think it may not be as simple as it first looked. Maybe going back to the disk stepping along the edge curves and creating a curve from intersecting surfaces may be the way to go. Perhaps scripting in a condition to ignore intersecting lines may be a way of dealing with the corners.
The picture below is a conceptual drawing of what may work. The red line is the toolpath, the blue disk is oriented to the curve and steps along using the object intersection command to create the reference lines on the part surface. The intersecting reference lines in the corner are ignored.
Alternately it may be possible to take into account the intersecting reference curves and script in a method of deleting the loop which would occour in corners, this may be of use when the tool path creation nears the point where it finishes and may start to loop over itself.

Splint
Attached Thumbnails
Click image for larger version

Name:	intersecting.jpg‎
Views:	64
Size:	26.1 KB
ID:	33240  
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 03-11-2007, 03:10 AM
 
Join Date: Feb 2005
Location: Canada
Posts: 15
id 10 t is on a distinguished road

Instead of a sphere or disk just use a circle to find where the intersection points are on the surface (_Intersect). Then use InterpCrvOnSrf at these points to get the tool path on the surface.
I have attached a picture to demonstrate what I mean.

What type of tool path are you going to be working on first, Zigzag or offsetting from the surface’s edge curve?
Attached Thumbnails
Click image for larger version

Name:	5axisstep.JPG‎
Views:	62
Size:	52.6 KB
ID:	33354  
Reply With Quote

  #12   Ban this user!
Old 03-11-2007, 04:35 AM
 
Join Date: Jun 2003
Location: Australia
Posts: 431
Splint is on a distinguished road

The reason I'm thinking of a disk is because a line can be created using the object intersection command, the line could then be trimmed to the step over distance, in effect creating a true surface distance rather than a straight line distance from one path to the next. This may create better step over geometry, too complicated to worry about doing in the conceptual stage but worth considering later.
Zig zag or edge curve? I'm really not sure, I think zig zag may be slightly easier to deal with for a start but many of the issues which will arise will more than likely be common to both types of tool path.
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Constant Surface Speed raymond1 Bridgeport and Hardinge Mills 9 01-07-2007 10:17 PM
Bobcad scripting 69owb BobCad-Cam 1 05-14-2006 03:20 PM
Constant offset tooling for er-16 impact Benchtop Machines 13 03-30-2006 10:17 AM
Scripting Klox BobCad-Cam 29 10-02-2003 10:11 PM
Project a curve keithorr OneCNC 1 04-02-2003 10:36 PM




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





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361