MATLAB Answers


Get the Volume of Intersection Between Two 3D Shapes?

Naveen Pillai さんによって質問されました 2019 年 11 月 6 日
最新アクティビティ darova
さんによって 回答されました 2019 年 11 月 6 日
The shapes I have in my mind are rather simple (cuboids and cylinders) [and I know I can hard code a way to get the intersection volume of cuboid, but cylinders seem to be a little harder, and hard-coding may not be time efficient. The cylinders are specified by: a centre [x,y,z]; radius; half-length; and axis vector (e.g. 1 0 0, 0 1 0, 0 1 1). The cuboids are specified by: a centre [x,y,z]; half_length_x; half_length_y & half_length_z.
What I want to get is, with two of these pre-defined shapes input as above, the volume of intersection in m^3 (say 1 unit = 1 m) of the two shapes.

  2 件のコメント

2019 年 11 月 6 日
Do you have a drawing how it should look like? Do you have your attempts? Code?
Naveen Pillai 2019 年 11 月 6 日
I've attached a couple drawings. I guess I'm not looking for a brute force answer as much as a way to use inbuilt functions - something like this.
i) Define the shapes in 3-D space
ii) Overlap/Intersect the two shapes to get a new shape (as in the first figure)
iii) Get the volume of the new shape
The second figure (with the mesh) has what I'm actually trying to do. The yellow cylinders have different weights that will be attached to their volumes, while the red region (cylinder) will be cut out of all yellow cylinders (but the green region, also a cylinder, needs to be added back in).

サインイン to comment.

1 件の回答

回答者: darova
2019 年 11 月 6 日

Use equations to get intersection lines:
Integral can be used to calculate the volume (1/8 of the volume)

  0 件のコメント

サインイン to comment.

Translated by