Visualizing non-convex polygons #806
Answered
by
marcomusy
ZiguoAtGitHub
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
marcomusy
Feb 9, 2023
Replies: 1 comment 4 replies
-
I would write it as: from vedo import *
B, D, TF, TW, BB, TFB = 500, 800, 50, 35, 650, 20
plist = [
(-B / 2, D / 2),
(B / 2, D / 2),
(B / 2, D / 2 - TF),
(TW / 2, D / 2 - TF),
(TW / 2, -D / 2 + TFB),
(BB / 2, -D / 2 + TFB),
(BB / 2, -D / 2),
(-BB / 2, -D / 2),
(-BB / 2, -D / 2 + TFB),
(-TW / 2, -D / 2 + TFB),
(-TW / 2, D / 2 - TF),
(-B / 2, D / 2 - TF),
]
faces = [(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)]
msh = Mesh([plist, faces]).triangulate().c("blue4").lw(1)
show(msh, axes=1).close() do not repeat Hope this helps. |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
marcomusy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would write it as:
do not repeat
0
to define the single face. Note that a single face which is not convex cannot be rendered, so you need.triangulate()
.Hope this helps.