ワンクリックで
forgecad-image-replicator
// Build real ForgeCAD geometry from one or more reference images by treating images as evidence, inferring the object, then validating against both reference-matched and canonical views.
// Build real ForgeCAD geometry from one or more reference images by treating images as evidence, inferring the object, then validating against both reference-matched and canonical views.
| name | forgecad-image-replicator |
| description | Build real ForgeCAD geometry from one or more reference images by treating images as evidence, inferring the object, then validating against both reference-matched and canonical views. |
| forgecad-public | true |
Use this skill when the user provides one or more images and wants a ForgeCAD model of the object shown.
The reference image is evidence. It is not the deliverable.
The deliverable is a real parametric object that remains believable from front, back, side, top, bottom, and reference camera views. A model that matches one image but falls apart from other angles has failed, even if the comparison board looks close.
If a reference image is cutaway, sectioned, exploded, partly hidden, or transparent, treat that as evidence about the complete object. Do not make the default ForgeCAD result a permanently cutaway or exploded display unless the user explicitly asked for a teaching/display model. Build the closed artifact first, then use ForgeCAD viewer/inspection tools to recreate explanatory views.
forgecad for API docs, model authoring, and renderer behavior.forgecad-prepare-prompt when the image does not fully determine the artifact family, process posture, scale, operating story, or validation boundary.forgecad-make-a-model for file placement, decomposition, parametric modeling, and definition of done.forgecad-render-inspect before final delivery when the object has multiple parts, internal geometry, mechanisms, thin walls, or fit-sensitive features.Infer the real object before matching the camera.
Do not begin by chasing pixels, silhouettes, or the prettiest view. First form a 3D object hypothesis: what the artifact is, how it is made, what hidden sides must contain, what scale it likely has, and what geometry must exist for it to be physically coherent.
Reference matching is a validation step after the object exists.
Save the references.
Put all provided images in /tmp/<slug>-replicate/refs. Keep the original filenames. If there are multiple views, add clear view names when possible: front, side, rear-iso, top, detail, and so on.
Read the images as evidence. For each image, record:
Write a Real Object Brief. This is a hard gate before modeling. Include:
Choose the modeling structure.
Use a multi-file main.forge.js project when the object has distinct parts, repeated feature families, internals, purchased hardware, variants, or meaningful manufacturing assumptions. Put renderable/importable parts and sub-assemblies in neighboring .forge.js files; keep only pure dimensions, materials, math helpers, and lookup tables in plain .js files.
Build a coarse 3D blockout. Model the object, not the image. Start with the large volumes, axes, symmetry, side depth, rear form, underside, and hidden continuations. Render canonical views before doing reference-camera comparison.
Calibrate one camera per usable reference.
Match camera after the blockout makes sense from canonical views. Use the object center as target. Estimate azimuth, elevation, distance, and FOV from visible faces and perspective cues. Use orthographic when parallel edges stay parallel and there is no visible perspective convergence.
Render comparison boards. Render the model from each calibrated reference camera and place the result next to the original image. Do not compare from memory.
Iterate in the right order. Change one class of thing at a time:
If improving one reference view makes another view or canonical render worse, the object hypothesis is probably wrong. Fix the model, not the camera illusion.
Use every image as a constraint. When multiple images are attached, do not choose one as the target and ignore the rest. Assign each image a camera, evidence list, and confidence level. Optimize one shared geometry against the whole set. If an image is decorative, distorted, or contradictory, state how it was weighted.
Inspect the final object.
Run forgecad run, render the reference comparison boards, render canonical views, and use targeted forgecad inspect <evidence> commands. For multi-part, mechanical, internal, or fit-sensitive models, include inspect collisions and inspect sections, but keep the delivered model as the complete closed artifact.
ForgeCAD render 3d supports explicit camera control:
forgecad render 3d model.forge.js /tmp/render.png \
--camera "proj=perspective;pos=200,-160,120;target=0,0,20;up=0,0,1;fov=38" \
--size 1000
Supported camera forms:
--camera front, top, side, right, iso--camera 45:25 for azimuth/elevation in degrees--camera 45:25:260 for azimuth/elevation/distance--camera "proj=perspective;pos=x,y,z;target=x,y,z;up=0,0,1;fov=42"--camera "proj=orthographic;pos=x,y,z;target=x,y,z;up=0,0,1;zoom=4"If exact full camera specs do not render in the current checkout, fix the renderer before continuing. Do not work around missing camera control by guessing from default iso renders.
Prefer the built CLI from the repo checkout when available:
node dist-cli/forgecad.js render 3d path/to/model.forge.js /tmp/<slug>-replicate/render-front.png \
--camera "proj=perspective;pos=200,-160,120;target=0,0,20;up=0,0,1;fov=38" \
--size 1000 --edges thin
Build side-by-side boards with the bundled helper:
node skills/forgecad-image-replicator/scripts/compare_images.mjs \
/tmp/<slug>-replicate/refs/front.png \
/tmp/<slug>-replicate/render-front.png \
/tmp/<slug>-replicate/compare-front.png \
--height 900 --labels "Reference,ForgeCAD"
Common helper options:
node skills/forgecad-image-replicator/scripts/compare_images.mjs ref.png render.png compare.png
node skills/forgecad-image-replicator/scripts/compare_images.mjs ref.jpg render.png compare.png --height 1200 --fit contain
node skills/forgecad-image-replicator/scripts/compare_images.mjs ref.png render.png compare.png --fit cover --labels "Target,Current"
node skills/forgecad-image-replicator/scripts/compare_images.mjs ref.png render.png compare.png --no-labels
Use --fit contain by default. Use --fit cover only when both images already share the same crop and aspect.
A successful result:
forgecad runA result fails if it only works from the original camera.
When finished, report:
For non-trivial references, expect several render, compare, canonical-view, and inspect iterations. One render is not enough.
Reconstruct a parametric ForgeCAD model from an existing 3D CAD or mesh file such as STL, OBJ, 3MF, STEP, or STP; inspect the source asset directly, author real ForgeCAD geometry, and iteratively score the candidate with `forgecad score reconstruction`.
Create rough high-level ForgeCAD concept models from simple primitives to explore layout, proportions, motion, and part relationships without production detail. Use when asked for a quick model sketch, blockout, spatial mockup, or intuitive low-detail 3D concept.
Write a high-level design document (HLD) for a model, mechanism, or assembly before detailed specification or coding. Use when starting a new design, rethinking an existing one, or when the user asks to spec out, plan, or think through a model at a high level. Works backwards from requirements — defines the problem, explores alternatives, records decisions. Produces a right-sized design document for review and iteration.
Create manufacture-realistic prototype ForgeCAD (.forge.js) models in the active CAD project. Handles file placement, invokes the forgecad skill for API guidance, and validates the result.
Analyze, verify, and grade ForgeCAD or CAD-as-code models against a user requirement, design brief, prompt, reference, or acceptance criteria. Use when asked to evaluate, judge, QA, benchmark, score, rate, or compare a CAD model; render it from multiple angles, run targeted inspections when needed, visually verify the evidence, and produce a 0-10 score with concise justification.
Turn a fuzzy physical product, mechanism, or CAD artifact request into a concrete manufacture-realistic prototype ForgeCAD build brief and a single master prompt for the modeling pass. Use when the engineering brief is incomplete, manufacturing/process choice is underspecified, or the work needs a specific operating story to avoid generic toy solutions.