-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (35 loc) · 1.08 KB
/
Copy pathmain.py
File metadata and controls
49 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'''
@author: Paul DiCarlo
@copyright: 2025 Paul DiCarlo
@license: MIT
@contact: https://github.com/pauldicarlo
'''
from sailocus.geometry import point
from sailocus.svg import svg
from sailocus.sail import sail
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtSvg import QSvgWidget
# import sys
# from pathlib import Path
# ys.path.append(str(Path(__file__).parent)) # Add project root
peak = point.Point(213, 510)
throat = point.Point(10, 233)
tack = point.Point(0, 0)
clew = point.Point(397, 29)
xsail = sail.Sail(tack=tack, clew=clew, head=None, peak=peak, throat=throat, sail_name = "Four sided sail")
xsail.validateSail()
xsvg = svg.SVG()
pathToFile = "./simpleSailFromClass.svg"
off_set = point.Point(25,25)
xsvg.createSailSVG(xsail, pathToFile, True, off_set)
# now display in a window using PyQt
app = QApplication(sys.argv)
window = QMainWindow()
window.setWindowTitle("SVG Viewer")
window.resize(500, 500)
svg_widget = QSvgWidget(pathToFile)
svg_widget.setMinimumSize(500, 500)
window.setCentralWidget(svg_widget)
window.show()
sys.exit(app.exec_())