Skip to content

Commit e18101e

Browse files
committed
cont
1 parent f321c1a commit e18101e

14 files changed

+160
-2
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ clipper_642/clipper.o
142142
clipper_642/clipper642_test.exe
143143
clipper_642/clipper642_test.o
144144

145-
pyside_ex/fonts
146-
pyside_ex/images
145+
misc_private/fonts
146+
misc_private/images
147147

148148
gcodeviewer/drawers/*h
149149
gcodeviewer/drawers/*cpp
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -----------------------------------------------------------------------------
2+
# Python & OpenGL for Scientific Visualization
3+
# www.labri.fr/perso/nrougier/python+opengl
4+
# Copyright (c) 2017, Nicolas P. Rougier
5+
# Distributed under the 2-Clause BSD License.
6+
# -----------------------------------------------------------------------------
7+
from glumpy import app, gloo, gl
8+
9+
vertex = """
10+
attribute vec2 position;
11+
void main(){ gl_Position = vec4(position, 0.0, 1.0); } """
12+
13+
fragment = """
14+
void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); } """
15+
16+
# Create a window with a valid GL context
17+
window = app.Window()
18+
19+
# Build the program and corresponding buffers (with 4 vertices)
20+
quad = gloo.Program(vertex, fragment, count=4)
21+
22+
# Upload data into GPU
23+
quad['position'] = (-1,+1), (+1,+1), (-1,-1), (+1,-1)
24+
25+
# Tell glumpy what needs to be done at each redraw
26+
@window.event
27+
def on_draw(dt):
28+
window.clear()
29+
quad.draw(gl.GL_TRIANGLE_STRIP)
30+
31+
# Run the app
32+
app.run()
File renamed without changes.

misc_private/shapely/plot.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import matplotlib.pyplot as plt
2+
from shapely.geometry import LineString, MultiPolygon, LinearRing, Point
3+
4+
a = Point(1,1).buffer(1)
5+
6+
x,y = a.exterior.coords.xy
7+
plt.plot(x,y)
8+
plt.show()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
from shapely.geometry import Polygon, LineString, MultiPolygon
3+
4+
# Define lines and polygons:
5+
link_geom = LineString([
6+
(364517, 364517),
7+
(265403, 364517),
8+
(265403, 265403),
9+
(364517, 265403),
10+
(364517, 364517),
11+
(367765, 367765),
12+
(262155, 367765),
13+
(262155, 262155),
14+
(367765, 262155),
15+
(367765, 367765)
16+
])
17+
18+
poly_geom = Polygon([
19+
(330708, 263779),
20+
(330037, 268874),
21+
(328071, 273622),
22+
(324943, 277698),
23+
(320866, 280827),
24+
(316118, 282793),
25+
(311023, 283464),
26+
(305928, 282793),
27+
(301181, 280827),
28+
(297104, 277698),
29+
(293975, 273622),
30+
(292009, 268874),
31+
(291338, 263779),
32+
(292009, 258684),
33+
(293975, 253937),
34+
(297104, 249860),
35+
(301181, 246731),
36+
(305928, 244765),
37+
(311023, 244094),
38+
(316118, 244765),
39+
(320866, 246731),
40+
(324943, 249860),
41+
(328071, 253937),
42+
(330037, 258684),
43+
(330708, 263779),
44+
])
45+
46+
multipolygon = MultiPolygon([poly_geom])
47+
48+
result = link_geom.difference(multipolygon)
49+
50+
print(result)
51+
52+
'''
53+
MULTILINESTRING (
54+
(364517 364517,
55+
265403 364517,
56+
265403 265403,
57+
291551.8771344455 265403),
58+
59+
(330494.1228655545 265403,
60+
364517 265403,
61+
364517 364517),
62+
63+
(364517 364517,
64+
367765 367765),
65+
66+
(367765 367765,
67+
262155 367765,
68+
262155 262155,
69+
291551.8771344455 262155),
70+
71+
(330494.1228655545 262155,
72+
367765 262155,
73+
367765 367765))
74+
'''
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading
Loading
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)