Expand description
The plan of a ball-end mill’s lower envelope over a box: which surface is lowest where, as a graph of exact boundary curves (the second piece of the ball-end raster construction; the faces are built on it next).
The envelope (BallEnvelope) over each point of the box is the lowest
of the capsules’ parts, read by SURFACE: one cylinder for every run of
moves along one line (Part::Tube, the run’s moves joined end to end),
one sphere for every distinct ball centre (Part::Ball, the ball two
moves share at their joint once), and the stock’s top (Part::Top)
wherever nothing reaches below it. A ball is never lower than a tube of its
own (a move ending at its centre) where that tube’s foot lies on the move,
so there the tube is read: the boundary between a tube and its own ball is
the plane square to the move through the ball’s centre, found exactly, and
no rounding tie at the joint makes a ball region of no width.
The plan is read on a grid of the given cell: each node labelled by its part, each grid edge whose ends differ crossed where its two parts trade places (bisected to rounding on the pair’s own comparison), and the crossings linked through the cells they bound. A cell of two parts and two crossings links them; a cell of two parts crossed four times is read by its centre. A cell where three or more parts meet holds a VERTEX: it is solved by Newton on the pairs’ equations (the difference of two heights; for a tube and its own ball the plane between them), or the cell is quartered until it is (down to 1e-11 of the cell, where its centre is taken). A part met inside a grid edge whose ends agree (a region narrower than the cell where the grid crosses it) is refused, never guessed: the caller reads again at a smaller cell. A region the grid misses whole (no node in it, no side through it) is caught where it holds a witness: each move’s lowest line (below its centres, at half the cell’s spacing) and each ball’s lowest point; a part lowest at one that the plan does not name is refused the same way. The cell is the caller’s: a region that holds no witness and is narrower than the cell everywhere is not seen.
The result is checked before it is returned: at every crossing the two parts’ heights agree to 1e-9 of the radius and nothing else is lower there; at every vertex its parts’ heights agree and nothing else is lower.
Structs§
- Plan
- The plan’s graph, and the surfaces its parts name.
- Plan
Edge - A boundary curve of the plan from one vertex to another:
leftlies to its left in plan (looking down),rightto its right (Outsidealong the box’s sides, which run counter-clockwise).pointsare on the curve, lifted to the envelope, the vertices’ own points first and last. - Plan
Vertex - A point where three or more parts meet, or where a boundary meets the box’s side, or a corner of the box (lifted to the envelope there).
Enums§
- Part
- A surface the envelope lies on over part of the plan.
Traits§
- Field
- What a plan reads: over each point (x, y) of its chart, the part lowest there and its height (the stock’s top where nothing cuts below it), and each part’s own height and surface (continued past where it is read). A mill’s envelope over level ground reads in plan (x, y) and height z; a dome’s reads directions in a chart of the sphere, and the distance along each ray.
Functions§
- ball_
field - The mill’s envelope over level ground as a field over its plan, cut at
top. - plan_
field - The plan of
fieldover the boxbounds= [x0, x1] × [y0, y1] of its chart, read on a grid of aboutcell(see the module’s notes).