prefig 0.4.2.dev20250816053619__py3-none-any.whl → 0.4.3.dev20250822053531__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.
@@ -24,8 +24,9 @@ def parametric_curve(element, diagram, parent, outline_status):
24
24
  log.error(f"Error in <parametric-curve> defining domain={element.get('domain')}")
25
25
  return
26
26
 
27
- N = int(element.get('N', '100'))
27
+ arrows = int(element.get('arrows', '0'))
28
28
 
29
+ N = int(element.get('N', '100'))
29
30
  t = domain[0]
30
31
  dt = (domain[1]-domain[0])/N
31
32
  p = diagram.transform(f(t))
@@ -34,8 +35,21 @@ def parametric_curve(element, diagram, parent, outline_status):
34
35
  t += dt
35
36
  p = diagram.transform(f(t))
36
37
  points.append('L ' + util.pt2str(p))
38
+
37
39
  if element.get('closed', 'no') == 'yes':
38
40
  points.append('Z')
41
+
42
+ if arrows > 0 and element.get('arrow-location', None) is not None:
43
+ arrow_location = un.valid_eval(element.get('arrow-location'))
44
+ num_pts = 5
45
+ t = arrow_location - num_pts*dt
46
+ p = diagram.transform(f(t))
47
+ points.append('M ' + util.pt2str(p))
48
+ for _ in range(num_pts):
49
+ t += dt
50
+ p = diagram.transform(f(t))
51
+ points.append('L ' + util.pt2str(p))
52
+
39
53
  d = ' '.join(points)
40
54
 
41
55
  if diagram.output_format() == 'tactile':
@@ -51,12 +65,10 @@ def parametric_curve(element, diagram, parent, outline_status):
51
65
  diagram.add_id(path, element.get('id'))
52
66
  path.set('d', d)
53
67
  util.add_attr(path, util.get_2d_attr(element))
54
- # path.set('type', 'parametric curve')
55
68
 
56
69
  element.set('cliptobbox', element.get('cliptobbox', 'yes'))
57
70
  util.cliptobbox(path, element, diagram)
58
71
 
59
- arrows = int(element.get('arrows', '0'))
60
72
  forward = 'marker-end'
61
73
  backward = 'marker-start'
62
74
  if element.get('reverse', 'no') == 'yes':
@@ -641,6 +641,7 @@ Parametric-Curve = element parametric-curve {
641
641
  attribute N {text}?,
642
642
  attribute closed {"yes"|"no"}?,
643
643
  attribute arrows {text}?,
644
+ attribute arrow-location {text}?,
644
645
  attribute arrow-width {text}?,
645
646
  attribute arrow-angles {text}?,
646
647
  attribute reverse {"yes"|"no"}?,