Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88732756
plot_triangles.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Oct 20, 10:10
Size
679 B
Mime Type
text/x-python
Expires
Tue, Oct 22, 10:10 (2 d)
Engine
blob
Format
Raw Data
Handle
21810075
Attached To
rGEAR Gear
plot_triangles.py
View Options
#!/usr/bin/env python
from
numpy
import
*
from
pNbody
import
io
import
sys
import
libtessel
as
libt
file
=
sys
.
argv
[
1
]
triangles
,
num
=
libt
.
read_triangles
(
file
)
######################################################################
#
# PLOT
#
######################################################################
#sys.exit()
import
Ptools
as
pt
import
plot
########################
# draw a box
plot
.
draw_box
(
x
=
array
([
0
,
1
,
1
,
0
]),
y
=
array
([
0
,
0
,
1
,
1
]))
########################
# draw the triangles
for
Triangle
in
triangles
:
P1
=
Triangle
[
0
]
P2
=
Triangle
[
1
]
P3
=
Triangle
[
2
]
plot
.
draw_triangle
(
P1
,
P2
,
P3
,
c
=
'r'
)
pt
.
axis
([
-
0.1
,
1.1
,
-
0.1
,
1.1
])
pt
.
show
()
Event Timeline
Log In to Comment