Skip to content

feat(model_physical_properties): physical properties of a model and their values per component - #306

Merged
BenPinet merged 10 commits into
nextfrom
feat/physical_properties
Nov 27, 2026
Merged

BenPinet merged 10 commits into
nextfrom
feat/physical_properties

Conversation

@SpliiT

@SpliiT SpliiT commented Nov 26, 2026

Copy link
Copy Markdown
Member

Back side of the physical properties in Vease: the model tree shows them, and the Vease-Modeling simulation setup will read them. The Front is on the branch with the same name.

What changes

  • model_physical_properties route: the physical properties of a BRep (or a model built on one, such as a StructuralModel). Each property gives:
    • its component type;
    • the mesh element carrying its attribute (polyhedron, polygon, edge or vertex), searched on the elements before the vertices, as the physical property only records the component type;
    • the attribute id and name;
    • the number of items;
    • for each component carrying it, the minimum and maximum of each item.
  • Attribute name: it can differ from the property name. In picasso_mecha, boundary_pressure is stored in an attribute named pressure. The front needs the attribute name to color the model by the property.
  • No value: an item without value is null, because NaN is not JSON. This is the case of a free axis of a boundary_displacement, e.g. [null, 0, null].
  • A model without physical properties returns an empty list. A non-model data returns 400.

Tests

  • A BRep built from cube.og_brep during the test, with:
    • a porosity on its Block;
    • a displacement with free x and z axes on two Surfaces, in an attribute named displacement.
  • A model without physical properties, and a point set.
  • The full test suite passes.
  • On the picasso flow and mechanics models (7 Blocks, about 120k polyhedra), the route answers in 0.2 to 0.3 s.

SpliiT and others added 6 commits November 26, 2026 11:21
… their value range on each component carrying them

Each property gives its component type, the mesh element and the name of the attribute holding its values (it may differ from the property name, e.g. "pressure" for boundary_pressure), and per component the minimum and maximum of each item. An item without value, such as a free axis of a boundary displacement, is null: NaN is not JSON.
…ith free axes on Surfaces, models without any
…eat/physical_properties

# Conflicts:
#	requirements.txt

@MaxNumerique MaxNumerique left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-repo review — feat/physical_properties

The contract lines up: the route, its JSON schema, the dataclasses and the generated .d.ts match what OpenGeodeWeb-Front#610 consumes.

  1. Design — blueprint_routes.py _physical_property: element_type, attribute_name and nb_items come from the first component that has the attribute. Each later component is then read from whichever element manager it matches first, and could land on a different one (e.g. vertex) without any error; the front would then color it as the wrong element. Either check that every component matches the first one, or restrict the search to that element after the first match.
  2. Design / readability — schemas/model_physical_properties.json: the nested item type is generated as a top-level Component interface. Too generic for the shared typed-schema module: the front already imports it as Component as PhysicalPropertyComponent, and the next route with a nested "component" will collide or get an auto-generated name. Give the nested schema a title such as PhysicalPropertyComponent.
  3. Design — same schema: element_type and component_type are free strings, but only polyhedron | polygon | edge | vertex and the BRep component types are valid. An enum would carry that into the TypeScript types; the front builds style-store method names from these strings, so a bad value only fails at runtime today.
  4. Readability — no_data is computed and returned but nothing in the front reads it (null items already mean "no value"). Use it or drop it to keep the contract minimal.

@MaxNumerique

Copy link
Copy Markdown
Contributor

🤖 claude-cross-repo-review: complete

@BenPinet
BenPinet merged commit 19b54a9 into next Nov 27, 2026
29 checks passed
@BenPinet
BenPinet deleted the feat/physical_properties branch November 27, 2026 16:06
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.

3 participants