Extrusion, with a twist

31 views
Skip to first unread message

Bennett Weaver

unread,
Apr 21, 2018, 6:53:01 PM4/21/18
to Glowscript Users
I am trying to envision a way to extrude a rectangle along a curved path while rotating the rectangle relative to the extrusion path for a project that I am attempting. 

Another way to envision it might be as a helix with a rectangular cross section. Anybody have any ideas. 

Yet another way to envision it is to wrap a rectangular cross-section box around the surface of a cylinder at an angle NOT parallel to or perpendicular to the axis of the cylinder.

Thanks in advance for any ideas. 

Bruce Sherwood

unread,
Apr 23, 2018, 1:22:16 PM4/23/18
to Glowscript Users
I'm not sure this is what you're looking for, but here's an extrusion made by extruding a rectangle along a helical path:


Bruce

Bennett Weaver

unread,
Apr 24, 2018, 7:19:10 PM4/24/18
to Glowscript Users
Thank you. That is just the kind of thing that I was looking for. In reading, and re-reading the documentation for extrusions, I had, repeatedly, interpreted that the path could only be a 2-D path, just like the path describing the shape. Your kind headslap dislodged that misconception and allowed me to do what I had initially intended to do. I hadn't tried it since "2-D" had blocked my thought path.

Thanks, again

Bruce Sherwood

unread,
Apr 24, 2018, 7:27:12 PM4/24/18
to Glowscript Users
Following up on your experience, I've tweaked the extrusion documentation to try to make it clear that a path can be either 2D or 3D.

Bruce

Bennett Weaver

unread,
Apr 29, 2018, 1:48:39 AM4/29/18
to Glowscript Users
Thank you for your input and ideas and the updated documentation. To further illustrated the kind of thing that I am attempting, I have generated a sample program. It includes full comments of the further adventures that I have encountered. Thank you for any ideas you might have.


Ben 


Bruce Sherwood

unread,
Apr 29, 2018, 9:27:36 AM4/29/18
to Glowscript Users
I don't think I understand the questions you raise in the program text, so my comments may not address them very well in a first try.

First, if I don't plot all those triangles, the extrusion looks correct to me, so I don't know what it is about the extrusion that concerns you. What problem are you trying to solve?

Second, did you intend for your triangle objects to mimic the cross sections of your extrusion object? The extrusion has a cross section that is an equilateral triangle that is perpendicular to the path. Your triangles are not equilateral and lie in the plane of the path.

Third, note that between joints of the extrusion the cross section is an equilateral triangle, but the outline of a joint necessarily is not an equilateral triangle. It would come very close to being equilateral if the joint bending angle were very small (the bending angle is 60 degrees in your extrusion).

Bruce

Bennett Weaver

unread,
Apr 30, 2018, 11:24:30 AM4/30/18
to Glowscript Users
I agree that the extruded triangles are equilateral. The "jaggedness" of the extruded object is caused because of the distance between the points of the path. I had spaced the points to better illustrate the results I was seeing compared to what I desired.

The effect that I am trying to duplicate is the appearance of a threaded bolt. To achieve that, the bases of the extruded triangles at each point along the supplied path need to lie in a plane tangent to the surface of the cylinder that they are wrapping around.

I have generated a program that creates the desired effect, Thread3. The yellow object is the desired result. The orange object is created with the extrude along the desired path. It would appear that the desired result can not be achieved with a single extrude along the entire desired path.


Thank you for your thoughts and ideas.

Bruce Sherwood

unread,
May 1, 2018, 8:51:09 AM5/1/18
to Glowscript Users
Now that I understand that you were trying to make a threaded bolt, I can see why an extrusion cannot work, because the extrusion object is literally patterned after metal-working extrusion processes. If you extrude a long straight bar with triangle cross section, then bend that bar into a helix, the triangle will necessarily twist along the length of the bar.

On the to-do list for VPython is implementing a twist attribute for an extrusion, which would permit untwisting the twist that is introduced by bending the bar into a helix. I'm glad that you were able to find a workaround.

Bruce

Bennett Weaver

unread,
May 1, 2018, 6:16:51 PM5/1/18
to Glowscript Users
Thanks for your response. I am glad that I have attempted todo something that others have foreseen as a worthwhile addition to the current toolbox. Thanks, again, for your patience and help on this. Glad I could enable you to update the extrution documentation, even though that did not enable me to solve my problem.

Ben
Reply all
Reply to author
Forward
0 new messages