prefig 0.4.1.dev20250807054726__py3-none-any.whl → 0.4.2.dev20250814054001__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- prefig/core/point.py +11 -1
- prefig/resources/schema/pf_schema.rnc +2 -0
- prefig/resources/schema/pf_schema.rng +16 -0
- {prefig-0.4.1.dev20250807054726.dist-info → prefig-0.4.2.dev20250814054001.dist-info}/METADATA +1 -1
- {prefig-0.4.1.dev20250807054726.dist-info → prefig-0.4.2.dev20250814054001.dist-info}/RECORD +8 -8
- {prefig-0.4.1.dev20250807054726.dist-info → prefig-0.4.2.dev20250814054001.dist-info}/LICENSE +0 -0
- {prefig-0.4.1.dev20250807054726.dist-info → prefig-0.4.2.dev20250814054001.dist-info}/WHEEL +0 -0
- {prefig-0.4.1.dev20250807054726.dist-info → prefig-0.4.2.dev20250814054001.dist-info}/entry_points.txt +0 -0
prefig/core/point.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import lxml.etree as ET
|
|
2
2
|
import logging
|
|
3
|
+
import numpy as np
|
|
4
|
+
import math
|
|
3
5
|
from . import user_namespace as un
|
|
4
6
|
from . import math_utilities as math_util
|
|
5
7
|
from . import utilities as util
|
|
@@ -18,7 +20,15 @@ def point(element, diagram, parent, outline_status = None):
|
|
|
18
20
|
|
|
19
21
|
# determine the location and size of the point from the XML element
|
|
20
22
|
try:
|
|
21
|
-
p =
|
|
23
|
+
p = un.valid_eval(element.get('p'))
|
|
24
|
+
if element.get('coordinates', 'cartesian') == 'polar':
|
|
25
|
+
radial = p[0]
|
|
26
|
+
angle = p[1]
|
|
27
|
+
if element.get('degrees', 'no') == 'yes':
|
|
28
|
+
angle = math.radians(angle)
|
|
29
|
+
p = radial * np.array([math.cos(angle), math.sin(angle)])
|
|
30
|
+
element.set('p', util.pt2long_str(p, spacer=','))
|
|
31
|
+
p = diagram.transform(p)
|
|
22
32
|
except:
|
|
23
33
|
log.error(f"Error in <point> defining p={element.get('p')}")
|
|
24
34
|
return
|
|
@@ -685,6 +685,8 @@ Point = element point {
|
|
|
685
685
|
attribute at {text}?,
|
|
686
686
|
attribute style {text}?,
|
|
687
687
|
attribute size {text}?,
|
|
688
|
+
attribute coordinates {"cartesian"|"polar"}?,
|
|
689
|
+
attribute degrees {"yes"|"no"}?,
|
|
688
690
|
LabelAttributes,
|
|
689
691
|
FillAttributes,
|
|
690
692
|
CommonAttributes,
|
|
@@ -1886,6 +1886,22 @@
|
|
|
1886
1886
|
<optional>
|
|
1887
1887
|
<attribute name="size"/>
|
|
1888
1888
|
</optional>
|
|
1889
|
+
<optional>
|
|
1890
|
+
<attribute name="coordinates">
|
|
1891
|
+
<choice>
|
|
1892
|
+
<value>cartesian</value>
|
|
1893
|
+
<value>polar</value>
|
|
1894
|
+
</choice>
|
|
1895
|
+
</attribute>
|
|
1896
|
+
</optional>
|
|
1897
|
+
<optional>
|
|
1898
|
+
<attribute name="degrees">
|
|
1899
|
+
<choice>
|
|
1900
|
+
<value>yes</value>
|
|
1901
|
+
<value>no</value>
|
|
1902
|
+
</choice>
|
|
1903
|
+
</attribute>
|
|
1904
|
+
</optional>
|
|
1889
1905
|
<ref name="LabelAttributes"/>
|
|
1890
1906
|
<ref name="FillAttributes"/>
|
|
1891
1907
|
<ref name="CommonAttributes"/>
|
{prefig-0.4.1.dev20250807054726.dist-info → prefig-0.4.2.dev20250814054001.dist-info}/RECORD
RENAMED
|
@@ -28,7 +28,7 @@ prefig/core/network.py,sha256=1izAX2AKvnj2knElrdLeojE_0Q0zO0aQM-EsEwor0Os,27217
|
|
|
28
28
|
prefig/core/parametric_curve.py,sha256=ftxdg3gs0M0ME5iPJo3iEX7jT8PHQEMYpx8psr8Cm-w,3046
|
|
29
29
|
prefig/core/parse.py,sha256=plLmR0KKrUjYx0PmHHo5HZonaaT3tW4qjiDOtzuhSkQ,4542
|
|
30
30
|
prefig/core/path.py,sha256=8BbWAUzZqe1YD0gO4QtDENaINavAAC1mlU-y3UV-vu0,20312
|
|
31
|
-
prefig/core/point.py,sha256=
|
|
31
|
+
prefig/core/point.py,sha256=JhybSrEqxTWwXQVYQWw1_knBcWrttOuRUwKIlU8IshE,8730
|
|
32
32
|
prefig/core/polygon.py,sha256=8NVdWSUVXuNE4GiPQ4MySSmLy8aCNwKUqCcfHukizME,11301
|
|
33
33
|
prefig/core/read.py,sha256=Q1Nsluwysg3M5wtUmwIirfNo-Rw9-dFJPEeM4pDCpyo,1988
|
|
34
34
|
prefig/core/rectangle.py,sha256=b_ki7yqA4-mke1_0khvKqSKBRToB667mZc-xZhhPIBA,3473
|
|
@@ -56,13 +56,13 @@ prefig/resources/examples/tangent.xml,sha256=FLZaNz0iFoTLX6gB4pfLZFtu_TWeCug4Dda
|
|
|
56
56
|
prefig/resources/fonts/Braille29.ttf,sha256=T4hosDvaUGMVK0Wh0BmBgWeT7sQQmLXyA3gRUR-a0oE,55880
|
|
57
57
|
prefig/resources/js/mj-sre-page.js,sha256=LHVeI4dCH13bTv56nz3SKNo3JGRXa6joPM3D3wpKV40,9251
|
|
58
58
|
prefig/resources/js/package.json,sha256=hwKDg76_GzkhX72T7DRiF3FoMLokCv9PSLQvnW5Ovok,116
|
|
59
|
-
prefig/resources/schema/pf_schema.rnc,sha256=
|
|
60
|
-
prefig/resources/schema/pf_schema.rng,sha256=
|
|
59
|
+
prefig/resources/schema/pf_schema.rnc,sha256=00ja-tlc6jgDrnjNJ0QkYM8D4MJbdeB7j-DKCJ_AMYU,20253
|
|
60
|
+
prefig/resources/schema/pf_schema.rng,sha256=NURxWLPuw_T5sRR_OSwupH02E83W0KoixsLCc12R-IE,54849
|
|
61
61
|
prefig/resources/template/pf_publication.xml,sha256=eEv8HACv610Apw5DSVNy0reLfELYqHlNy9Oq0GH7C_c,200
|
|
62
62
|
prefig/scripts/__init__.py,sha256=qJcPi1WRh9UAwu4zIFJbmxWalAMilMYqgi6LxRkF7bI,25
|
|
63
63
|
prefig/scripts/install_mj.py,sha256=5A6-oc1xbIXka5mkFE70vlp9-Rh_QoxOxGMrQi9Hkio,1219
|
|
64
|
-
prefig-0.4.
|
|
65
|
-
prefig-0.4.
|
|
66
|
-
prefig-0.4.
|
|
67
|
-
prefig-0.4.
|
|
68
|
-
prefig-0.4.
|
|
64
|
+
prefig-0.4.2.dev20250814054001.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
65
|
+
prefig-0.4.2.dev20250814054001.dist-info/METADATA,sha256=BKDMfySMSXh-pLt6I8-t2wiDN9sl-cFar_swQCs_tkY,8728
|
|
66
|
+
prefig-0.4.2.dev20250814054001.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
67
|
+
prefig-0.4.2.dev20250814054001.dist-info/entry_points.txt,sha256=OP4ZQT71q2b0Zfbie-oM2Z1HlxpkuX7qaxJnzwsBOVQ,42
|
|
68
|
+
prefig-0.4.2.dev20250814054001.dist-info/RECORD,,
|
{prefig-0.4.1.dev20250807054726.dist-info → prefig-0.4.2.dev20250814054001.dist-info}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|