Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bigprint
reebgraph
Commits
6a63ac65
Commit
6a63ac65
authored
Nov 11, 2022
by
Jayant Khatkar
Browse files
remove unnecessary libraries
parent
3f892301
Changes
1
Hide whitespace changes
Inline
Side-by-side
reebgraph/reebgraph.py
View file @
6a63ac65
import
numpy
as
np
import
trimesh
as
tm
import
pyvista
as
pv
import
pymeshfix
as
pf
import
networkx
as
nx
...
...
@@ -167,11 +165,6 @@ if __name__ == '__main__':
# load mesh
mesh
=
pv
.
read
(
'../horse.stl'
)
temp_mesh
=
pf
.
MeshFix
(
mesh
)
temp_mesh
=
tm
.
base
.
Trimesh
(
vertices
=
temp_mesh
.
v
,
faces
=
temp_mesh
.
f
)
tm
.
repair
.
fix_inversion
(
temp_mesh
)
tm
.
repair
.
fix_winding
(
temp_mesh
)
mesh2
=
pv
.
wrap
(
temp_mesh
)
# convert trimesh to pyvista
# generate non-planar surfs
bounds
=
mesh
.
bounds
...
...
@@ -193,7 +186,7 @@ if __name__ == '__main__':
slices
=
[]
for
layer_i
,
surf
in
enumerate
(
surfs
):
try
:
sl
=
surf
.
clip_surface
(
mesh
2
,
invert
=
True
)
sl
=
surf
.
clip_surface
(
mesh
,
invert
=
True
)
slices
.
append
(
sl
.
clean
(
inplace
=
False
))
print
(
"Slice"
,
layer_i
,
"added. At Z"
,
heights
[
layer_i
],
"of"
,
heights
[
-
1
])
except
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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