Save user preferences
save_preferencesStores user answers for print bed, material, filaments, quality, and outputs in topopt-preferences.yaml so later topopt runs reuse the same setup.
Instructions
Keep the answers of the user (print bed, material, filaments, quality, outputs) for the next runs, in topopt-preferences.yaml in the work folder. It writes only that file.
Use it once, after the user answered. environment shows the file in preferences. The server reads the file at each call.
A preference does not change a run by itself: run_topopt and check_problem fill nothing. build_regions takes a material, print or settings.voxel_size that the spec does not have at all, writes it into the YAML and says so in preferences_facts; a block that the spec gives, also a part of one, stays as it is. check_problem names a difference in preferences_facts.
Sections (each optional; checked like the problem YAML):
print: printer_model (a name or id from
find_printer; it gives the bed and type unless the YAML does), printer_type (fdm, sla, lpbf, sls), bed_mm (one number or [x, y] in mm), build_direction (+x to -z, or 3 numbers), self_supporting_angle_deg. A print limit (min_wall_mm) belongs to one part: it is refused.material: E (MPa), nu, density (g/cm3), filament (from
find_material; gives E and density), name (free text, for example "PETG").filaments: available (names or ids of the filaments the user has).
quality: voxel_size (mm).
outputs: renders (render_part), step (export_step), verify (verify_run). The STL and the part card are made in every run. [] is none of the three. A section you do not give stays; one you give is merged key by key: a key with null is removed, and {} removes the section (outputs too). An unknown key stays in the file. With no section it makes an empty file if none exists (the user kept the defaults). Returns: ok, path, values, changed, created, kept_not_used, problems, note. A wrong name, key or value gives {"ok": false, "error": ...} with the key, the value and the rule; nothing is written. It refuses a file that is not valid YAML and a folder that cannot be written. There is no CLI command: edit the file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | |||
| outputs | No | ||
| quality | No | ||
| material | No | ||
| filaments | No |