Wishes for the "Drape" tool

I see room for improvement of the “Drape” tool that would make it much more usable. Currently, the drape surface does not allow an accurate control over its shape and symmetry, especially if the user needs to redo the command multiple times while trying different settings. Things that need to be added:

  1. Ability to use Osnap while drawing the rectangle for the drape surface.

  2. Ability to select an existing rectangle curve or surface as a base surface. Even better, if non-parallel surfaces and curves could be used as an input (trapezoids etc).

  3. Ability to select the projection vector: current view, manually picked direction (like the “Planar sections” option of the “Blend surface” tool), axis, pick a curve, or normal to the base curve or surface.

  4. Preview of the expected result, in order to give a better idea of what to expect depending on the settings.

  5. More accurate spacing. For example, at 0,01 mm absolute tolerance, a drape surface with Spacing=20 results into a drape surface whose control points are 20,0943615 mm away from each other.


Would quadremesh work instead of drape? The surfaces fitting of that tool is much better IMO-

Maybe in certain cases and depending on the overall shape and the desired result. But in my option, the “Drape” tool has one advantage - it’s perfect for recreating a very complex shape via a single surface. :slight_smile:

_Patch with a starting surface may get you closer to what you want.

The Rhino.Python Primer contains a surface-fitter routine in
8 Geometry with Python
that can be extended with the functionality you want. I developed some scripts using at least its concept of translating control points based on the locations of their relevant Greville points. Here is one of them:
rhinopython/xNurbsSurface_fitToBrepsByTranslatingControlPointsAlongZAxis.py at master · CADacombs/rhinopython · GitHub

The script returned the following error message:

Exception Occured

Message: Non-ASCII character ‘\xc2’ in file D:\PROGRAMI\Rhinoceros 7\Добавки\xNurbs surface fit to breps\xNurbsSurface_fitToBrepsByTranslatingControlPointsAlongZAxis.py on line 72, but no encoding declared; see PEP 263 -- Defining Python Source Code Encodings | Python.org for details

File “D:\PROGRAMI\Rhinoceros 7\Добавки\xNurbs surface fit to breps\xNurbsSurface_fitToBrepsByTranslatingControlPointsAlongZAxis.py”, line 72

SyntaxError: Non-ASCII character ‘\xc2’ in file D:\PROGRAMI\Rhinoceros 7\Добавки\xNurbs surface fit to breps\xNurbsSurface_fitToBrepsByTranslatingControlPointsAlongZAxis.py on line 72, but no encoding declared; see PEP 263 -- Defining Python Source Code Encodings | Python.org for details


That error can occur when trying to directly _RunPythonScript the file linked above, which is an HTML file.

Click the link to go to the GitHub page, then either “Save link as…” the Raw link on the right or click Raw so you can view the code in the browser if you prefer to copy and paste it into the Rhino Python Editor.

Yes, this time around it worked once I copied the code and replaced the original Python script. However, the resulting drape surface was quite different from what I was expecting it to do. Instead of covering the model from the top, it went to the opposite end at the bottom. Here is a short video that shows it in action. The starting surface is Degree 5 with 6 control points in each direction:

I also tried with a starting surface with Degree 3 and 100 control points in each direction, but the resulting drape surface was still strange looking:

In comparison, here is what the default “Drape surface” tool of Rhino 7 does. A major drawback of this tool is the inability to snap while drawing its region, so every time I try to draw a new region its size and position is totally random and follows the mouse pointer instead of a fixed grid or an object to snap on:

I revised the script (same link) so that it now target points closest to the starting surface.

What is your application for this? Packaging?

Sometimes I use “Drape” for packaging over various items (followed by “Offset surface” and “Smooth”), but I also need it for converting a polysurface consisting multiple joined surfaces into a single surface that’s easier to point edit.
The 3d model from the video was just a random example that I used to show how the “Drape” tool was closely resembling the original surface.

I tried the updated script, but it creates a surface exactly where the starting surface is created and won’t make a drape surface over the object underneath.

Just in case, I updated the script again to prevent the starting surface from being picked from the surfaces/polysurfaces to fit to.

I don’t understand what the Command line options do. At least visually the end result seems the same, except that the first option changes the colour of the output surface.
Can you try to figure out how to improve the script by using the attached model, for example? You will notice that the resulting drape surface has some areas where it goes beyond the surface, especially where the cylindrical hole is located.

Light housing for the registration plate - sample.3dm (1000.5 KB)

The ExtrapolateMissingPts extrapolates target point locations beyond the object footprint and inside of holes instead of remaining at their locations in the starting surface. To your model, enable the option and set the ExtrapolationCt to 50 to see a drastic change beyond the target’s footprint. If the resultant surface matched the target better along the footprint, this script could also be a way to create mold runoff.

The wavy transitions along the borders of the target are due to the simple matching that this script is doing. Notice that the knot/isocurve intersections (same locations as Greville points starting at the 3rd Greville point from the ends/borders for degree 3 uniform curves/surfaces).

I’ll post in this thread or send you a message when I update this.

Thank you for the explanation! Now I better understand its purpose.
Is there a way to make an offset drape surface around a model, with the ability to set an offset distance and smooth out the result to prevent heavy unevenness?

I think the offset can be accomplished by sampling points off offset meshes of the brep model. I have some ideas on how to address the uneven results and intend on trying them some day.


would drape- smooth, quadremesh-subd- offest- nurbs (pack subd)

be useful, or does that create too much patchwork for your needs?

This potential workflow has super useful applications for creating blister packaging for consumer products… Creating the cradle that holds the product in is time consuming, as is creating the actual blister that attaches to the card.

1 Like

Yes, it is exactly for that purpose. Many consumer products need some packaging that’s a few millimeters away from their surface and must be as smooth as possible, meaning ithat it must “ignore” the tight deep areas and only follow the large, major shapes.

Please try the updated script:

It doesn’t have an offset option, but the results are less wavy.

By default, it creates the starting surface, but the user can set the plan view point spacing.

1 Like