File: test_booleanshapeoperations.py

package info (click to toggle)
python-beziers 0.6.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 672 kB
  • sloc: python: 3,160; makefile: 20
file content (21 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import unittest
from beziers.path import BezierPath
from beziers.path.representations.Nodelist import NodelistRepresentation, Node
from beziers.point import Point
from beziers.path.geometricshapes import Circle, Square

class BooleanShapeOperations(unittest.TestCase):
  def drawIt(self, s,c,paths):
    import matplotlib.pyplot as plt
    fig, ax = plt.subplots()
    s.plot(ax,drawNodes=False)
    c.plot(ax)
    for p in paths:
      p.plot(ax,drawNodes=False,color="red")
    plt.show()

  def not_a_test_square_circle_union(self):
    subject = Square(10, origin=Point(5,5))
    clip = Circle(10, origin=Point(15,15))
    paths = subject.union(clip)
    self.drawIt(subject,clip,paths)