Originally Posted by holger Hello,
i am trying same thing with a stl. But i try to build a offset surface wuch will be the tiilpath for end ballmill.
Slicing through the model is very easy. If you slice along the z- axis take any z coo you want. Then sub fro, every triangle this z value. If you get for a corners of the triangle the same sign (+ or -) this will nit cit the plan. If the a different you must calculate the crossingpoints from the triangle edge and the plan. This point will give a line on the plan. U can look fir the source if you want. Written in C.
regards Holger |
Yes, what you described sounds like how I would do it:
You define a plane for a given Z Level. Then you intersect every triangle in the model with the plane. Most triangles will not intersect. Some will intersect at a point and some will intersect at a line. All of the intersections then need to be sorted in either clockwise or CCW order and linked together. This gives you a profile around the model. What complicates things is that there could be multiple pockets and each one needs to be independently sorted and linked.
For a ball nose cutter and Z level machining you can pretend the cutter is a sphere of the same radius as the cutter. Then calculate the offset based on the radius and depth of cut. Hopefully you can make the assumption that the model being cut is convex with respect to Z and thus every deeper level is at least as large as the higher level. This simplifies gouge checking and will be true for most any model which could be cut in 3 axis.