Python + rhinocommon: Creating a double-precision mesh

I’m trying to create a double-precision mesh in R7SR36 using Rhinocommon in IronPython. Below is the code:

import Rhino

msh = Rhino.Geometry.Mesh()
msh.Vertices.UseDoublePrecisionVertices = True

pt = Rhino.Geometry.Point3d(
    719.584635461026,
    1006.60034179688,
    74.35892868042)

# (<type 'Point3d'>, <Rhino.Geometry.Point3d object at 0x00000000000000A8 [719.584635461026,1006.60034179688,74.35892868042]>)
print(type(pt), pt)

msh.Vertices.Add(pt)

# (<type 'Point3f'>, <Rhino.Geometry.Point3f object at 0x00000000000000A9 [719.5847,1006.6,74.35893]>)
vert = msh.Vertices[0]
print(type(vert), vert)

The

msh.Vertices.UseDoublePrecisionVertices = True

line doesn’t seem to make any difference. How do I make sure the mesh has double-precision vertices?

Thank you for your time

Update:

I have also tried CPython in Rhino 8.5. The results are the same: I can’t get the mesh to store the vertices as Pts3d. They are always stored as Pts3f, even if I add Pts3d to the vertex list.

Any suggestions?

Hi, mesh.Vertices always return a Point3f, which is a single precision. Internally, the numbers are stored as double precision floating point numbers, so don’t worry. To retrieve it, you can use mesh.Vertices.Point3dAt(). I also suspect that UseDoublePrecisionVertices is set to true by default.

I see. So this is how this works. Thank you so much for clarifying, Mikity. Much appreciated.