Selection sets and Properties authoring
Select what you care about, act on it once.
Open the panel with the toolbar's Selection button and choose the gesture mode — Single, Box or Lasso — from the segmented track. Ctrl+click toggles the picked element, condition or geometry in the ACTIVE set in any mode (each kind keeps its own id space — an Element 2 and a Condition 2 are different things and stay distinct). Box turns a left-drag into a rubber-band batch add. On the default renderer, box and lasso read the GPU's id buffer, so they pick exactly what is visible inside the region — down to a cell one pixel wide, and never one hidden behind another. The X-ray button (shown in Box and Lasso modes) instead picks every entity whose centre falls inside the region, hidden ones included; it ignores Clip and is limited to two million drawn entities. The experimental VTK-wasm renderer has no GPU selection and samples a capped grid of points instead, which can miss very small cells. Lasso places vertices one click at a time (an SVG polygon follows the cursor); clicking the first vertex or pressing Enter closes the region and picks everything inside, and Escape cancels the open lasso. Escape on a resting panel clears the active set.
Selection sets
A set is a named group of entities. It carries a seed:
| Seed | How the ids are derived |
|---|---|
| explicit picks | the ids you clicked / boxed |
| SubModelPart | the part's subtree |
| field range | the same cells the viewer's Threshold mode colors (with the same "all/any node in range" rule) |
| quality metric | meshQuality's bad / unacceptable elements |
| property id | every block row pointing at a Begin Properties id |
The seed is the survival mechanism: everything in this extension is a rebuild, and a set re-resolves its seed against every new model — a timeline step, an edit, a watcher tick. A set seeded by a field range follows the timeline step by step; an explicitly-picked set keeps exactly the ids that still exist in the mesh and prunes the rest. A selection that never silently survives onto unrelated ids is the whole contract: predicates keep working across edits because the predicate still matches, and frozen picks shrink to their survivors honestly.
Selecting with a formula
In the seed builder choose Formula and type a boolean expression over x, y, z, nodal fields and globals, using < <= > >= == != && || !, for example z <= 0.0 (the base of the model) or x > 1 && TEMP > 300. The rule decides how a cell qualifies: all nodes (default), any node or at its centroid. Add & create SubModelPart turns the result into a part in one step. The same seed works in mesh_select and createSubModelPartFromSelection: {"kind":"formula","expr":"z <= 0.0"}.
Area and volume
The Information section shows the model's volume (or area in 2D) and the SubModelPart info menu (the ⓘ button) shows each part's length, area or volume. The numbers are cached in the .kratosview.json sidecar and recomputed when the mesh changes. mesh_info reports them as measure.
Surviving a reopen
Selection sets are view state, so they are saved beside the mesh in <stem>.kratosview.json under the view key — the same sidecar that keeps your camera bookmarks and field settings. Closing and reopening the preview brings the sets back.
What is saved is the seed, not the answer: a predicate set stores its definition and re-resolves against the mesh that opens, so a field range follows whatever the file says now rather than what it said when you left. An explicitly-picked set has nothing to re-derive, so its id snapshot is saved too — and it prunes on the way back in, with a line naming the picks that are no longer in the mesh. Nothing here is geometry: saving a set never adds an entry to the Edit history and never marks the document unsaved, and there is no MCP tool for the sets themselves (mesh_select already evaluates the same seeds headless, and the acts a set drives are ordinary operations).
Sets are capped like the rest of the sidecar (a bounded number of sets, and a bounded number of ids per kind), because the sidecar is a view annotation rather than a mesh export.
Acting on a selection
- New SubModelPart — creates a SubModelPart holding the selection, with the selected cells' nodes riding with them (Kratos' parent/child subset rule). It is an ordinary, undoable operation: it shows in the Edit history like any other edit.
- Export — writes the selection as its own mesh file, preserving original ids (fields sliced to survivors, SubModelParts narrowed).
- Delete entities — deletes the selected entities as one undoable edit. There is no second rule: the delete is the complement of the selection export, so conditions on the surviving region stay, constraints vanish with their nodes, fields slice to survivors, SubModelParts narrow and orphan nodes are cleaned up. Undo brings them back.
- Isolate / Hide / Restore — suppress block layers by selection share (block granularity is stated in each button's tooltip, not hidden). Nothing here touches your outline checkboxes; Restore puts everything back.
- Frame — fit the view to the set's highlight.
- Clear — empty the active set (its seed stays, so you can re-resolve by re-picking or a model change).
Properties editor (Advanced ▸)
Lists every Begin Properties <id> block. Edit a value in place (Enter commits — a number, True/False, [1,2,3] vector, or raw text kept verbatim), New / Clone / Delete a set, and Assign a set to a SubModelPart's entities by rewriting their propertyIds rows. Geometries carry no properties and are refused by name; a delete is refused while any block still references the set.
Both authoring shapes are deliberately exposed — possible with a frame's girders sharing one CROSS_AREA:
- Shared-property editing changes the set in place; every block pointing at that id sees it.
- Clone-and-reassign copies the set to a fresh id without touching blocks, then
assignpoints selected blocks at it selectively.
A beam's CROSS_AREA resolves through these sets (Properties first, then an Elemental field), so editing it re-renders the beam tubes immediately — no second source of truth.
Select region (Mesh Modification ▸ Selection & combination)
The Select region form (meshio++ 18.0.0) creates a SubModelPart from cells or points chosen by geometry: a box, a plane (keeps the normal side), a sphere, the k-th connected component, or a patch grown from a seed point — the facet nearest the point, then every neighbour reachable without crossing a dihedral angle above the limit (default 30°), which selects "this flat face" of a CAD-like surface. Criteria combine (all must hold). test decides how a cell reduces its nodes for the geometric tests (all nodes, any node, or the centroid). The cells' nodes ride in, so the part is valid for Kratos. It is an ordinary undoable operation (selectRegion in recipes and mesh_transform; also selectRegion name=Top plane=[0,0,0,0,0,1] mode=centroid on the command line).
Headless (MCP)
Selection predicates and property mutations work headless too:
mesh_selectevaluates a seed (part/field/quality/property) and returns the per-kind id lists — the same cells the panel shows.mesh_transformacceptssetProperty,createProperty,cloneProperty,deleteProperty,assignProperty,createSubModelPartFromSelectionanddeleteEntities— a seed given to that op resolves against the rolling model at apply time, which makes "select by field, tag properties, group into a part" a single chained op array, and "delete the selection" one more named record.
Selection counts and action availability update while the panel stays open after edits, undo/redo, reloads, and timeline changes. Draft input and keyboard focus are preserved during these updates.