Yes, I'm a dumba** newbie..

51 views
Skip to first unread message

tim white

unread,
Aug 15, 2023, 11:12:42 AM8/15/23
to Glowscript Users
Extrusion problem.  If I follow a library path I can get the extrusion to function properly but if I try to make a path of vectors, (even a simple rectangle) the object will not display and no error messages occur only when I try to close it on itself, that is returning to the original vector point.  If I make the last point (the point of the extrusion origin) even slightly smaller, for example vector(1,1.9999999,0) instead of the original (1,2,0) it will display although there is of course a "divot" missing from the last join.  Any advice before I run outside naked and set myself on fire would be greatly appreciated.  If you have any advice or not I appreciate the place to vent.  Thanks

tim white

unread,
Aug 15, 2023, 11:35:19 AM8/15/23
to Glowscript Users
Just in case here's a sample of what I'm asking about.  As you can see if I use library functions it works but vector paths don't want to cooperate.

Bruce Sherwood

unread,
Aug 15, 2023, 3:35:24 PM8/15/23
to Glowscript Users
I see that the extrusion documentation lacks some clarity.  The way to think about an extrusion is basically to imagine that a 2D shape lying in the xy plane is extruded along a path that starts out in the xz plane. Then you can rotate this extrusion. Here's an example:

Web VPython 3.2
scene.background=vector(.3,.3,.3)
ell=shapes.ellipse(width=.5,height=0.2)
extrusion(path=paths.rectangle(width=7,height=4),shape=ell,color=color.blue)

E = extrusion(path=paths.rectangle(width=4), shape=ell, color=color.green)
E.rotate(angle=pi/2, axis=vec(1,0,0))

Bruce

tim white

unread,
Aug 16, 2023, 11:30:18 AM8/16/23
to Glowscript Users
Thank you for the help, Mr. Sherwood.  I believe I'm getting hung up on your keyword think, something mother nature didn't believe in over generosity in my case.  I do appreciate your help and thanks again...tim
Reply all
Reply to author
Forward
0 new messages