Wish: Local surface radius (or diameter)

The current ! _Radius and ! _Diameter are unable to measure the local radius or diameter where the mouse pointer is located on a surface. I suggest to add a new Command line option called “PickSurface”, which will let the user click on a surface (Osnap must be supported) and measure the local radius or diameter.

Obviously, a directional vector should be defined, too, because every surface has two dimensions. The programmers may find a way to make it align automatically on surfaces like pipes, cones etc. Otherwise, the user will be given an option to define the direction manually or swap between U and V isocurve direction.
Currently, both ! _Radius and ! _Diameter align automatically along 3-dimensional curves and surface edges.

The ! _Curvature tool supports surfaces, but it only can report the mean curvature.

The lack of such tool is very obvious while working with pipes. I’m forced to extract an isocurve first with the ! _ExtractIsoCurve tool, then change the direction (Rhino has the bad habit to extract isocurves in different direction depending on the type of surface, which is super annoying), then run the ! _Diameter command to be able to check the diameter of a pipe. It could have been much easier to simply click on the icon and pick any area on the surface to get a report in the Command line about the local diameter or radius…

In addition to Mean curvature Curvature reports:
Location u-v paramters
Location x-y-z coordinates
Surface normal direction
Maximum principal curvature
Minimum principal curvature
Gaussian curvature
Mean curvature

For a cylinder, cone and other developable surfaces the maximum principal curvature is the curvature in the direction perpendicular to the straight direction. The minimum principal curvature will be zero or essentially zero.

I would like to see two enhancements to the Curvature command:

  • Add reporting curvature in the u and v directions.
  • Report radius as well as curvature. When the curvature is exactly zero the radius should be reported with text as “infinite” or similar.

Curvature results on command line example:

Command: Curvature
Select curve or surface for curvature measurement
Select point on surface for curvature measurement ( MarkCurvature=No )

Surface curvature evaluation at parameter (86.4579, 40.0629):
3-D Point: (22.9559, 13.9623, 20.5579)
3-D Normal: (0.433053, -0.760973, 0.483099)
Maximum principal curvature: -0.0663212 (-0.550055, 0.20149, 0.810457)
Minimum principal curvature: 1.73331e-34 (-0.714076, -0.616702, -0.331321)
Gaussian curvature: -1.14955e-35
Mean curvature: -0.0331606

1 Like

Measuring the local radius (or diameter) should be done in no more than two mouse clicks:

  1. Ckick on a dedicated RMB command on an existing icon (or command line option);
  2. Click on the desired spot on the surface.
  3. Then Rhino reports the local radius or diameter. Reporting the diameter instead of radius is important dor people who work with pipes.

While waiting for a better solution, I created the following macro:

! _ExtractIsoCurve _Pause _Direction=V _Pause
_Diameter _Pause _EnterEnd _Pause _SelLast _delete

Note that the direction of extracting an isocurve is set to V, because certain types of geometry in Rhino are built in the opposite direction (a known bug that was discussed many times during the years). For example, a cylinder built with the Cylinder command will have reversed UV directions compared to a pipe made with the Pipe tool. Since I build pipes from lines, I use the Pipe command. To extract a circle isocurve from such a surface, I must switch to V direction. Pipes made with different tools or using simple extrusions may need to modify the macro and change _Direction=V with _Direction=U instead.

To overcome that bug in Rhino, you can create two different macros. You can also change “Diameter” with “Radius” if you wish so:

! _ExtractIsoCurve _Pause _Direction=U _Pause
_Radius _Pause _EnterEnd _Pause _SelLast _delete
! _ExtractIsoCurve _Pause _Direction=V _Pause
_Radius _Pause _EnterEnd _Pause _SelLast _delete

One thing that could be improved is to reduce the mouse clicks from 3 to 2 (first click on the icon, then two clicks on the pipe). The current macro requires two consecutive mouse clicks on a pipe to delete the temporary circle. Does anyone know how to simulate a LMB click with a macro about 1 second after clicking on the surface with the real LMB? The goal is to eliminate the last (3rd) mouse click one second after the second click.

This macro eliminates one mouse click:

! _ExtractIsocurve
_Pause
_Direction=V
_Pause
_Enter
_SelLast
_Diameter
_NoEcho
_Delete
_Echo
1 Like

Thank you! Works as expected.
From what I understand, the _NoEcho part is equal to “left mouse button click”?
In my macro I tried to complete the command via _EnterEnd, but it still requires a left mouse click or pressing the Enter key. Still trying to figure out these things. :slight_smile:

No, NoEcho simply stops anything being printed to the command line afterwards. Typically I use it in buttons or aliases launching scripts because otherwise the entire script gets printed to the command line.

1 Like

OK, so it’s used to stop the Command line from asking the user to press any other options there and simply executes the command?

From what I can see above, where it is placed in the macro simply stops Delete from reporting it deleted the extracted isocurve.

1 Like

I made an alternative version of my macro by adding _NoEcho and _Echo at the end. Now it reports the tube diameter both in the Command line and the mouse ToolTip.

 ! _ExtractIsoCurve _Pause _Direction=V _Pause
_Diameter _Pause _NoEcho _EnterEnd _Pause _SelLast _delete _Echo