Expand description
The live 3D model a sheet PDF can carry — a U3D stream (super::u3d) and
the PDF 1.7 dictionaries that show it (ISO 32000-1 §13.6).
§What the reader sees
One U3D stream holds the whole scene, shared by every 3D annotation in the file:
- each drawn solid as a MESH node named for the solid, and its edges as a
dark LINE SET node beside it (
{solid} edges), so the model reads as a CAD model and not a smooth blob; - each enabled, resolved annotation of each saved view with a camera as a
LINE SET node (
PMI {view} {annotation}: dimension, extension and leader lines, frames, and the text STROKED with the PMI font — the samepmi_presentlayout the viewport and the STEP presentation use, sized as the viewport drew it when the view was saved), plus a small MESH node for its filled arrowheads (… fill).
Each saved view is a /3DView in the stream’s /VA list: its camera as the
camera-to-world matrix, its projection, and a /NA node list that shows
THAT view’s annotations and hides every other view’s, and hides the solids
the view hides. A reader’s view menu is therefore the document’s PMI view
list, and picking one shows exactly that view’s PMI.
Only readers that implement 3D annotations draw any of this — Adobe Acrobat / Reader (with 3D enabled) and Foxit. Every other reader shows the annotation’s appearance, which is why the sheet’s own vector drawing stays on the page beneath a placement, and why the full 3D page draws the default view as a hidden-line drawing under its 3D box.
§The camera
A view’s /C2W maps camera coordinates to world coordinates: its columns
are the camera’s x axis (right), y axis and z axis (the viewing direction,
eye → target), then the eye. ISO 32000-1 §13.6.5 states the camera’s y axis
points UP; CAMERA_Y_UP records which way this writer points it, because
the claim is checked in a real reader, not taken from the text.
Structs§
- Body
- One solid, gathered by the engine from the display scene.
- Button
- A view button on the 3D page.
- Drawn
Annotation - One annotation laid out in world space as a 3D view draws it.
- Model3d
- The file’s 3D content: the U3D bytes, the node names in stream order, and every saved view that has a camera.
- Page3d
- The 3D page: a title, the 3D box, a button per saved view, a caption.
- Pdf3d
- Everything 3D a sheet PDF carries.
- Placement3d
- A placement drawn live: a 3D box over the placement’s drawing, opening on the placement’s own camera at the placement’s own scale, so activating it changes nothing until the reader turns the model.
- Plan
- The object numbers of every 3D object, assigned before any is written so the page dictionaries can name their annotations.
- Summary
- What a PDF carries in 3D, read back from its bytes: the count of 3D
annotations, of views in the stream’s
/VA, of view links, and the U3D stream’s decoded size — what the export door reports about the file. - View3d
- A saved view as the reader will show it.
Enums§
- Projection3d
- How a view projects.
Constants§
- CAMERA_
Y_ UP - The camera’s y axis is the view’s UP vector (true) or its down vector (false). See the module doc.
- CAPTION
- The paragraph under the 3D box — the truth about who can show it.
- ISOMETRIC
- The id of the view a document without saved views opens on.
Functions§
- ascii85
- ASCII85 (ISO 32000-1 §7.4.3),
~>-terminated, in 76-character lines. - build
- Build the 3D model: the solids, then every saved view’s annotations.
- c2w
- The 12-element camera-to-world matrix and the distance to the centre of orbit (the camera’s target).
- camera_
frame - The camera’s right, up and forward (eye → target) unit vectors;
Nonefor a degenerate camera (eye on target, or up along the view). - isometric_
camera - Looking down the (−1, −1, −1) diagonal at the solids’ box centre, +Y up (the application’s), orthographic, the bounding sphere filling the height.
- projection
- A view’s projection: a perspective camera keeps its field of view; an
orthographic one is scaled so its saved half height fills half of a 3D
box
box_height_pttall, unlessscalefixes it. - rect_pt
- A 3D annotation’s rectangle in PDF points: centred on
centre_mm(sheet millimetres from the top-left),half_mmeither way, on a pagepage_height_mmtall. - stage_
matrix - A solid’s explode stages as a
/3DNode /M: the matrix’s three columns, then its translation, the order/C2Wis written in. Every stage is affine, so the composition is read off where it takes the origin and the three unit points. - stream_
object - The 3D stream: every saved view in
/VA, the default the first, and the U3D bytes ASCII85-encoded so the file stays ASCII (the PDF writer’s contract). - summary
Summaryof a file this module wrote;Nonewhen it carries no 3D.- view_
annotations - Every drawable annotation of a saved view (
rows, its report) laid out for a 3D model shown fromcamera: sized as the viewport sized them when the view was saved (the overlay’s pixel sizes times the saved camera’s world per pixel; a model-unit line cannot stay a constant size on screen, so this is exact at the view’s own framing and scales with the model when the reader zooms), a view-aligned row laid out in the view-parallel plane through its label, facing the camera, as the STEP presentation lays it out. The 3D PDF and the instructions player both draw these. - view_
dict - A
/3DViewdictionary:namein the reader’s menu, the view’s camera,projection, its render mode, a CAD lighting scheme, and every node’s visibility. - world_
per_ pixel - Model units per viewport pixel under a saved camera, in the viewport the
view was saved from —
ViewCamera::world_per_pixel’s rule.