Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WireRestShape] Introduce use of RodSectionMaterial #65

Merged
merged 23 commits into from
Dec 7, 2023

Conversation

epernod
Copy link
Contributor

@epernod epernod commented Oct 4, 2022

Add new set of classes which hold the mechanical property and the topology (visual and collision) description of a section of the Rod/Wire.

  • BaseRodSectionMaterial // base class, not a component
  • RodMeshSection // section defined by a mesh
  • RodSpireSection // section defining a spire
  • RodStraightSection // section defining a straight line

Thoses classes are components to be placed in the graph and linked to the WireRestShape. All the Data which were managed by the WireRestShape have been moved to these new components. Here is the new usage:

For a simple spire catheter:

    <RodStraightSection name="StraightSection" youngModulus="20000" radius="1" massDensity="0.1" poissonRatio="0.3" nbEdgesCollis="30" nbEdgesVisu="200" length="980.0"/>
    <RodSpireSection name="SpireSection" youngModulus="20000" radius="1" massDensity="0.1" poissonRatio="0.3" nbEdgesCollis="5" nbEdgesVisu="200" length="20.0" spireDiameter="25" spireHeight="0.0"/>        
        
    <WireRestShape template="Rigid3d" name="BeamRestShape" printLog="1" wireMaterials="@StraightSection @SpireSection"/>

For a catheter with a mesh describing the tip:

    <MeshOBJLoader name="loader" filename="mesh/key_tip.obj" />
        
    <RodStraightSection name="StraightSection" youngModulus="1000000" poissonRatio="0.3" radius="10" massDensity="0.1" nbEdgesCollis="30" nbEdgesVisu="200" length="980.0"/>
    <RodMeshSection name="MeshTipSection" loader="@loader" nbEdgesCollis="300" nbEdgesVisu="300"  radius="10" massDensity="0.1"  youngModulus="1000000" poissonRatio="0.3"/>
        
    <WireRestShape template="Rigid3d" name="GC_RestShape" printLog="false" wireMaterials="@StraightSection @MeshTipSection" />
  • WireRestShape is still the main component to be used with BeamInterpolation and InterventionalRadiologyController.
  • WireRestShape also defines the densityOfBeams of each section of the Wire and their corresponding lengths.
    • All those data are now directly computed by accumulating the information from the different sections.
  • With this new design it is possible to define as many section of the wire as wanted using wireMaterials. densityOfBeams and keyPoints are automatically computed

Still to be done:
This PR is still a draft to discuss the design. Some features have not been moved yet:

  • WireSectionMaterial initFromLoader
  • WireSectionMaterial procedural creation using spireDiameter and spireHeight
  • Updating all the scenes

@epernod epernod added pr: clean pr: new feature pr: status to review To notify reviewers to review this pull-request labels Oct 4, 2022
@epernod epernod marked this pull request as draft October 4, 2022 14:25
src/BeamAdapter/component/model/WireSectionMaterial.cpp Outdated Show resolved Hide resolved
src/BeamAdapter/component/model/WireSectionMaterial.h Outdated Show resolved Hide resolved
src/BeamAdapter/component/model/WireSectionMaterial.h Outdated Show resolved Hide resolved
src/BeamAdapter/component/engine/WireRestShape.inl Outdated Show resolved Hide resolved
@epernod epernod added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels May 10, 2023
@epernod epernod marked this pull request as ready for review June 30, 2023 13:14
@epernod epernod changed the title [WireRestShape] Introduce use of WireSectionMaterial [WireRestShape] Introduce use of RodSectionMaterial Jun 30, 2023
@epernod
Copy link
Contributor Author

epernod commented Jun 30, 2023

Note that I have updated scene with exactly the same sampling as before for the regression test. But now that section are well divided, it would be much easier to add more beam/edges on the curve part of a coil than on the straight part.

Before (setting a number of edges for the whole tool) After, updating the edges per sections of the tool
image image

@epernod epernod added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Jun 30, 2023
@epernod epernod added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Sep 6, 2023
@epernod epernod closed this Nov 27, 2023
@epernod epernod deleted the BeamMaterial branch November 27, 2023 14:06
@epernod epernod restored the BeamMaterial branch November 27, 2023 14:10
@epernod epernod reopened this Nov 27, 2023
# Conflicts:
#	BeamAdapter_test/component/model/WireRestShape_test.cpp
#	src/BeamAdapter/component/engine/WireRestShape.h
#	src/BeamAdapter/component/engine/WireRestShape.inl
@fredroy
Copy link
Contributor

fredroy commented Dec 4, 2023

Last call before merging (as the new regression ref are working #121 )
Any feedback ? @EulalieCoevoet @adagolodjo @ChristianDuriez ... and (silent) others ?

@fredroy fredroy added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Dec 4, 2023
@ChristianDuriez
Copy link
Collaborator

Last call before merging (as the new regression ref are working #121 )
Any feedback ? @EulalieCoevoet @adagolodjo @ChristianDuriez ... and (silent) others ?

This seems to me to be a positive step towards simulating a wider range of tools.

@fredroy fredroy merged commit d4820a1 into sofa-framework:master Dec 7, 2023
2 of 4 checks passed
@epernod epernod deleted the BeamMaterial branch December 11, 2023 11:02
@epernod epernod added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: clean pr: new feature pr: status ready Approved a pull-request, ready to be squashed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants