Grasshopper

algorithmic modeling for Rhino

How to check if a surface can be milled by 3-axis milling machine?

It is not hard to see that some part of this surface cannot be reached by the 3-axis milling machine. How to check this with rhinocommon?

It would be quite brute force to check the surface with a vertical line intersecting the whole surface. Is there algorithm to achieve this?

Thank you.

-Jerome

Views: 3710

Replies to This Discussion

I'd also be interested in hearing about a code approach to this but here are some practical tips:

1. Draft Angle Analysis will give you visual confirmation of the part line (the line along which the 3-axis approachable portion of the surface meets the portion of the surface referred to as the "undercut").

2. Running the Silhouette command in the Top viewport (this is how a 3-axis machine "sees" your model by default) to generate a curve or series of curves as your part line.

Remember:

1. Your tool tip geometry and diameter play a large role in which portions of the surface are approachable. In other words, it's just just undercuts you're looking for but also tight valleys and pockets into which your end mill may not fit.

2. Approachability is relative - a change to the CPlane properly synced with the origin system in your CAM package will completely change which portions of your model can be defined by a 3-axis mill.

Hi, Brian

Thank you for your tips. The real circumstances are far more complex than my simplified question. Not only the tool tip geometry is important, the flute length, holder diameter is also of critical importance. The curvature variation of the surface will result in an impossible milling point due to the collision on the holder. I will check and see if rhinocam provide an api to make the simulation internally:)

-Jerome

My initial approach would be to sample the normal vector at enough locations. If the normal is horizontal or points down, you can't mill it. With "enough locations" I mean something quite specific. Given a nurbs-surface I'd sample at degree*2 samples per span in every direction. However normal vector evaluation is extremely fast so you can sample the living daylights out of a surface if you're worried you might miss a small spot.

With Breps it becomes somewhat trickier. The same logic applies, but you'll have to iterate over all faces and for every sample determine whether it's inside or outside the trimming region.

Alternatively you can convert the surface/brep to a mesh and then just iterate over all mesh normals.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you, David

I've tried normal checking and it's really fast. I used mesh to do this. 

By the way, what do you mean by "sample at degree*2 samples per span in every direction" ?

-Jerome

Nurbs curves and surfaces have knots. For surfaces, knots in two directions (U and V). So a surface is actually made up of a patchwork of little sections delineated by knots in both directions. These segments are called "spans". Spans are useful because they represent a single "piece" in the "piecewise" nature of Nurbs. A single span is governed by only a single polynomial (or in the case of surfaces an interpolation between 4 polynomial boundary conditions) and therefore has limited complexity.

The higher the degree, the more complexity a span can have. Thus, if a surface has degree 2 in the U direction and degree 5 in the V direction, you should sample it with a sampling grid of 4×10 (2*2 × 5*2). Though on second thoughts I think you're better off sampling more often than twice the degree, you want to find even small areas that are beyond vertical.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you! David.

Converting to mesh and use mesh faceNormals seems to be a simpler way, but may not be as fast as sampling on surface I think.

-Jerome

Also there may be bits of the surface which are underneath other objects that prevent the tool from reaching it (like the left portion of the top-most blob on the surface shown above). Since these ares may have normals that face up there might need to be some sort of additional analysis to identify these problematic spots.

Not that I claim to have a solution :) My gut would be (if you are interested in just identifying these problem areas) to do the vertical line intersections like you mentioned, and if there are multiple intersections on a given line, then store all but the first intersection as problem sample points on the surface.

It sounds like you may have tried something similar and it was computationally expensive - so I'm sure there are better ways of going about this... just thinking out loud :)

-Brian

"the left portion of the top-most blob" is actually part of that same surface. It cannot overhang itself without first having a horizontal normal vector. If you're dealing with an aggregate of different surfaces than you indeed need to perform intersection/collision tests, but for a single surface a normal-vector test should suffice.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hey David,

Right, I see. I was just thinking that if he wants to run an analysis that outputs a high poly mesh representation of the surface with color coded areas showing what little mesh faces can't be reached that it might not be enough to evaluate just the normal of each face in the mesh since some small faces may be in the "shadow" of another portion of the same surface.

Maybe I'm assuming something other than what Jerome is after (or just not fully understanding)

Brian

Now I'm trying to figure this out as well :)

Here was my thought (definitely nowhere near enough resolution to get anything useful from it, but just a diagram):

I see what you mean, Brian. I was able to do this (in Grasshopper, not in code) by first isolating the sample points with a normal value equal or less to 0. Once those points were isolated, I used them as start points for some long lines running in the opposite vector of the CPlane Z axis. Lastly, I found where those lines intersected my original surface to identify both the undercut portions and "shadow" portions of the surface (foreground).

The surface in the background shows how it was still quicker to run a Silhouette command followed by a Project command, trim the curves to a single closed boundary, and use that boundary to split the surface so that I can create surface-based boundaries from multiple approach positions in my CAM package.

This does, however, bring up a coding opportunity: How do I generate a closed curve-on-surface that tightly bounds a collection of surface points found to be unreachable?

Ah yes, I thought it was just a test to see whether a shape could be milled at all. If you want more detailed information then you do need to take shadowing into account. I don't know what the fastest way would be to get this information.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service