-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scaling an extrusion #69
Comments
Thanks for pointing this out. We'll discuss how to handle this, but pull requests are always welcome 😀. At a minimum we should raise a |
There are several features of the Classic VPython extrusion object that have not yet been implemented in Vpython 7, and we would welcome someone contributing to finishing the job. Here is the old documentation: https://vpython.org/contents/docs/extrusion.html. Note that scale did not define a ratio between the start and end faces. Rather it scaled the cross section. You can scale the "ratio between the start and end face" by changing the size attribute of the extrusion. |
As I understood size can be used for uniform scaling. I needed the extrusion to be a cone (frustrum) instead of a cylinder. |
Hi Bruce, Matt, can you guide me a little at fixing this? Which module/class is to be modified etc. it would make finding the entry point for the necessary modifications easier. |
The key file is https://github.com/vpython/glowscript/tree/master/lib/glow/extrude.js, which contains the extrusion function at line 524 (it also contains most of the 3D text machinery, though the text function is in primitives.js). Note that if scale/xscale/yscale varies along the path, the normals to the quads that make up the sides of the extrusion need to be perpendicular to those sides, not to the path. |
I hoped it would be in the python part... unfortunately I have no affinity to js whatsoever - sorry, I can't help in this matter. Will probably implement a pure python cone using triangles only. |
In the classic vpython a linear scaling of a extrusion was possible by defining a ratio between the start and the end face. In the new version this is not possible; calling
extrusion()
with a scale argument does not raise aNotImplementedError
or similar, but the resulting object is generated as if scale=1 was defined.Is it planned to incluse this feature?
The text was updated successfully, but these errors were encountered: