Title: Add binding for Controller::draw() and drawTools() by damienmarchal · Pull Request #532 · sofa-framework/SofaPython3 · GitHub
Open Graph Title: Add binding for Controller::draw() and drawTools() by damienmarchal · Pull Request #532 · sofa-framework/SofaPython3
X Title: Add binding for Controller::draw() and drawTools() by damienmarchal · Pull Request #532 · sofa-framework/SofaPython3
Description: So it become possible to draw from python. I think we should discuss the API of this. Do we mimick the C++ one or do we make one that avoid data conversion. A small example: class DrawingExamples(Sofa.Core.Controller): def __init__(self, *args, **kwargs): # These are needed (and the normal way to override from a python class) Sofa.Core.Controller.__init__(self, *args, **kwargs) self.target = kwargs.get("target", None) self.mo = kwargs.get("mo", None) def draw(self, visual_context): dt = visual_context.getDrawTool() dt.drawPoints(array([[-1.5,-1.0,0.0]]), 5.0, RGBAColor("red")) dt.drawPoints([[-1.3,0,-1], [1.3,0,-1]], 10.0, RGBAColor("green")) dt.drawLines([[-1.3,0,-1], [1.3,0,-1]], 1.0, RGBAColor("green")) dt.drawFrames([[-1.5,0.1,-1]], [[0.0,0,0,1.0]], [0.1,0.1,0.1]) if self.target is not None: dt.drawPoints(self.target.position, 2.0, RGBAColor("blue")) dt.drawText([-2.0,0.0,0.0], 0.5, "This is not a raptor", RGBAColor("white")) dt.drawOverlayText([10, 10], 12, "Overlay text", RGBAColor("pink")) dt.drawFrames(self.mo.position, [0.1,0.1,0.1]) With the corresponding picture:
Open Graph Description: So it become possible to draw from python. I think we should discuss the API of this. Do we mimick the C++ one or do we make one that avoid data conversion. A small example: class DrawingExamples(S...
X Description: So it become possible to draw from python. I think we should discuss the API of this. Do we mimick the C++ one or do we make one that avoid data conversion. A small example: class DrawingExamples(S...
Opengraph URL: https://github.com/sofa-framework/SofaPython3/pull/532
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:c21d4bd5-56c1-f2e1-9be1-c913004dc0b9 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | A720:F9F81:474CEC8:5CF8E81:697DC007 |
| html-safe-nonce | 7bce395b752771456ce9da918ac1378ef141066fc5c14397381776508052606a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzIwOkY5RjgxOjQ3NENFQzg6NUNGOEU4MTo2OTdEQzAwNyIsInZpc2l0b3JfaWQiOiIyNTIxNzA2MzgzNjUzMzIyNzU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 43c41d25bc97da975f3a367a1d70e6d70d80afb05f38d53555173693c30e5362 |
| hovercard-subject-tag | pull_request:2778322103 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/sofa-framework/SofaPython3/pull/532/checks |
| twitter:image | https://avatars.githubusercontent.com/u/12644882?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/12644882?s=400&v=4 |
| og:image:alt | So it become possible to draw from python. I think we should discuss the API of this. Do we mimick the C++ one or do we make one that avoid data conversion. A small example: class DrawingExamples(S... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-cache |
| go-import | github.com/sofa-framework/SofaPython3 git https://github.com/sofa-framework/SofaPython3.git |
| octolytics-dimension-user_id | 11028508 |
| octolytics-dimension-user_login | sofa-framework |
| octolytics-dimension-repository_id | 260159147 |
| octolytics-dimension-repository_nwo | sofa-framework/SofaPython3 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 260159147 |
| octolytics-dimension-repository_network_root_nwo | sofa-framework/SofaPython3 |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width