Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
taglut
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Marie Favreau
taglut
Commits
bb3c0c27
Commit
bb3c0c27
authored
13 years ago
by
Jean-Marie Favreau
Browse files
Options
Downloads
Patches
Plain Diff
Add a parameter for a simple output version
parent
8547f7c8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/meshGetPathsBetweenBorderPoints.py
+18
-11
18 additions, 11 deletions
python/meshGetPathsBetweenBorderPoints.py
with
18 additions
and
11 deletions
python/meshGetPathsBetweenBorderPoints.py
+
18
−
11
View file @
bb3c0c27
...
...
@@ -22,6 +22,7 @@
Options:
-n, --name Object name
-s, --simple Simple version, without description of the new points
-o, --output=FILE Save the mesh using the file FILE
-h, --help Print this message and exit.
...
...
@@ -43,7 +44,7 @@ def usage():
def
main
():
try
:
opts
,
args
=
my_getopt
(
sys
.
argv
[
1
:],
"
no:h
"
,
[
"
name
"
,
"
help
"
,
"
output=
"
])
opts
,
args
=
my_getopt
(
sys
.
argv
[
1
:],
"
no:h
s
"
,
[
"
name
"
,
"
help
"
,
"
output=
"
,
"
simple
"
])
except
getopt
.
GetoptError
as
msg
:
# print help information and exit:
print
(
"
Error:
"
+
msg
)
...
...
@@ -51,9 +52,12 @@ def main():
sys
.
exit
(
2
)
outputFile
=
""
simple
=
False
for
o
,
a
in
opts
:
if
o
in
(
"
-n
"
,
"
--name
"
):
name
=
a
if
o
in
(
"
-s
"
,
"
--simple
"
):
simple
=
True
if
o
in
(
"
-o
"
,
"
--output
"
):
outputFile
=
a
if
o
in
(
"
-h
"
,
"
--help
"
):
...
...
@@ -85,15 +89,17 @@ def main():
filout
.
write
(
"
# This file contains a set of paths between two vertices on a given mesh (
"
+
inputFile
+
"
)
\n
"
)
filout
.
write
(
"
# Each path is described as following:
\n
"
)
filout
.
write
(
"
# * the first line contains 5 number
\n
"
)
if
not
simple
:
filout
.
write
(
"
# * the first line contains 5 number
\n
"
)
filout
.
write
(
"
# * the ID of the first vertex
\n
"
)
filout
.
write
(
"
# * the ID of the last vertex
\n
"
)
filout
.
write
(
"
# * the length of the path
\n
"
)
filout
.
write
(
"
# * the number of points between the two vertices
\n
"
)
filout
.
write
(
"
# * a line per new point between the two vertices, described as following:
\n
"
)
filout
.
write
(
"
# * 3 values (x, y, z) for the coordinates
\n
"
)
filout
.
write
(
"
# * 2 vertex IDs (may be equal in case of point on an existing vertex)
\n
"
)
filout
.
write
(
"
# corresponding to the edge where the point is located.
\n
"
)
if
not
simple
:
filout
.
write
(
"
# * a line per new point between the two vertices, described as following:
\n
"
)
filout
.
write
(
"
# * 3 values (x, y, z) for the coordinates
\n
"
)
filout
.
write
(
"
# * 2 vertex IDs (may be equal in case of point on an existing vertex)
\n
"
)
filout
.
write
(
"
# corresponding to the edge where the point is located.
\n
"
)
filout
.
write
(
"
# Note: the ID of the first vertex is 1.
\n
"
)
...
...
@@ -106,11 +112,12 @@ def main():
path
=
taglut
.
PLPath
(
taglut
.
PointOnEdge
(
m
.
point
(
bpoint2
)),
False
,
m
,
mMap
,
vf
)
if
path
.
size
()
>=
2
:
filout
.
write
(
str
(
bpoint
+
1
)
+
"
"
+
str
(
bpoint2
+
1
)
+
"
"
+
str
(
path
.
length
())
+
"
"
+
str
(
path
.
size
()
-
2
)
+
"
\n
"
)
plist
=
list
(
path
.
getPoints
())
del
plist
[
0
]
del
plist
[
-
1
]
for
p
in
plist
:
filout
.
write
(
str
(
p
.
getX
())
+
"
"
+
str
(
p
.
getY
())
+
"
"
+
str
(
p
.
getZ
())
+
"
"
+
str
(
p
.
getFirstVertex
()
+
1
)
+
"
"
+
str
(
p
.
getSecondVertex
()
+
1
)
+
"
\n
"
)
if
not
simple
:
plist
=
list
(
path
.
getPoints
())
del
plist
[
0
]
del
plist
[
-
1
]
for
p
in
plist
:
filout
.
write
(
str
(
p
.
getX
())
+
"
"
+
str
(
p
.
getY
())
+
"
"
+
str
(
p
.
getZ
())
+
"
"
+
str
(
p
.
getFirstVertex
()
+
1
)
+
"
"
+
str
(
p
.
getSecondVertex
()
+
1
)
+
"
\n
"
)
except
taglut
.
Exception
as
msg
:
print
(
"
Error:
"
+
msg
.
getMessage
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment