3D プリンタのデータは「形(メッシュ)→ 層(スライス)→ 経路(G-code)→ 印刷中の層画像」と流れます。この族はその往復を、Fullseye の既存語彙(mesh / voxel / table / image2d / measurement / text)だけで、numpy + 標準ライブラリで閉じます。新しい型は作りません。
17 op / 5 カテゴリ(台帳は opsprintpath.py、実体は printpath.py):
gcode_read(G0/G1 を線分の表 table に: x0 y0 z0 x1 y1 z1 e f layer。G90/G91、M82/M83、G92、G20/G21、; コメント、層は ;LAYER:n か Z の増加。円弧 G2/G3 は拒む)/ gcode_write(表を G1 に書き戻す)/ gcode_extrusion_volume(Σe × フィラメント断面積 [mm³])/ gcode_time_estimate(Σ 距離 / 送り、加速度を無視した下限 [s])/ gcode_layer_image(1 層の経路を線幅つきのラスタに = 期待の層画像)。mesh_slice_contours(平面 z で切った輪郭 table: ring x y。三角形の法線で向きを付け、外輪郭は反時計回り・穴は時計回り)/ mesh_slice_stack(層ごとの塗りつぶしマスク voxel、nonzero winding で穴は穴のまま)/ contours_to_gcode(輪郭を周回する経路の表、押し出し量 = 線分長 × 線幅 × 層厚 / 断面積)。read_3mf / write_3mf(zip + XML の最小構成、単位換算、<build> の変換行列)。print_layer_defect_map(観測の層画像と期待の層画像を比べ、+1 = あるはずの所に無い(欠け)、−1 = 無いはずの所にある(はみ出し・糸引き)、tolerance_px で位置ずれと線幅の揺れを許す)。flowchart LR
M[mesh: read_mesh / read_3mf] --> S[mesh_slice_contours]
M --> V[mesh_slice_stack]
S --> G[contours_to_gcode] --> W[gcode_write]
W --> R[gcode_read] --> E[gcode_extrusion_volume / gcode_time_estimate]
R --> I[gcode_layer_image]
C[カメラの層画像] --> D[print_layer_defect_map]
I --> D
V --> X[vol_render_transfer で立体に]
import fullseye as fs
L = fs.ledger
V, F = fs.read_mesh("part.stl") # STL / OBJ / PLY / OFF、または L.read_3mf("part.3mf")
stack = L.mesh_slice_stack((V, F), layer_mm=0.2, px_per_mm=10.0) # (Z, Y, X) の層マスク
c = L.mesh_slice_contours((V, F), z=3.1) # 1 層の輪郭
g = L.contours_to_gcode(c, z=3.1, layer=15) # 周回の経路(最小のスライサ)
path = L.gcode_write(g, "part.gcode")
t = L.gcode_read("part.gcode") # どのスライサの出力でも(円弧は展開しておく)
print(L.gcode_extrusion_volume(t), "mm^3", L.gcode_time_estimate(t), "s (lower bound)")
expected = L.gcode_layer_image(t, layer=15, px_per_mm=10.0, bounds=(0, 0, 60, 40))
defects = L.print_layer_defect_map(camera_layer_15, expected, tolerance_px=3) # +1 欠け / −1 はみ出し
tests/test_printpath.py、examples/poc_print_layer_inspection.py);LAYER:n、PrusaSlicer は ;LAYER_CHANGE。タグが無ければ「押し出しを伴う Z の増加」で切る(layer_from="z" で強制)。mesh_orientation_consistent で先に直す。gcode_layer_image と同じ画素格子(bounds / px_per_mm)へ写す。stipple_points_from_image / stipple_energy / stroke_tour_closed / mst_length / stroke_resample_closed / stroke_tone_error: 写真の濃淡を 1 本の閉じた線にする層(TSP art)。濃淡を点の密度に写し(重みつき Lloyd)、その点を 1 回ずつ通って戻る巡回路に並べ、等弧長に打ち直して、描いた濃淡が目標とどれだけ違うかを返します。ペンプロッタの経路と 3D プリンタの経路は同じ対象なので、出口は既存の contours_to_gcode → gcode_time_estimate をそのまま使えます(「この絵は 1 本の線で紙の上に何メートル、何分で描けるか」)。★質は下界との比で言います —— 閉じた巡回路は最小全域木より短くなれません。mesh(STL / OBJ / PLY / OFF の読み書き、mesh_* 族)、videocube.vol_render_transfer(層の積みを立体に)print_layer_defect_map の +/− の面積を仕様と比べる