-
Notifications
You must be signed in to change notification settings - Fork 189
/
Copy pathTODO.txt
108 lines (92 loc) · 6.01 KB
/
TODO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Intro
-----
This TODO file should be seen as a braindump/notebook for viblo. Its content
are random ideas/thoughts/notes.
Most of it is quickly written down thoughts to not forget about things, but
they might not be thought through. It should not be seen as a formal roadmap,
things in here might be totally outdated or not desired. Its still contained
in the pymunk repo to keep things in the open.
If you want to make a request for something, please create a issue on the
Pymunk issue tracker, and not a change to this file. Im also happy to discuss
the topics in this file, if someone show interest in some specific thing its
more likely it will happen.
v6.x
----
- Think about experimental repr of Body
- Get inspiration of examples and debug drawing from here: https://github.com/liabru/matter-js
- Get inspiration of examples from the chipmunk2d examples.
- add better example benchmark for threaded solver
- automatic test build of android apk
- cleanup implementation of autoexample sphinx extension
- pickle: fix shape id
- make example of good timestep handling
- update most example code to use shape.density or shape.mass instead of
body.mass and moment.
- maybe it would be good to use pip install pymunk[docs] or something to distribute docs and examples?
- make running docs with python -m pymunk.docs... somehow. See pygame for inspiration
- can autosummary be used? (see stackoverflow answer)
- tests of py2exe/pyinstaller/cx_freeze?
- make example where a container is used for a complex shape such as car: https://stackoverflow.com/questions/55146932/grouping-without-collision-adding-and-removing-multiple-bodies-and-polygons-i/55150431#55150431
- Update docs with collision chapter. ShapeFilter, collision callbacks and such
- Write in docs about troubleshooting more prominent, and that its good to consider the properties on constraints like max_force
- Add Check that its not allowed to change body of shape added to space
- Make sure there's a check to see that the bodies of a constraint are added to space before constraint is added
- Add TKInter util module
- Update demos to not use positive_y_is_up hack except in a single case.
- Write something about the usage of logging.debug logs somewhere.
- Update benchmark
- Make benchmark that compares different pymunk and python versions easily
- Update get_vertices doc to use body.local_to_world shorthand to conv.
- Package pymunk for Pyodide
- Add Canvas util module (after pyodide)
- Use https://diataxis.fr/ method of organizing docs (tutorials, how-to, explanation, reference)
- Make sure cffi extensions included in wheel and zip!
- Catch error when NaN in debugdraw, suggest doublecheck mass=0. https://github.com/viblo/pymunk/issues/226 and https://github.com/viblo/pymunk/issues/267
- Make benchmark between pymunk and pybullet. 2d bullet inspiration: https://github.com/bulletphysics/bullet3/blob/2.83/examples/Planar2D/Planar2D.cpp
- After a couple of versions / time passed, re-evaluate if batch api should be separate or merged in to space.
- Think about the copyright notice in some files. Keep / put everywere / remove?
- Constraint private accumulated over previous time step properties are not saved when pickle.
- Add a test to check that version property is correctly set matching setup.py (and readme?)
- Make space step size default 1/60, and/or make it possible to set on the space instead of pasing in to step function to make api easier to use "right"
- Remove support for pyglet 1.5 in debug draw. Should be fine now that 2.x has been out for a long time.
- Think about if Pymunk should assert things that Chipmunk already asserts, like if a body can sleep when calling Body.sleep()?
v7+ (all potentially breaking changes)
---
- Think about split between pymunk.util and pymunk modules
- remake Body.each_arbiter into a arbiters list for a more pythonic interface.
Chipmunk improvements
---------------------
- Investigate the SPOOK solver, which could be much more stable than what is currently used. (but probably very difficult to switch to). https://github.com/viblo/pymunk/issues/216
- Investigate "Affine Body Dynamics Fast, Stable & Intersection-free Simulation of Stiff Materials"
- optimize step function:
- streamline build - benchmark
- https://www.microsoft.com/en-us/research/wp-content/uploads/2016/12/ccds.pdf
- collision detection:
- r-tree https://www.sebastiansylvan.com/post/r-trees--adapting-out-of-core-techniques-to-modern-memory-architectures/
- ideas from https://github.com/mtsamis/box2d-optimized
Typing a existing project - learnings
-------------------------------------
General
- Typing is recent addition, and many useful things are only available in very recent versions.
E.g. Literal is only in Python 3.8 and later.
mypy
- problems with bugs / missing features in mypy
- in implementation of Vector class: __add__ vs __radd__ https://github.com/python/mypy/issues/9388
- in allowing both vec2d and tuple/list: setters cant have different type from getter https://github.com/python/mypy/issues/3004
- __path__ not supported in packages. https://github.com/python/mypy/issues/1422
- problems with bugs / missing features in pyright
- differences in what is allowed between mypy and pyright/pylance.
- https://github.com/microsoft/pyright/issues/992
- The Pyright maintainer is super quick to respond, fix and release fixes for bug reports!
- Mypy issues feels slower to actually act on issues (But issue tracker is also very fast to
respond, and have GvR actively replying to many issues).
pyright
- Strange & unintuitive rules, such as type requirements for __add__ not the same as those of + (pyright)
https://github.com/microsoft/pyright/issues/992
Notes
-----
When freeing an object you do have to be careful that nothing else has a reference to it (dangling pointers).
Shapes and joints have a reference to the bodies they were attached to, so you have to free them before the
bodies that they reference.
Similarly, don't free a shape, joint or body before removing it from a space.
Unless I'm forgetting something, those are really the only gotchas.