About cross sections of 3d objects in Vpython

102 views
Skip to first unread message

Vpython beginnwer

unread,
Jun 10, 2015, 2:30:03 AM6/10/15
to vpytho...@googlegroups.com
I just start to use vpython to construct the 3D objects in computer.
I'd like to know the method to how to get the cross sections of the objects.
Extrusion command constructs 3D from 2D object.
Therefore, extrusion seems not to help me.

I'm looking forward to your reply.
Sincerely,

Bruce Sherwood

unread,
Jun 10, 2015, 12:22:58 PM6/10/15
to vpytho...@googlegroups.com
I'm not sure what you're looking for, since what is normally called the "cross section" of a box object is a rectangle, the cross section of a sphere or cylinder is a circle, etc.

If you are looking for a way to find the 2D shape of any of these 3D objects when projected onto the 2D screen, there's nothing in VPython to help with that.

Vpython beginnwer

unread,
Jun 10, 2015, 8:15:50 PM6/10/15
to vpytho...@googlegroups.com
Thank you so much for your kind reply.
Sorry for my not good explanation. 
I assumed more complicated objects, such as moving spheres in cubes.
And I don't mean the projection onto the 2D screen. I mean the cutting of the objects and obtains horizontal or longitudinal or vertical sections of the objects in the cutting plane.

Bruce Sherwood

unread,
Jun 10, 2015, 10:31:28 PM6/10/15
to vpytho...@googlegroups.com

This geometrical application is too specialized to be built into VPython. However, VPython does provide all the standard operations for 3D vector calculations; in the VPython Help see Work with 3D objects > Vector Operations.

On the other hand, perhaps you should describe why you need this capability, in which case we may be able to propose a different way of getting the results you want.

Vpython beginnwer

unread,
Jun 11, 2015, 8:59:17 PM6/11/15
to vpytho...@googlegroups.com
Thank you so much again.
I will go to see Vector operations in the VPython Help as your suggestion.

The reason why I want to slice the 3D objects is as follows.

I am a plant cell biologist to study geometries of subcellular structures.
In the real experiment, I use a microtome to obtain cross sections of the cell and observe them using a microscope.
Recently, I also tried to simulate the development of subcellular structures using VPython. I want to compare the results of simulation and
microscopic image.
That's is why I'm looking for the function of slicing 3D objects in VPython.

Thanks again for your kind help.

Sincerely,

Bruce Sherwood

unread,
Jun 12, 2015, 1:17:27 AM6/12/15
to vpytho...@googlegroups.com
Okay, it helps to have some idea of the application. It seems to me that you would need to use the "faces" object to model the cell in 3D. Then, having made this 3D model, you would be in a position to choose to set visible = True only for those faces whose depth was between z-dz and z+dz.

It is possible that it would be useful to start with one or more extrusion objects, if that turns out to be a useful way to create the 3D model. At the bottom of the Help page on extrusion objects is a description of how to obtain the faces used to create the extrusion object, and then choose to make visible only those faces within the depth slice of interest.

Reply all
Reply to author
Forward
0 new messages