Geometric tools for parsing GeoGebra construction, proccess with manim animation and export to SVG
Project description
GeoDynamic
Installation
pip install --upgrade geodynamic
Using in terminal
python -m geodynamic test.ggb -s pandora.json -px 240 auto
Description:
usage: geodynamic [-h] [-o OUTPUT] [-px PX PX] [-s STYLE] ggbfile
positional arguments: ggbfile GeoGebra file to parse
options: -h, --help show this help message and exit -o OUTPUT, --output OUTPUT SVG file to export into -px PX PX image width and height in px (values: num or auto) -s STYLE, --style STYLE JSON file with style definitions
Using in code
- Preparing code
test.py
:
from geodynamic.manim_dynamic import *
class TestScene(GeoDynamic):
def construct(self):
self.loadGeoGebra('test.ggb', style_json_file = 'pandora.json', px_size = [400, 'auto'])
self.exportSVG('test.svg')
- Run compilation:
manim 'test.py' TestScene
Style definitions in JSON
Here is an example of JSON-file for styling images:
{
"name": "pandora",
"version": 0.1,
"style": {
"dot": {
"main": 7,
"bold": 9,
"aux": 5
},
"line": {
"main": 2,
"bold": 2.5,
"aux": 1.5
},
"angle": {
"line": 1,
"r_default": 20,
"r_shift": 3,
"r_right": 14
},
"strich": {
"width": 1,
"len": 12,
"shift": 4
},
"arrow": {
"width": 7.5,
"length": 10.5
},
"color": {
"black": "#000000",
"main": "#2581b5",
"light": "#bef3fc",
"aux": "#000000",
"acc": "#ef60ab",
"acc_light": "#ffd2ee"
},
"font": {
"size": 17
}
},
"technic": {
"line_caps": "round",
"right_angle_joint": "miter",
"polygon_boundary_layer": "top",
"points_display": "only_labels",
"crop_padding": 4,
"scale_export": 0.75
},
"ggb_export": {
"colors": {
"#1565c0": "main",
"#1565c0 0.1": "main 0",
"#d32f2f": "acc",
"#d32f2f 0.1": "acc_light 1",
"#616161": "aux",
"#000000 0.6": "main",
"#000000 0.1": "light 1",
"#1565c0 0": "white 1",
"#d32f2f 0": "white 1"
},
"dot": {
"5": "main"
},
"line": {
"5": "main",
"3": "aux"
}
}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for geodynamic-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eadaa16f3b0f4809bfe51295c39e5234bb933ee0ee0472f9d148faa5a27a0500 |
|
MD5 | 6efb709be3ce78d31fb5458196803cea |
|
BLAKE2b-256 | e85f2d8d270731000aaf7a73155260061e8288a7f8dffa5cf022b00f2ec51a6c |