Skip to content

[Prefabs] dataclasses to pydantic BaseModel#607

Open
EulalieCoevoet wants to merge 53 commits into
sofa-framework:25_04_work_on_new_prefabsfrom
EulalieCoevoet:pr_basemodelpydantic
Open

[Prefabs] dataclasses to pydantic BaseModel#607
EulalieCoevoet wants to merge 53 commits into
sofa-framework:25_04_work_on_new_prefabsfrom
EulalieCoevoet:pr_basemodelpydantic

Conversation

@EulalieCoevoet
Copy link
Copy Markdown
Contributor

@EulalieCoevoet EulalieCoevoet commented Apr 9, 2026

Example of usage:

    myParameters = """
                    name: Sphere
                    material:
                        type: RigidMaterialParameters
                        position: [[-1.5, 0, 0, 0, 0, 0, 1]]
                    visual:
                        color: [0., 1., 0., 0.2]
                        geometry: 
                            type: FileParameters 
                            filename: mesh/sphere.obj
                   """
    simulation.add(Entity, parameters=EntityParameters.fromYaml(myParameters))

hugtalbot and others added 18 commits April 8, 2026 17:33
* working deformable entity

* [splib] fixes match case

* [stlib] WIP on extract.py
* Add Sofa.Core.Node.add with preliminary test

* rename the "add" function and make it private

* Apply suggestions from code review

Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>

---------

Co-authored-by: Hugo <hugo.talbot@sofa-framework.org>
* Reorder files to match concepts

* Put every prefab in root to avoid having a useless prefix

* Fix bad import in bunny example

* Update examples/stlib/PrefabScene_beginner.py

Co-authored-by: EulalieCoevoet <eulalie.coevoet@gmail.com>

---------

Co-authored-by: EulalieCoevoet <eulalie.coevoet@gmail.com>
* cleaning to fix deformable example

* Restore checks on name and add check on the presence of parameters

* Allow to use default parameters (passing nothing to the add method except the class name

---------

Co-authored-by: Paul Baksic <paul.baksic@outlook.fr>
Because currently only Rigid3::VecCoord was supported.
commit b0cffe7
Author: bakpaul <paul.baksic@outlook.fr>
Date:   Tue Mar 3 10:17:06 2026 +0100

    Dump ideas

commit 4baade5
Author: Damien Marchal <damien.marchal@univ-lille1.fr>
Date:   Thu Oct 30 16:06:25 2025 +0100

    Register in the PythonFactory Rigid3::Coord (sofa-framework#544)

    Because currently only Rigid3::VecCoord was supported.

commit dd6865e
Author: bakpaul <paul.baksic@outlook.fr>
Date:   Mon Mar 2 14:26:25 2026 +0100

    Make exctracted topo working'

commit de007a3
Author: Paul Baksic <paul.baksic@outlook.fr>
Date:   Wed Oct 29 17:31:41 2025 +0100

    Added S, but still need to make the free motion not crash

commit d3148a5
Author: Paul Baksic <paul.baksic@outlook.fr>
Date:   Wed Oct 29 12:21:41 2025 +0100

    Fix plane and some splib deprecated components

commit d2c120e
Author: Paul Baksic <paul.baksic@outlook.fr>
Date:   Tue Oct 28 18:22:41 2025 +0100

    Add plane, still need to really implement function + started creating the scene
@EulalieCoevoet EulalieCoevoet requested a review from bakpaul April 9, 2026 13:31
- uses dynapydantic
- adds fromYaml and fromDict methods for parameters
- adds prefabs: cube, sphere and bunny
- and some cleaning
@bakpaul bakpaul force-pushed the 25_04_work_on_new_prefabs branch 2 times, most recently from 55ff092 to 09c1c67 Compare May 19, 2026 15:19
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.

4 participants