kicad2ems.gui.draw3d¶
The Draw page's 3D view (gui.drawtab's DrawTab takes it as a mixin): the
board and the shapes extruded (a magnet in two halves, the pole on top and
the one below: N red, S blue), picked, boxed and dragged with the mouse, the
camera's presets (orthographic from the top, front and side: pyqtgraph's
projection overridden), a clip plane, what is shown, the selection's outline
and its gizmo (arrows with cone heads), and the working level's grid. The
numbers (the camera's matrices, rays, the axis drag, the box, the clip, the
outlines, the grid) are kicad2ems.core.view3d's, a magnet's halves
gui.drawmagnets'.
tab.camera('top' | 'front' | 'side' | 'iso') # fitted to the drawing
# (orthographic but for Iso)
tab.set_ortho(on) # the camera orthographic or not
tab.frame_3d() # the selection (else all) filling it
tab.box_select3d(x0, y0, x1, y1) # a pixel box's shapes (Shift + drag)
tab.set_clip(axis, value, keep) # axis 0 / 1 / 2 or None (off)
tab.set_shown(key, on) # 'substrate', 'cu:<layer>', a material,
# 'port'
tab.ray3d(px, py); tab.project3d(p); tab.pick3d(px, py)
- class kicad2ems.gui.draw3d.Draw3D[source]¶
The 3D half of DrawTab (its methods read the tab's drawing, selection, stack, snap and status).
- box_select3d(x0, y0, x1, y1)[source]¶
The shapes drawn wholly inside the 3D view's pixel box (x0, y0) to (x1, y1) selected (dragged right to left: those it touches), as the plan's box; what the clip took off, hidden shapes and materials not shown are not. The indices.
- camera(name)[source]¶
The camera from the top, front, side (orthographic) or a corner (iso, in perspective), fitted to the board and the drawing.
- frame_3d()[source]¶
The selection (else everything) filling the 3D view, seen from where the camera is.
- pick3d(x, y)[source]¶
(shape index, model point) under pixel (x, y) of the 3D view, or (None, None). Only drawn shapes are picked (not the board; not a hidden shape, a material not shown, or what the clip took off).
- ray3d(x, y)[source]¶
(origin, unit direction) of the ray under pixel (x, y) of the 3D view, model mm.
- set_clip(axis=None, value=0.0, keep='below')[source]¶
The clip plane: model axis 0, 1 or 2 at `value` mm, the side kept 'below' or 'above'; axis None: none.