Grasshopper

algorithmic modeling for Rhino

I am using OnMesh Class for geometric construction, and I have realized that the vertex coordinates are represented as "float" in VC#.

Could anyone tell me whether this means that a mesh has only single precision or there is no difference between "float" and "double"?
Also, does this also generally apply to mesh in Rhino?

Thank you.

Views: 837

Replies to This Discussion

Since meshes will tend to have a large number of vertices, the programmers at Rhino decided to make the x,y and z values made of of single precision floating point numbers as opposed to double precision floating point numbers that are used every where else. Its more or less, just using a slightly less accurate number to save space. If you dig deeper, you'll find that the vertices are actually a different class than normal points... On3fPoint as opposed to On3dPoint. Does that cover it?
Thank you for the answer. That makes sense.

What should be the standard way to construct a polysurface from vertex coordinates and connectivity?
(I have been constructing simple polyhedral models by constructing meshes and converting them into polysurfaces, but it doesn't seem to be a good idea in the sense of precision.)

For example is using
RhUtil.RhinoCreateSurfaceFromCorners
to construct facets and then connecting them by
RhUtil.RhinoJoinBreps
an efficient way?
Well, from you're description I don't see any benefit of having NURBS over meshes. The precision issue is not really a very big one, unless you're dealing with extremely small objects and/or a lot of very precise calculations.

If you absolutely must have NURBS, then either the BrepForm method will give you access to it, or you can use OnUtil.ON_BrepFromMesh function.
I was comparing these two processes:
coordinates -> mesh -> polysurface
coordinates -> polysurface
The former is what I have been doing, and I was curious about the latter possibility.

I want to make it precise as possible, since I am programming calculations that can easily accumulate errors, although thus far, I have not yet experienced any precision problem.

Thanks for the advice, anyway. ON_BrepFromMesh sounds nice for the mesh -> polysurface part.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service