Skip to content

feat(relief): add the relief command, a photo to a bas-relief model and depth map - #58

Draft
AltaMills wants to merge 1 commit into
mainfrom
ark/relief
Draft

AltaMills wants to merge 1 commit into
mainfrom
ark/relief

Conversation

@AltaMills

Copy link
Copy Markdown
Contributor

What

Adds meshy relief: one photo becomes a bas-relief 3D model and a 16-bit grayscale depth map, for 3D printing, laser engraving and CNC carving (Relief API, 20 credits per task, paid plan).

  • meshy relief create|get|list|wait|stream|delete on /openapi/v1/relief, built with the same resource command factory as the other endpoints (--data, -o, --async, --save-json, --operation-id included).
  • Create flags: --image-url, --variant, --depth-only (should_generate_model: false), --size-mm, --carving-mode, --carving-depth-mm, --remove-base <bool>, --removal-threshold, --base-thickness-mm, --bend-mode, --bend-axis, --bend-angle, --mesh-resolution, --target-formats <csv>, --color-mapping <bool>. Nothing is pinned: a flag left out is left out of the request.
  • The merged payload (--data included) is checked before the request: the documented ranges, an integer mesh resolution, the base-thickness rule, target formats without repeats, and settings the API would not use (D-076): --removal-threshold without --remove-base true, bend axis / angle without a bend, model settings with --depth-only. Two requests the API runs but that likely miss the intent are sent with a warning: color mapping on STL / 3MF only (color_not_in_formats), and a zero carving depth with the base removed (empty_model).
  • The depth map is an asset of its own (depth_map, depth_map.png): -o saves it with the models, a depth-only task saves it alone, and it is never transcoded (that would drop it from 16 bits to 8). The task view gains depth_map_url.
  • --model-format naming a format the task does not have now lists the formats it has. The 402 hint also names the free plan.
  • Docs: usage guide section, the agent skill, README, D-096 in the decision log.

Tests

pnpm typecheck && pnpm test: 728 tests, 727 pass, 1 skipped (as on main). New tests/relief.test.ts covers the registry entry, flag → body mapping (the API reference's advanced example, depth-only, remove-base, bend, --data), refusals with no request sent, warnings, get / list / delete routes, -o downloads of a colored task (OBJ + MTL + texture, 3MF, depth map, preview), streaming a depth-only task, and meshy download --asset depth_map.

…nd depth map

`meshy relief create|get|list|wait|stream|delete` calls /openapi/v1/relief
(20 credits, paid plan). Create takes every documented parameter: --variant,
--depth-only, --size-mm, --carving-mode, --carving-depth-mm, --remove-base,
--removal-threshold, --base-thickness-mm, --bend-mode, --bend-axis,
--bend-angle, --mesh-resolution, --target-formats and --color-mapping. Ranges,
the base-thickness rule and settings the API would not use are checked before
the request, for --data too.

The 16-bit depth map is an asset of its own (`depth_map`, depth_map.png): -o
saves it with the models, a depth-only task saves it alone, and it is never
converted to another image format. --model-format naming a format the task
does not have now lists the formats it has.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant