Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
threevis
threevis
Commits
db5ed605
Commit
db5ed605
authored
Apr 04, 2018
by
Isaak Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass keyword arguments as keyword arguments for immediate calls
parent
e5bf8a4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
20 deletions
+51
-20
threevis/immediate.py
threevis/immediate.py
+37
-11
threevis/openmesh_utils.py
threevis/openmesh_utils.py
+14
-9
No files found.
threevis/immediate.py
View file @
db5ed605
...
...
@@ -5,21 +5,47 @@ Immediate drawing without explicitely creating a context.
from
.context
import
Context
def
display_faces
(
vertices
,
face_indices
,
normals
=
None
,
colors
=
None
,
uvs
=
None
,
shading
=
'flat'
,
z_offset
=
0.5
,
texture
=
None
,
line_width
=
1
,
width
=
600
,
height
=
400
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
Context
(
width
,
height
,
background_color
).
draw_faces
(
vertices
,
face_indices
,
normals
,
colors
,
uvs
,
shading
,
z_offset
,
texture
,
line_width
,
clipping_planes
).
set_bounds
(
show_bounds
).
display
()
shading
=
'flat'
,
z_offset
=
0.5
,
texture
=
None
,
line_width
=
1
,
width
=
600
,
height
=
400
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
Context
(
width
,
height
,
background_color
).
draw_faces
(
vertices
,
face_indices
,
normals
=
normals
,
colors
=
colors
,
uvs
=
uvs
,
shading
=
shading
,
z_offset
=
z_offset
,
texture
=
texture
,
line_width
=
line_width
,
clipping_planes
=
clipping_planes
).
set_bounds
(
show_bounds
).
display
()
def
display_edges
(
vertices
,
edge_indices
=
None
,
colors
=
None
,
uvs
=
None
,
z_offset
=
0
,
texture
=
None
,
line_width
=
1
,
width
=
600
,
height
=
400
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
Context
(
width
,
height
,
background_color
).
draw_edges
(
vertices
,
edge_indices
,
colors
,
uvs
,
z_offset
,
texture
,
line_width
,
clipping_planes
).
set_bounds
(
show_bounds
).
display
()
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
Context
(
width
,
height
,
background_color
).
draw_edges
(
vertices
,
edge_indices
,
colors
=
colors
,
uvs
=
uvs
,
z_offset
=
z_offset
,
texture
=
texture
,
line_width
=
line_width
,
clipping_planes
=
clipping_planes
).
set_bounds
(
show_bounds
).
display
()
def
display_vertices
(
vertices
,
colors
=
None
,
uvs
=
None
,
point_size
=
1
,
z_offset
=
0
,
texture
=
None
,
perspective
=
False
,
width
=
600
,
height
=
400
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
Context
(
width
,
height
,
background_color
).
draw_vertices
(
vertices
,
colors
,
uvs
,
point_size
,
z_offset
,
texture
,
perspective
,
clipping_planes
).
set_bounds
(
show_bounds
).
display
()
def
display_vertices
(
vertices
,
colors
=
None
,
uvs
=
None
,
point_size
=
1
,
z_offset
=
0
,
texture
=
None
,
perspective
=
False
,
width
=
600
,
height
=
400
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
Context
(
width
,
height
,
background_color
).
draw_vertices
(
vertices
,
colors
,
uvs
=
uvs
,
point_size
=
point_size
,
z_offset
=
z_offset
,
texture
=
texture
,
perspective
=
perspective
,
clipping_planes
=
clipping_planes
).
set_bounds
(
show_bounds
).
display
()
def
display
(
obj
,
shading
=
'flat'
,
point_size
=
1
,
z_offset
=
0
,
texture
=
None
,
perspective
=
False
,
width
=
600
,
height
=
400
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
Context
(
width
,
height
,
background_color
).
draw
(
obj
,
shading
=
shading
,
point_size
=
point_size
,
z_offset
=
z_offset
,
texture
=
texture
,
perspective
=
perspective
,
clipping_planes
=
clipping_planes
).
set_bounds
(
show_bounds
).
display
()
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
Context
(
width
,
height
,
background_color
).
draw
(
obj
,
shading
=
shading
,
point_size
=
point_size
,
z_offset
=
z_offset
,
texture
=
texture
,
perspective
=
perspective
,
clipping_planes
=
clipping_planes
).
set_bounds
(
show_bounds
).
display
()
threevis/openmesh_utils.py
View file @
db5ed605
...
...
@@ -4,20 +4,25 @@ from .immediate import display_faces
def
display_openmesh
(
mesh
,
normals
=
None
,
colors
=
None
,
uvs
=
None
,
shading
=
'flat'
,
z_offset
=
0.5
,
texture
=
None
,
width
=
600
,
height
=
4
00
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
z_offset
=
0.5
,
texture
=
None
,
line_
width
=
1
,
width
=
6
00
,
height
=
400
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
display_faces
(
mesh
.
points
(),
mesh
.
face_vertex_indices
(),
normals
,
colors
,
uvs
,
shading
,
z_offset
,
texture
,
width
,
height
,
background_color
,
clipping_planes
,
show_bounds
)
display_faces
(
mesh
.
points
(),
mesh
.
face_vertex_indices
(),
normals
=
normals
,
colors
=
colors
,
uvs
=
uvs
,
shading
=
shading
,
z_offset
=
z_offset
,
texture
=
texture
,
line_width
=
line_width
,
width
=
width
,
height
=
height
,
background_color
=
background_color
,
clipping_planes
=
clipping_planes
,
show_bounds
=
show_bounds
)
def
display_file
(
path
,
normals
=
None
,
colors
=
None
,
uvs
=
None
,
shading
=
'flat'
,
z_offset
=
0.5
,
texture
=
None
,
width
=
600
,
height
=
4
00
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
z_offset
=
0.5
,
texture
=
None
,
line_
width
=
1
,
width
=
6
00
,
height
=
400
,
background_color
=
'#dddddd'
,
clipping_planes
=
[],
show_bounds
=
False
):
m
=
om
.
TriMesh
()
om
.
read_mesh
(
m
,
path
)
display_openmesh
(
m
,
normals
,
colors
,
uvs
,
shading
,
z_offset
,
texture
,
width
,
height
,
background_color
,
clipping_planes
,
show_bounds
)
display_openmesh
(
m
,
normals
=
normals
,
colors
=
colors
,
uvs
=
uvs
,
shading
=
shading
,
z_offset
=
z_offset
,
texture
=
texture
,
line_width
=
line_width
,
width
=
width
,
height
=
height
,
background_color
=
background_color
,
clipping_planes
=
clipping_planes
,
show_bounds
=
show_bounds
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment