Odd behavior of extrusions

20 views
Skip to first unread message

Harlan Gilbert

unread,
Aug 6, 2022, 11:53:20 AM8/6/22
to Glowscript Users
This is peculiar: seemingly identical extrusions produce different results.
Whichever extrusion is executed first forms a closed rectangle
Whichever extrusion is executed second forms a U-shape (one side is not completed).
 
Web VPython 3.2
rect = shapes.rectangle(width=.1, height = .1)
path = paths.rectangle(width = 2)
extrusion (path=path, shape = rect, color=color.red, pos = vec(0,-1,0))
extrusion (path=path, shape = rect, color=color.red, pos = vec(0,1,0))

The order does not matter; whichever extrusion is first gives a closed shape.

Any thoughts?
Harlan

Bruce Sherwood

unread,
Aug 6, 2022, 12:52:23 PM8/6/22
to Glowscript Users
The following works properly, so apparently the bug is that the extrusion machinery overwrites the path:

rect = shapes.rectangle(width=.1, height = .1)
path = paths.rectangle(width = 2)
extrusion (path=path, shape = rect, color=color.red, pos = vec(0,-1,0))
path = paths.rectangle(width = 2)
extrusion (path=path, shape = rect, color=color.green, pos = vec(0,1,0))

Thanks much for the report.

Bruce

Bruce Sherwood

unread,
Aug 6, 2022, 4:28:56 PM8/6/22
to Glowscript Users
Now fixed. As usual, you might need to clear your browser cache in order to get the update.

Bruce

Harlan Gilbert

unread,
Aug 6, 2022, 4:42:30 PM8/6/22
to glowscri...@googlegroups.com
Thanks!

On Sat, Aug 6, 2022 at 4:28 PM Bruce Sherwood <bruce.s...@gmail.com> wrote:
Now fixed. As usual, you might need to clear your browser cache in order to get the update.

Bruce

--

---
You received this message because you are subscribed to a topic in the Google Groups "Glowscript Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glowscript-users/wstEPAWlpd0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to glowscript-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glowscript-users/16b6a9b8-b81a-452d-8082-7bc27bcfa490n%40googlegroups.com.
--
Harlan Gilbert, Ph.D.
High School Chair and Math, Physics, Computer Science, and Philosophy Teacher
Green Meadow Waldorf High School
Chestnut Ridge, NY 10977
Reply all
Reply to author
Forward
0 new messages