# Gengeo polyhedron

Hi all, i want to make a 3D polyhedron with a list of its corners. But i don't know if is there a class to do that. I saw a example for a Polygon so i want to know if there is something like that for a 3d figure.

Thanks for the help

P.D.: Sorry for my english

## Question information

- Language:
- English Edit question

- Status:
- Solved

- Assignee:
- No assignee Edit question

- Solved by:
- CVallejos

- Solved:
- 2018-02-13

- Last query:
- 2018-02-13

- Last reply:
- 2018-02-13

Dion Weatherley (d-weatherley) said : | #1 |

Hi CVallejos,

GenGeo has two 3D volumes that can be used to pack a polyhedron with spheres. These are:

1) ConvexPolyhedron:

http://

2) MeshVolume:

http://

Unfortunately neither of these accept a list of corner points though.

ConvexPolyhedron is a generalisation of BoxWithPlanes3D wherein a user supplies a set of Planes defining the flat surfaces (i.e. faces) of the polyhedron. Each Plane is defined by a point in the plane and the unit normal vector to the plane surface. You can add as many Planes as required to define the polyhedron surface. With some trigonometry, it should be possible to compute these Planes from a set of corner points but I do not have any algorithm at hand that does this. The primary limitation of ConvexPolyhedron is that the polyhedron must be *convex*. It cannot contain holes or have a "U"-shape or similar.

MeshVolume can be used to pack spheres within a more general 3D shape. It expects to be given a TriPatchSet of triangles defining the surface of the 3D volume to fill. Such a volume can contain holes and may be concave; hence it is really quite general. To generate a surface mesh of your polyhedron from a list of corner points, you will need to use a third-party meshing software like gmsh or similar. Detailed instructions on using MeshVolume are provided here:

https:/

Cheers,

Dion

CVallejos (crvallejos87) said : | #2 |

Thanks Dion, i want to make a truncated cone and i still want to find the better way to do it. I will try with this two options but if is there a easiest way to do it, i would thank it.

Dion Weatherley (d-weatherley) said : | #3 |

Hi CVallejos,

To pack a truncated cone, I would use gmsh to generate a triangle mesh then use MeshVolume in gengeo to do the packing.

This guide may help you get started:

http://

It is a little out-dated and describes meshing a cylinder but the general principles are the same with newer versions of gmsh.

Have fun!

Cheers,

Dion

CVallejos (crvallejos87) said : | #4 |

Thanks Dion,, i will try to do that, thanks for the help