Turn marks into hints
marks_to_hintsConverts Refine-page marks into facts, options, and a proposed YAML in a new folder without editing the mesh, so you can review and run topology optimization.
Instructions
Turn the marks of the Refine page into facts, options and a proposed YAML in a NEW folder. Edits no mesh.
A mark is a point of emphasis, not an absolute. The report gives, for each mark, the facts (position, radius, distance to the surface of final.stl, voxels touched, overlap with the design, fixed, load and keep-out regions, whether the region touches the material of final.stl) and the options for its type, and says which option the proposed YAML uses. The agent decides: read the report, change options and call again, edit the YAML, or run it with run_topopt.
The tool writes only into the new folder. It refuses an out_dir that is a run folder or inside one, one that holds an input file of the run (the folder of the YAML or of a region STL), a symbolic link, and a folder with files that is not an earlier hints folder; the reply names the fact and the options.
After it: check the report, then run_topopt with the proposed YAML and a new out_dir, then compare_runs.
Reply keys: resource topopt://replies/marks_to_hints (the meaning of each key).
marks: the path of marks.json (the Refine page exports it: version 1, mm, the frame of final.stl), its JSON text ("Copy JSON" on the page) or the marks object.
run_dir: the run the marks belong to. Default: the last run of this server. Needs run.json and the YAML it names.
out_dir: the new folder. Default: -hints beside the run folder. It holds the proposed YAML (the YAML of the run, with the changes), the region STLs (the originals are copied, the hints are new) and hints.json (the full report; its paths are relative to the folder).
detail: the full report in the reply (about 1.5 KB for each mark). Default: a short reply; hints.json has the full report.
options: remove ("keep_out" or "skip"), add ("solid" or "skip"), radius_scale (default 1.0; 0.5 gives smaller regions), protect_regions (default true: fixed and load regions are cut out of a keep-out hint), clip_to_design (default true: a solid hint is cut to the design space), per_mark ({mark id: option}).
overwrite: write again into a folder that holds an earlier hints.json.
yaml_path: the YAML of the run, when run.json names a file that is not there (a moved run). The labels check in the report says if it fits the run.
The input YAML, the run folder and the region STLs of the run stay as they are; the new region STLs touch the grid only inside the box of the input regions.
Mapping in this version: remove -> a keep-out STL (sphere, or capsule chain for a stroke) of radius radius_mm x radius_scale; add -> a forced-solid region (a load region that no load case uses); smooth -> facts and options only, because the YAML has no key that smooths one place. mirror repeats the mark at y -> -y. normals, amount_mm, strength and note are not used. The marks are read in file order and the first mark wins an overlap: a later hint region is cut by the earlier ones (a mark inside an earlier one has status no_effect, with the reason).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| marks | Yes | ||
| detail | No | ||
| options | No | ||
| out_dir | No | ||
| run_dir | No | ||
| overwrite | No | ||
| yaml_path | No |