From: Cettinich E. (LWE) <edw...@lw...> - 2002-12-13 11:14:24
|
Because extrusion objects are not supported in VPython I=20 create them as a set of convex objects. I found, that some=20 of them are not drawn correctly. For instance, please try this code: from visual import * d1=3Dconvex(pos=3D[( 0, 0, 0), ( 0, 1, 0), (-1, 1, 0)]) d2=3Dconvex(pos=3D[(-1, 1,-1), ( 0, 1,-1), ( 0, 0,-1)]) m0=3Dconvex(pos=3D[( 0, 0, 0), ( 0, 0,-1), ( 0, 1,-1), ( 0, 1, 0)]) m1=3Dconvex(pos=3D[( 0, 1, 0), ( 0, 1,-1), (-1, 1,-1), (-1, 1, 0)]) m2=3Dconvex(pos=3D[(-1, 1, 0), (-1, 1,-1), ( 0, 0,-1), ( 0, 0, 0)]) and watch m2. It is not drawn as rectangle, instead I can=20 only see the triangle [(-1, 1, 0), (-1, 1,-1), ( 0, 0,-1)].=20 Rotate and shift left m2's pointlist in the above code like this: m2=3Dconvex(pos=3D[(-1, 1,-1), ( 0, 0,-1), ( 0, 0, 0), (-1, 1, 0)]) Now m2 is fully drawn as a rectangle. Does anyone know what's wrong and how to get a correct convex object? I don't have any idea if there is something wrong and I see only 2 workarou= nds: 1.) I may create a rectangle in the XY-plane and rotate it appropriately, o= r 2.) I may split the rectangle into triangles. Thanks in advance for any answer, Edwin Cettinich |