Skip to main content

Module scene

Module scene 

Source
Expand description

What a drawing draws: the faces of a part and of every part placed in it, however deep, each where it is placed (Scene) — and seeing them all from one direction at once (Scene::project).

An assembly places the same part many times — a hundred screws of one size — so its hidden lines are found in two stages, and the costly one is done once per part however often it is placed:

  1. Each part on its own. A part’s lines, and which of them its own faces hide, are those project_view finds looking along the view’s direction turned into the part’s own frame. Placed parts of one component turned alike look at it from the same direction: they share that work, and draw the same lines moved to where each is.
  2. The parts together. Along a line one part shows, what another part hides of it changes only where the line passes behind that part’s outline on the paper, which the lines that part shows hold. So each line a part shows is cut where it crosses or runs along a line another part shows, and each piece is decided by a ray from its middle towards the eye, against the faces of that part (see Scene::together). A line its own part hides stays hidden. Where the lines of two parts cross is found to a coarser handoff than where a part’s own lines do (COARSE_SUBDIVISION): a part’s lines meet at its corners, which must be told apart from crossings near them, while two parts touch along curves that only touch on the paper — a screw’s round head over the flats of its nut — where a fine search runs a long way before giving up.
  3. Copies behind copies. A copy of a part placed exactly behind another, as the view sees it, is hidden by it whole, and adds no line (see Scene::mark_copies_behind): a row of screws seen end on is drawn as one.

A line is not cut where it enters another part, only where it passes behind its outline: parts that pierce each other are a known limit. The parts of an assembly touch, they do not overlap.

Structs§

Body
The faces of one part, where it is placed.
Scene
The bodies a drawing draws, and what seeing them needs.