Grasshopper

algorithmic modeling for Rhino

I'm starting some work for a 2.5D CAD/CAM definition.  The attached file makes consecutive offsets for pocketing.  It works very well with regular convex polygons.  But as you can see in the screen print, it sometimes fails - in this case with the circle.  Another issue I'm trying to get over is how to handle curves that eventually create multiple inner regions like the one on the far right.  Any help with tweaking the current VB code will be much appreciated.  TYIA.

 

Views: 709

Attachments:

Replies to This Discussion

Hi Tuan,

Curve.Offset doesn't seem to work very well with circles on the inner side. I think you'd better make two cases if the curve is a circle then grab its centre an draw a series of circles, else offset it.

About offset, you give 0 as tolerance argument. This means "infinite" tolerance actually, so you must set it at 0.001 or 0.01 something like that. You can also use Doc.AbsoluteTolerance (from memory...)

Also I don't think you should offset and join in the same line. That's just my opinion.

As for multiple inner regions, I think it's a little bit complicated.

You need to check each crvNow for self intersection, and if it's true then find the inner regions and insert them into the original list of contours so that it's processed next. With appropriate pre-offset to respect the overlap setting.

Good luck,

Fred.

Thanks for the pointers Fred.  When it comes to the joining, i would only get of edge of polygons to offset if i don't do join before each offset.  am i missing a step/method in my code?

Did you ever succeed in making a pocket definition? I am currently working on a CAM definition..

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service