PanelingScripting

From the McNeel Wiki
This article was migrated from the McNeel Wiki due to the wiki security vulnerability of October 22, 2026.

Summary: Description of PanelingTools methods for Rhino that are available for RhinoScript developers.

PanelingTools Scripting for Rhino 4 aims to make PanelingTools methods available for RhinoScript developers. This document includes full description of PanelingTools scripting methods.

Examples using all methods are attached to toolbar buttons. Toolbars (PanelingTools.tb) are available for download (zipped with the plug-in when you download from the PanelingTools wiki page).

Accessing methods: how to get PanelingTools plug-in object:

The first step is to get hold of PanelingTools plug-in object. Make sure PanelingTools.rhp plug-in is loaded when you start Rhino. (Use PluginManager command to load PanelingTools.rhp for the first time.)

The plug-in object is accessed using GetPluginObject(“Plugin Name”) as shown in the following:

Syntax:

Rhino.GetPluginObject (strPlugIn)

Parameters:

strPlugInString. The name of a registered plug-in that supports scripting. If the plug-in is registered but not loaded, it will be loaded

Returns:

ObjectA scriptable object if successful
NullIf not successful, or on error

PanelingTools toolbars have a script toolbar last button of the main toolbar that has examples for each of the methods. You can use right mouse click while holding shift button down to open a toolbar button. You can then check/modify scripts.

To access PanelingTools (PT) methods from within the Rhino Script Editor, you need to save PanelingTools.syntaxml file in the %ProgramData%\McNeel\Rhinoceros\5.0\MonkeyEditor\Resources folder.


Methods description

Available methods

  • DivideCurveSpan
  • DivideCurveByDistance
  • DivideCurveByDirectDistance
  • DivideSurfaceSpan
  • DivideSurfaceByDirectDistance
  • SubPaneling
  • RandomPaneling
  • RandomPanelingWithPoints
  • PanelEdgesWithOrderedPoints
  • PanelFacesWithOrderedPoints
  • PanelFlatFacesWithOrderedPoints
  • PanelMeshWithOrderedPoints
  • PanelCustomWithOrderedPoints
  • PanelQuadsWithOrderedPoints
  • GridByArray
  • GridByArrayPolar
  • GridByOneDirectionCurve
  • GridByTwoDirectionCurves
  • GridByUCurves
  • GridByUVCurves
  • GridByObjectDirection
  • GridBySurfaceUV
  • GridByDirectDistanceOnSurface
  • InsertPointInGrid
  • SurfaceByGrid
  • SurfaceByControlGrid
  • DivideCurveByVariableDistances
  • DivideSurfaceByVariableDistances

Divide curve span ( by number or by distance)

Finds dividing points of a curve by distance or number.

Syntax:

PTObj.DivideCurveSpan( strObject, bMode, intNumber, doubleDis, bRound, bRoundMethod, bAdd )

Parameters:

strObjectString. Curve object to be divided
bModeBoolean. 0 = divide by number, 1 = divide by distance
intNumberInteger. Number of divide points
doubleDisDouble. Distance between dividing points
bRoundBoolean. Rounding to fit curve length
bRoundMethodBoolean. true = round down. false = round up
bAddBoolean. Add dividing points to context

Returns:

ArrayArray of divide points
NullIf not successful, or on error

Divide curve by distance on curve Finds dividing points of a curve by distance on curve.

Syntax:

PTObj.DivideCurveByDistance( strObject, doubleDis, bRound, bRoundMethod, bAdd )

Parameters:

strObjectString. Curve object to be divided
doubleDisDouble. Distance between dividing points
bRoundBool. Rounding to fit curve length
bRoundMethodBool. True = round down. False = round up
bAddBool. Add dividing points to context

Returns:

ArrayArray of divide points
NullIf not successful, or on error

Divide curve by exact or direct distance Finds dividing points of a curve by direct distance.

Syntax:

PTObj.DivideCurveByDirectDistance( strObject, doubleDis, bAddend, bAdd )

Parameters:

strObjectString. Curve object to be divided
doubleDisDouble. Direct distance between dividing points
bAddEndBool. Add end point on curve
bAddBool. Add dividing points to context

Returns:

ArrayArray of divide points
NullIf not successful, or on error

Generate surface divide points based on surface UV directions Generates surface grid of points by number or distance following surface U & V directions. In case of dividing by distance, the defined distance is applied only on the first iso-curve in each direction. It varies if the surface is doubly curved.

Syntax:

PTObj.DivideSurfaceSpan( strSrfObject, bUMode,bVMode, intUNum, intVNum, doubleUDis, doubleVDis, bURound, bVRound, bURoundMethod, bVRoundMethod, bAdd )

Parameters:

strSrfObjectString. Surface object to generate point grid for
bUModeBool. Divide mode in U direction: False=By-Number, True=By-Distance
bVModeBool. Divide mode in V direction: False=By-Number, True=By-Distance
intUNumInteger. Number of points in first ( U ) direction
intVNumInteger. Number of points in second ( V ) direction
doubleUDisDouble. Distance between points in first ( U ) direction
doubleVDisDouble. Distance between points in second ( V ) direction
bURoundBool. Option to round result in U direction
bVRoundBool. Option to round result in V direction
bURoundMethodBool. True = round down. False = round up
bVRoundMethodBool. True = round down. False = round up
bAddBool. Add points to context

Returns:

Array of ArraysArray of point-objects arrays (2 dimensional array of points)
NullIf not successful, or on error

Generate surface divide points based on direct distance Generates surface grid of points by direct distance between points. This method is a bit fragile. Each new point is based on previously calculated points. If a point fails to generate, subsequent points of that row fail as well. Setting extend option to true helps to create more predictable results in most cases (unless when extending the surface creates self intersecting or weird results).

Syntax:

PTObj.DivideSurfaceByDirectDistance( strSrfObject, doubleUDis, doubleVDis, bExtend, bAdd )

Parameters:

strSrfObjectString. Surface object to generate point grid for
doubleUDisDouble. Distance between points in first ( U ) direction
doubleVDisDouble. Distance between points in second ( V ) direction
bExtendBool. True = extend surface to possibly get better coverage
bAddBool. Add points to context

Returns:

Array Of ArraysArray of point-objects array (2 dimensional array of points)
NullIf not successful, or on error

Sub paneling Paneling surface using seed polylines. Polylines are sub divided and pulled back to surfaces to generate panels.

Syntax:

PTObj.SubPaneling( strSrfObject, arrCrvObject, intMethod, intDegree, bPull )

Parameters:

strSrfObjectString. Surface object to be sub-paneled
arrCrvObjectArray of Strings. Polyline objects to sub-panel surface with
intMethodInteger. 0=all, 1=subs only, 2=mains only
intDegreeInteger. Levels of sub paneling
bPullBool. Pull panels to surface or keep straight

Returns:

ArrayArray of string of panel curves objects
NullIf not successful, or on error.

Random paneling – Generate points randomly Triangular paneling using random set of points on surface.

Syntax:

PTObj.RandomPaneling( strSrfObject, intNumOfPoints, bPull )

Parameters:

strSrfObjectString. Surface object to be paneled randomly
intNumOfPointsInteger. Number of points generated randomly on surface
bPullBool. Pull panels to surface or keep straight

Returns:

ArrayArray of string of panel curves objects
NullIf not successful, or on error

Random paneling – Select points Triangular paneling using random set of points on surface.

Syntax:

PTObj.RandomPanelingWithPoints( strSrfObject, arrPointObjects, bPull )

Parameters:

strSrfObjectString. Surface object to be paneled randomly
arrPointsArray. Points to be paneled
bPullBool. Pull panels to surface or keep straight

Returns:

ArrayArray of string of panel curves objects
NullIf not successful, or on error

Paneling edges of a grid Creates edge panels from an ordered paneling grid of points.

Syntax:

PTObj.PanelEdgesWithOrderedPoints( arrPoints, intPattern, [optional]strBrepObject, [optional] bPull )

Parameters:

arrPointsArray. Points to be paneled
intPatternInteger between 0 and 7. ( 0=Box, 1=BoxX, 2=Triangular, 3=Dense, 4=Diamond, 5=AngleBox, 6=Wave, 7=Brick )
strBrepObject[Optional] String. Base object (surface or polysurface)
bPull[Optional] Bool. Pull panels to surface or keep straight

Returns:

ArrayArray of string of curves objects (panels edges)
NullIf not successful, or on error

Paneling faces of a grid Creates face panels (outline border) from an ordered paneling grid of points.

Syntax:

PTObj.PanelFacesWithOrderedPoints( arrPoints, intPattern, [optional]strBrepObject, [optional] bPull )

Parameters:

arrPoints ArrayPoints to be paneled
intPatternInteger between 0 and 7. ( 0=Box, 1=BoxX, 2=Triangular, 3=Dense, 4=Diamond, 5=AngleBox, 6=Wave, 7=Brick )
strBrepObject[Optional] String. Base object (surface or polysurface)
bPull[Optional] Bool. Pull panels to surface or keep straight

Returns:

ArrayArray of string of curves objects (panels faces)
NullIf not successful, or on error

Paneling flat faces of a grid Creates flat face panels (trimmed planar surfaces) from an ordered paneling grid of points.

Syntax:

PTObj.PanelFlatFacesWithOrderedPoints( arrPoints, intPattern, [optional]strBrepObject, [optional] intMethod )

Parameters:

arrPointsArray. Points to be paneled
intPatternInteger between 0 and 7. ( 0=Box, 1=BoxX, 2=Triangular, 3=Dense, 4=Diamond, 5=AngleBox, 6=Wave, 7=Brick )
strBrepObject[Optional] String. Base object (surface or polysurface)
intMetod[Optional] Integer. 0=fit panel through corners, 1=align center to base surface

Returns:

ArrayArray of string of surface objects
NullIf not successful, or on error

Mesh of a grid Creates a mesh from an ordered paneling grid of points.

Syntax:

PTObj.PanelMeshWithOrderedPoints( arrPoints, intPattern, [optional]strBrepObject )

Parameters:

arrPointsArray. Points to be paneled
intPatternInteger between 0 and 7. ( 0=Box, 1=BoxX, 2=Triangular, 3=Dense, 4=Diamond, 5=AngleBox, 6=Wave, 7=Brick )
strBrepObject[Optional] String. Base object (surface or polysurface)

Returns:

StringMesh object
NullIf not successful, or on error

Custom paneling of a grid Creates a custom pattern from pattern curves and points and ordered paneling grid of points. Pattern can be either curves, points, or both.

Syntax:

PTObj.PanelCustomWithOrderedPoints( arrPoints, arrPattern, intUSpacing, intVSpacing, [optional] strBrepObject, [optional] bPull )

Parameters:

arrPointsArray. Points to be paneled
arrPatternArray. Pattern curves and points
intUSpacingInteger. Spacing in first or U direction
intVSpacingInteger. Spacing in second or V direction
strBrepObject[Optional] String. Base object (surface or polysurface)
bPull[Optional] Bool. Pull panels to surface or keep straight

Returns:

ArrayArray of string of curve objects
NullIf not successful, or on error

Panel quads with ordered points Create quads point grid within deviation.

Syntax:

PTObj.PanelQuadsWithOrderedPoints( arrPoints, doubleDeviation )

Parameters:

arrPointsArray. Points to be paneled
doubleDeviationDouble. Maximum deviation from input grid

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by array Create ordered grid of points by array.

Syntax:

PTObj.GridByArray( ptBase, intUNum, doubleUSpacing, vectorUdir, intVNum, doubleVSpacing, vectorVDir, bGroup, strName )

Parameters:

ptBaseArray. Base point of the array
intUNumInteger. Number of points in first ( U ) direction
doubleUSpacingDouble. Distance between points in first ( U ) direction
vectorVDirArray. First direction
intVNumInteger. Number of points in second ( V ) direction
doubleVSpacingDouble. Distance between points in second ( V ) direction
vectorVDirArray. Second direction
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by array polar Create ordered grid of points by array polar.

Syntax:

PTObj.GridByArrayPolar( ptRotation, vectorRAxis, ptBase, vectorUDir, intUNum, doubleUSpacing, intVNum, doubleVAngle, bGroup, strName )

Parameters:

ptRotationArray. Center of rotation
vectorRAxisArray. Rotation axis
ptBaseArray. Base point of the array
vectorVDirArray. Direction of points
intUNumInteger. Number of points in first direction
doubleUSpacingDouble. Distance between points in first ( U ) direction
intVNumInteger. Number of points in second ( polar ) direction
doubleVAngleDouble. Angle between points in second ( polar ) direction
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by one direction curves Create ordered grid of points using one directional curve.

Syntax:

PTObj.GridByOneDirectionCurve( strCrvObject, intUMethod, intUNum, doubleUDis, bURound, bURoundmethod, bUAddend, intVMethod, intVNum, doubleVDis, vectorVDir, bGroup, strName )

Parameters:

strCrvObjectString. Direction curve
intUMethodInteger. Divide method of direction curve (0=ByNumber, 1=ByDistance, 2=ByDirectDistance)
intUNumInteger. Number of divide points
doubleUDisDouble. Distance between divide points
bURoundBoolean. Rounding to fit curve length
bURoundMethodBoolean. true = round down. false = round up
bUAddEndBoolean. Add end point (When divide by direct distance)
intVMethodInteger. Extrude method in second ( V ) direction (0=Parallel, 1=Polar)
intVNumInteger. Number of points in second ( V ) direction
doubleVDisDouble. Distance/Angle between points in second ( V ) direction
vectorVDirArray. Second direction
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by two direction curves Create ordered grid of points using two directional curves.

Syntax:

PTObj.GridByTwoDirectionCurves( arrstrCrvs, intUMethod, intUNum, doubleUDis, bURound, bURoundmethod, bUAddend, intVMethod, intVNum, doubleVDis, bVRound, bVRoundmethod, bVAddend, bGroup, strName )

Parameters:

arrstrCrvsArray of two Strings. Direction curves
intUMethodInteger. Divide method of direction curve (0=ByNumber, 1=ByDistance, 2=ByDirectDistance)
intUNumInteger. Number of divide points
doubleUDisDouble. Distance between divide points
bURoundBoolean. Rounding to fit curve length
bURoundMethodBoolean. true = round down. false = round up
bUAddEndBoolean. Add end point (When divide by direct distance)
intVMethodInteger. Divide method of second curve (0=ByNumber, 1=ByDistance, 2=ByDirectDistance)
intVNumInteger. Number of divide points
doubleVDisDouble. Distance between divide points
bVRoundBoolean. Rounding to fit curve length
bVRoundMethodBoolean. true = round down. false = round up
bVAddEndBoolean. Add end point (When divide by direct distance)
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by U curves Create ordered grid of points using array of curves.

Syntax:

PTObj.GridByUCurves( arrstrCrvs, intMethod, intNum, doubleDis, bRound, bRoundmethod, bAddend, bGroup, strName )

Parameters:

arrstrCrvsArray of Strings. Curves in order
intMethodInteger. Divide method of curves (0=ByNumber, 1=ByDistance, 2=ByDirectDistance)
intNumInteger. Number of divide points
doubleDisDouble. Distance between divide points
bRoundBoolean. Rounding to fit curve length
bRoundMethodBoolean. true = round down. false = round up
bAddEndBoolean. Add end point (When divide by direct distance)
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by UV curves Create ordered grid of points using array of curves in two directions. Grid is made out of curves intersections.

Syntax:

PTObj.GridByUVCurves( arrstrCrvs0, arrstrCrvs1, bGroup, strName )

Parameters:

arrstrCrvsArray of Strings. Curves of first direction, in order
arrstrCrvsArray of Strings. Curves of second direction, in order
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by object direction Create ordered grid of points using base object and direction curve.

Syntax:

PTObj.GridByObjectDirection(strBrepObject, strCrvObject, vectorProjDir, vectorExtrudeDir, intCutNum, doubleCutDis, intMethod, intNum, doubleDis, bRound, bRoundmethod, bAddend, bGroup, strName )

Parameters:

strBrepObjectString. Object to create grid for
strCrvObjectString. Direction curve
vectorProjDirArray(x,y,z). Projection direction
vectorExtrudeDirArray(x,y,z). Extrusion direction
intCutNumInteger. Number of cuts
doubleCutDisDouble. Distance between cuts
intMethodInteger. Divide method of curves (0=ByNumber, 1=ByDistance, 2=ByDirectDistance)
intNumInteger. Number of divide points
doubleDisDouble. Distance between divide points
bRoundBoolean. Rounding to fit curve length
bRoundMethodBoolean. true = round down. false = round up
bAddEndBoolean. Add end point (When divide by direct distance)
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by surface UV Create ordered grid of points following input surface UV direction.

Syntax:

PTObj.GridBySurfaceUV( strSrfObject, bUMode, bVMode, intUNum, intVNum, doubleUDis, doubleVDis, bURound, bVRound, bURoundMethod, bVRoundMethod, bGroup, strName )

Parameters:

strSrfObjectString. Surface object to generate point grid for
bUModeBool. Divide mode in U direction: False=By-Number, True=By-Distance
bVModeBool. Divide mode in V direction: False=By-Number, True=By-Distance
intUNumInteger. Number of points in first ( U ) direction
intVNumInteger. Number of points in second ( V ) direction
doubleUDisDouble. Distance between points in first ( U ) direction
doubleVDisDouble. Distance between points in second ( V ) direction
bURoundBool. Option to round result in U direction
bVRoundBool. Option to round result in V direction
bURoundMethodBool. True = round down. False = round up
bVRoundMethodBool. True = round down. False = round up
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Grid by direct distance on surface Create ordered grid of points using input surface and distance between points.

Syntax:

PTObj.GridByDirectDistanceOnSurface( strSrfObject, doubleUDis, doubleVDis, bExtend, , bGroup, strName )

Parameters:

strSrfObjectString. Surface object to generate point grid for
doubleUDisDouble. Distance between points in first ( U ) direction
doubleVDisDouble. Distance between points in second ( V ) direction
bExtendBool. True = extend surface to possibly get better coverage
bGroupBool. Option to group result
strNameString. Grid name

Returns:

ArrayArray of point-objects
NullIf not successful, or on error

Insert a point in a grid This is useful for building custom grid of points.

Syntax:

PTObj.InsertPointInGrid( ptPoint, intRow, intCol, [optional] strName )

Parameters:

ptPointArray. Point to be added to a grid
intRowInteger. Row index of the point
intColInteger. Column index of the point
strName[optional]String. Grid name

Returns:

StringPoint object
NullIf not successful, or on error

Surface by edit point grid Create a NURBs surface from a point grid.

Syntax:

PTObj.SurfaceByGrid( arrGrid grid )

Parameters:

arrGridArray. Array of paneling point objects (ordered points)

Returns:

StringSurface object
NullIf not successful, or on error

Surface by control point grid Create a NURBs surface from a grid of control points.

Syntax:

PTObj.SurfaceByControlGrid( arrGrid )

Parameters:

arrGridArray. Array of paneling point objects (ordered points)

Returns:

StringSurface object
NullIf not successful, or on error

Divide Curve with Variable Distances Use a list of parameters to divide a curve.

Syntax:

PTObj.DivideCurveByVariableDistances( strCrvObj, arrParamList, bAdd)

Parameters:

strCrvObjCurve object
arrParamListArray. Array of dividing parameters on curve
bAddBoolean. Add dividing points to context

Returns:

ArrayArray of divide points
NullIf not successful, or on error

Divide Surface with Variable Distances Use a list of parameters in U and V directions to divide a surface.

Syntax:

PTObj.DivideSurfaceByVariableDistances( strSrfObj, arrUParamList, arrVParamList, bAdd)

Parameters:

strSrfObjSurface object
arrUParamListArray. Array of dividing parameters in U direction
arrVParamListArray. Array of dividing parameters in V direction
bAddBoolean. Add dividing points to context

Returns:

Array of ArraysArray of point-objects arrays (2 dimensional array of points)
NullIf not successful, or on error