0

I have some data that describes the vertices of a regular 3D polygon (X,Y,Z). I am trying to build a cuboid from that with matplotlib, mayavi and others, but i did not succeed so far, yet I feel this is probably a dumb question with an obvious solution.

The data is really simples as: p1,p2,p3,p4 are the anticlockwise coordinates of the vertices in the base (X,Y,Z). p5,p6,p7,p8 are the anticlockwise coordinates of the vertices in the top (X,Y,Z).

Help please.

P1=[88.10785899 38.69449727  2.07606017]
P2=[96.11246382 38.69449727  2.07606017]
P3=[96.11246382 24.68643882  2.07606017]
P4=[88.10785899 24.68643882  2.07606017]
P5=[88.10785899 38.69449727 10.080665]
P6=[96.11246382 38.69449727 10.080665]
P7=[96.11246382 24.68643882 10.080665]
P8=[88.10785899 24.68643882 10.080665]
  • just plot a line from P1 to P2, from P2 to P3... It would be much easier if instead of 8 variables you have a list. Or you want a solid object? –  Feb 17 '22 at 14:53
  • Yep, I originally did that. But in fact I need the solid object, since I will perform some mathematical operations in that later. – Ualisson Bellon Feb 17 '22 at 14:57
  • check that https://stackoverflow.com/questions/4622057/plotting-3d-polygons-in-python-matplotlib –  Feb 17 '22 at 15:00
  • Oh, I've tried. Still did not work as well :( – Ualisson Bellon Feb 17 '22 at 17:31

0 Answers0