Implementing cosine spacing using Rhino or Rhinopython

Hi everyone,

I have 2 related queries:

  1. I want to try implementing cosine spacing(finer discretization towards one end) in Rhino for a surface. Is there a way to do that?

Please re-direct me to appropriate discussion if discussed before.

  1. Also, suppose I am creating a network surface using RhinoPython, is it possible to implement cosine spacing in this case?

Hello - what do you want to space? Control point rows?


Hi Pascal,

Yes. That is what I meant. But I want to know if it is possible to be flexible about the discretization towards either end of the mesh whether in U or V direction. Is there options to do this in Rhino GUI and Rhinopython separately?

Hello - you’ll need code as far as I know, or possibly GrassHopper, to do this, though I am not sure I fully understand what the goal is.


Hi Pascal,

Thanks for the feedback. Do you have any suggestions about how to code this up?

My goal is fix the surface in the areas of wedge-like surfaces, say, if a circle is inscribed inside a square, then the surface I am focusing is the area outside the circle but inside the square.

I need to work using surfaces rather than going to meshing as I want to export the generated surface as higher-order geometry WAMIT file.

If I operate using meshing tab, the exported file will be of the lower order geometry with just the coordinates.

Hello - this kind of thing?


Hi Pascal,

Yes. I want to discretize this with finer mesh towards the straight ends.

I am trying to avoid something called as a MAXSQR error in WAMIT runs. I believe very fine mesh at the wedge area will be a cause for that although I am not sure.

Hm - so, in this example, as I made the surface, the UV structure becomes parallel at the points - is that the problem, or part of it?

I think Wamit does not like trims (?) so I am not sure, given the structure of NURBS surfaces, if there are any other useful options. Maybe you have an example or sketch of how you’d like the points to be?



Hi Pascal,

Its true that WAMIT does not like trims. That is also a factor but I find NetworkSurface to be able to tackle that issue. What I need to figure out is, once I create the Network surface, the discretization while using the re-building the surface option.

On closer inspection after discussing with you, I think the option ‘Loose’ which is a part of the Re-build surface option generates something like what I need.

So you can see the mesh is coarse towards the edges but fine otherwise. I am wondering how to code this up in Rhinopython.

Hello - oi… it sounds to me like you’ll need to make your own surfaces - there is everything you need, I think, in RhinoCommon to do this but it might be a bit of work.


So you are trying to make an untrimmed surface to accurately model the " Square - Circle " shape?
Or do you have some extra parameterization requirement, or a requirement about the type of surface, like non-rational single span?

Hi Pascal,

Could you direct me to the resource to help me understand what is Rhinocommon and the way to use it?

I find it easy to use the rhinoscriptsyntax as it gives examples along with the syntax. Is there only definitions written in the case of Rhinocommon as shown in the API documentation?



I am indeed trying to accurately model an untrimmed shape for the wedge-like surface to export to WAMIT.

The parametrization requirement I have is that I want to specify the way the surface is built. How would you do this in rhinopython? See the pic below:

I want to do this inside pythonscript. I could find only normal Rebuild surface option which doesn’t have these inputs.

Does anyone knows what command would be helpful in this case?

Hello - more info here:


1 Like



Thanks a lot!