Integer coordinates of the vertices of a three-dimensional model

Hello, friends! I have a similar model in dwg-a polyhedron of 16 hexagons.
I need to change the polyhedron so that the coordinates of all vertices are integers (0,0,0), but the faces must remain flat. In the attached example, I performed some manipulations, but I do not know how to proceed and whether it is possible at all.
It is clear that if you simply round to the nearest values, some edges become non-planar.
That is, 2 conditions must be met:

  1. All vertex coordinates are integers (up to the nearest possible values);
  2. The faces must remain flat and hexagonal (without bends or triangulations).
    I will be very grateful for any help on this issue!!
1 Like

I can think of two ways to do this off the top of my head. The main point here is that certain points need to remain planar.

Option 1.

  • Group your points by face.
  • Determine which coordinates need to stay planar.
  • Take the average of those coordinates and round that value to the nearest integer.

Option 2.

  • Draw the planes for each face first.
  • Determine the nearest plane(s) for each point.
  • Project points onto plane(s).

Both of these options may require some assumptions depending on how much information you have.

Hello, Nick_Boyts. Thanks for the quick response.

About options:

  1. The vertices (points) of each face are already grouped from the original shape. I tried rounding by the average values as you advised, but I can’t get a positive result. I tried to group the coordinates separately by (x, y,z), followed by taking the average value and rounding. I also tried grouping by points on each face, taking the average value for each point (x, y,z), and also getting faces with bends.
  2. For this option, I did not quite understand what packages to use. From the original model, I can recreate a copy and build planes for each face based on a group of points. You get 16 planes for 16 faces. Also, if groups of points did not lie in the same plane, it would be possible to construct a polyline for each face and project it onto these planes. But I did not understand how to implement the task as a result.

In my understanding:
Some faces are parallel to the plane (x,z) and (y,z), and the coordinates (x,y) of the vertices of these faces are not integers. Then it turns out that the angles of the planes of these faces should change to the vertical and horizontal. I may be wrong, but I don’t think it will be possible to align the coordinates to integers if you link to specific existing planes for each face.

I also have in mind an option with uneven scaling separately for x, y and z,. If I understand correctly, this scaling changes the coordinates of points and saves flat faces. But I do not know if it is possible to set a limit so that scaling occurs until the coordinates of the vertices take an integer value.
In General, this task has not yet been completed.

The assumptions are as follows:

  • Edge lengths can be anything, including non-integers;
  • Accordingly, any change in body volume is allowed.
  • You can change the slope of the planes of each face;
  • It is desirable, but not necessary, that the original symmetry be preserved.
  • Flat hexagonal faces remain flat and hexagonal.
    Thanks