https://github.com/stla/pytorusthreepoints
Draw a torus passing through three given points.
https://github.com/stla/pytorusthreepoints
Last synced: 10 months ago
JSON representation
Draw a torus passing through three given points.
- Host: GitHub
- URL: https://github.com/stla/pytorusthreepoints
- Owner: stla
- License: gpl-3.0
- Created: 2021-10-08T18:50:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-19T21:54:57.000Z (over 4 years ago)
- Last Synced: 2025-03-31T11:15:14.824Z (about 1 year ago)
- Language: Python
- Size: 24.8 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyTorusThreePoints
Draw a torus passing through three given points.









## Usage
```python
import numpy as np
import pyvista as pv
from torus_three_points.main import torusThreePoints
plotter = pv.Plotter()
torusThreePoints(
plotter, p1, p2, p3, r, S=64, s=32, show=False, ....
)
```
#### Arguments
- `plotter`: PyVista plotter region
- `p1, p2, p3`: three points (numpy arrays)
- `r`: minor radius
- `S,s`: numbers of subdivisions for the torus mesh
- `show`: whether to show the figure (if `True`, this closes the plotter)
- `...`: parameters passed on to `pyvista.add_mesh`, such as `smooth_shading=True, color="red", specular=0.9`
Instead of setting `show=True`, you can run `plotter.show()` once you're done.