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

[SofaCarving] Add an example written in python #3457

Merged
merged 6 commits into from
Sep 6, 2023

Conversation

epernod
Copy link
Contributor

@epernod epernod commented Nov 4, 2022


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@epernod epernod added pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request pr: new feature Implement a new feature labels Nov 4, 2022
@epernod
Copy link
Contributor Author

epernod commented Nov 4, 2022

This is to answer #3395

Co-authored-by: Frederick Roy <fredroy@users.noreply.github.com>

#Function used only if this script is called from a python environment
if __name__ == '__main__':
main()
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of a global variable, please do something like

if __name__ == '__main__':
    with_gui = False
    if len(sys.args) == 2:
        with_gui = sys.args[1] == "with-gui"
    main(with_gui)

Would be even better to use argparser https://docs.python.org/3/library/argparse.html instead of manually processing the args.

@epernod epernod added pr: status wip Development in the pull-request is still in progress and removed pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request labels Nov 7, 2022
@epernod epernod added pr: fast merge Minor change that can be merged without waiting for the 7 review days 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 Sep 5, 2023
@alxbilger
Copy link
Contributor

Hi @epernod, since you changed the label from wip to 'to review', you need to trigger the build manually with [ci-build]. Also, I would rebase this branch since it is an old one.

@epernod
Copy link
Contributor Author

epernod commented Sep 5, 2023

[ci-build][with-all-tests]

@fredroy
Copy link
Contributor

fredroy commented Sep 6, 2023

FYI, SimpleCarving.py is not exectuted by the CI (or more precisely, there is no mention of it in the logs)

root.addObject('BVHNarrowPhase')
root.addObject('MinProximityIntersection', name="Proximity", alarmDistance=0.08, contactDistance=0.05, useSurfaceNormals=False)
root.addObject('CollisionResponse', response="PenalityContactForceField")
root.addObject('CarvingManager',active=True, carvingDistance=-0.01, narrowPhaseDetection="@narrowPhase", toolModel="@Instrument/CollisionModel/ParticleModel")
Copy link
Contributor

Choose a reason for hiding this comment

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

To be picky, I would simply expect a comment explaining what the CarvingManager does and its data (for you user standpoint)

Else 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done @hugtalbot , before the method and before adding the component.

@sofa-framework sofa-framework deleted a comment from hugtalbot Sep 6, 2023
@epernod
Copy link
Contributor Author

epernod commented Sep 6, 2023

FYI, SimpleCarving.py is not exectuted by the CI (or more precisely, there is no mention of it in the logs)

I would say, on s'en balek

@fredroy fredroy removed pr: fast merge Minor change that can be merged without waiting for the 7 review days pr: status to review To notify reviewers to review this pull-request labels Sep 6, 2023
@fredroy fredroy added the pr: status ready Approved a pull-request, ready to be squashed label Sep 6, 2023
@fredroy fredroy merged commit 82839f4 into sofa-framework:master Sep 6, 2023
10 of 13 checks passed
@epernod epernod deleted the inf_carv_python branch September 6, 2023 08:06
@hugtalbot hugtalbot added this to the v23.12 milestone Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: new feature Implement a 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.

None yet

5 participants