VibeFlow Geometry
This skill is responsible for turning caseDict.geometry into stable, repeatable, exportable, mesh-ready geometry artifacts. A geometry script is not an isolated CAD helper; it must serve downstream regions, interfaces, boundariesLoadsInitials, mesh, and post-processing sampling semantics.
When to Use
- CadQuery parametric CAD needs to be generated from
geometry.parameters,geometry.entities, andcaseMeta.units. - Existing
STEP/STL/BREPfiles need to be organized, checked, or re-exported. - A computational domain, obstacle, internal passage, multi-region solid, interface surface, load/boundary entity, or moving component needs to be constructed.
- Named bodies, domains, features, sensors, regions, and interfaces need to be aligned with downstream mesh and solver backends.
- Geometry modeling fails and the root cause needs to be classified as missing parameters, Boolean failure, scale issue, non-manifold geometry, or export problem.
What to Read First
caseMeta,intent,physicalProblem,geometry,materials,regions,interfaces,boundariesLoadsInitials, andmeshin0-caseDict/caseDict- Template structure:
StandardCase/0-caseDict/caseDict - CadQuery modeling conventions, export, and validation:
references/cadquery-playbook.md
Inputs
0-caseDict/caseDict- Existing geometry scripts or exported files under
A-geo/ - User-provided CAD, sketches, images, paper parameters, or
Ref/materials
Outputs
A-geo/geometry.pyA-geo/*.stepA-geo/*.stlA-geo/geometry_manifest.jsonorA-geo/geometry_validation.md- Preview scenes/images, build logs, and necessary repair records
A-geo/logs/cadquery_geometry_executor.logconfirmed clean after Studio rebuild or direct runner execution- Updates to
0-caseDict/caseDictwhen required
Path Selection
parametricCAD + cadquery: Preferred by default. Suitable for dimension-driven geometry, paper cases, reproducible experiments, and geometry that needs rapid parameter changes.importedSTEP: Preserve CAD semantics first. Check scale, solids, face/body naming, and whether splitting or manifest export is needed.importedSTL: Focus on watertightness, normals, duplicate faces, patch splitting, andsnappyHexMeshcompatibility.blockMeshPrimitive: For regular topology or teaching cases, do not force CAD; define geometry directly forblockMeshDict.oversetComposite/multiRegion: Confirm regions, interfaces, and moving boundaries first instead of exporting only a single STL.
Workflow
- Read
caseDict.geometry, while also confirming geometry-entity naming requirements fromphysicalProblem,regions,interfaces,boundariesLoadsInitials.boundarySets, andmesh.meshSource. - Validate the coordinate system, units, main flow direction, gravity direction, computational domain, key parameters, and region semantics.
- If key parameters are missing or a physical assumption would change the geometry, return to
vibeflow-case-dictfor follow-up questions. - Generate or organize the geometry script, keeping parameter names consistent with
geometry.parametersand entity names consistent withgeometry.entities. - Build named bodies / domains / features / sensors / regions / interfaces; avoid relying on fragile face indices.
- Export stable artifacts and write them to
geometry.artifacts. - Run lightweight validation: file existence, scale, bounding box, entity/region/interface/boundary-set coverage, and obvious non-manifold risks.
- If validation fails, write to
errors.entries, markstage=geometry, and state whether the issue is blocking.
Rules
- Parameter names must match
caseDict.geometry.parameters; do not introduce undocumented magic numbers inside scripts. - CadQuery scripts should preferably include clear
build_geometry(ctx)andexport_geometry(ctx, objects)or equivalent entry points, but basic preview must also work for ordinary CadQuery scripts that defineresult,objects, callshow_object(...), or leave top-level CadQuery objects. - Use
ctx.stage(name, object, color=..., alpha=...),show_object(...), or a returned dictionary for important named components so Studio's Geometry Preview tree can hide or show parts independently. A final boolean-unioned solid will normally appear as one object because feature history is not recoverable from the final BREP alone. - Exported filenames must be stable and semantically clear, such as
A-geo/exports/domain.step,A-geo/exports/body.stl, andA-geo/geometry_manifest.json. - Stabilize boundary, region, and interface naming before pursuing complex modeling techniques.
- Do not mix solver settings such as residuals, time steps, or post-processing charts into geometry scripts.
- Automatic repair, feature suppression, and tolerance relaxation must be recorded in
geometry,provenance.decisions, orerrors. - Any geometry simplification that changes physical meaning must be confirmed by the user or written to
intent.primaryAssumptions/provenance.assumptions.
Validation
- The script can run repeatedly without depending on the current shell's incidental working directory.
- After editing
A-geo/geometry.py, trigger Studio Rebuild/Auto Preview or run the geometry runner directly, then inspectA-geo/logs/cadquery_geometry_executor.log; there must be no traceback/error, andA-geo/preview/scene.jsonmust contain at least one preview object or OCP payload. - Exported files exist, are non-empty, and their paths are written back to
geometry.artifacts. - Key dimensions, bounding box, volume/area,
geometry.parameters, andgeometry.entitiesare consistent. geometry.entitiescovers the entities required by downstreamregions,interfaces, andboundariesLoadsInitials.boundarySets.- CAD/STL scale is consistent with
geometry.scaleToMetersandcaseMeta.units.length. - The output is sufficient for
vibeflow-meshto select a mesher while preserving region, interface, and boundary-set naming.
Fallback Conditions
- If dimension meaning is unclear, constraints conflict, or physical assumptions affect the geometry: return to
vibeflow-case-dict. - If CadQuery, Python, or export tools are unavailable: hand off to
vibeflow-toolchain. - If geometry is stable but mesh size fields, boundary layers, or conversion fail: hand off to
vibeflow-mesh. - After usable geometry has been generated, update
workflowStateor related status records only if there is no blocking geometry error.