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:
Ability to use Osnap while drawing the rectangle for the drape surface.
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).
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.
Preview of the expected result, in order to give a better idea of what to expect depending on the settings.
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.
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.
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:
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.
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.
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.
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.