Usage


Root  Previous item  Next item

Creating input geometry:
Before you can run this script, you have to create a mesh that can be relaxed. This script doesn't create geometry, it just alters it. What you need is a mesh surface that has no rogue vertices or faces. In other words a 'valid' mesh object.
Now run the script and select the mesh (you can also preselect it and run the script afterwards).

Adjusting the settings:
If everything goes well, the commandline displays 4 options:
1.Tension_Factors  
2.Geometry_Links  
3.Relax  
4.Quit  

If the mesh you have selected has not been relaxed before, the script will apply default settings. If this is the case the mesh will collapse because all nodes have been set to "free". First you need to lock at least 2 nodes, though for practical application any number less than four makes no sense. You lock nodes by selecting the option "Geometry_Links". Rhino will ask you which nodes to expose. Interior nodes are encapsulated by faces on all sides while exterior nodes are part of at least one naked edge. Select all nodes you wish to alter and press Enter.

There are 3 possible states for nodes:
1.Free  
2.Fixed  
3.Linked  

"Free" means the nodes are allowed to move as they please. Usually interior nodes are free.
"Fixed" means the nodes are locked in space, they will not move no matter what. Corner nodes are usually fixed.
"Linked" means the nodes are free to walk across external geometry such as curves and surfaces.

After you set all node-properties you can apply tension factors. Tensions are properties of connections between nodes but unfortunately Rhino does not feature a way of selecting these. Instead you have to select nodes again and all connections that are part of two selected nodes will be picked. The default tension ofthe fabric is set to 10.0 Usually for cabled you will need something between 50.0 and 200.0
If you want to know more about tension settings read the explanation of the nurbs relaxer script.

Running the relaxation script in default mode:
Once you set up all your tension settings and constraints, you are ready to run the relaxation routine. During the relaxation you will receive certain feedback via the command line:

RelaxFeedback1
The relaxation process has been divided into 2 parts. A pre-flight relaxation and a damped relaxation. During the pre-flight relaxation, you will only see an iteration counter. The meshnodes are allowed to move large distances during pre-flight. The distances are based on the bounding box dimensions of the entire mesh. It is very likely the surface will become extremely messy during this period. The pre-flight part attempts to fix grossly deformed surface geometry. When it completes the damped relaxation takes over:

RelaxFeedback2
The number of iterations in the damped part is not pre-defined. Once the algorithm determines the surface has been accurately relaxed within file tolerance, it will stop refining. This usually lasts between 100 and 150 steps. With every new iteration the nodes are limited more and more. This is a reverse exponential process where the limitation of the new iteration is 95% of the iteration during the previous step. You can see the limitation (in system units) decrease in the command line. The default behaviour is not to apply damping factors to the mesh. Therefore the Damping value will remain constant at 100%.
Since these settings were determined pretty much by trial and error, you may end up with surfaces that have not been fully relaxed. If this is the case you'll need to run the script again on the partly relaxed surface.
Or you can switch to "Developer" mode and control the relaxation process in more detail...



Running the relaxation script in "Developer" mode:
The default behaviour for this script is to show a minimum of options and feedback. If you are confident about taking matters into your own hand, you may want to switch to "Developer" mode. When the script displays it's main prompt in the command line:

   Relaxation settings <Relax> (Tension_Factors Geometry_Links Relax Quit):

You have to pick one of the 4 options. However you can also type the text "Mellon" which will unlock some advanced controls. After you entered the password the main interface will look like this:

   Relaxation settings <Relax> (Tension_Factors Geometry_Links Summary Relax Relax_advanced Quit):

As you'll see two items have been added to the option list:

1.Summary  
2.Relax_Advanced  

Summary will display a message box with information about the current surface.
Relax_Advanced allows you to set your own pre-flight and damping runs. You will be prompted for the following values:
Relaxation tolerance
This value affects the part of the algorithm that determines whether or not a surface has been relaxed. It defaults to the file absolute tolerance setting. Higher values will cut the relaxation short. This is handy if you're modeling in accurate units. Note that limitation is decreased inverse exponentially. Lowering the tolerance by a certain value will therefore add more iterations to the process, then increasing the accuracy by the same amount will cut short:

LimitationGraph

Here you see a typical limitation graph. The graph starts along with the damped relaxation (pre-flight relaxation has not been included). Every iteration reduces the limitation by 95%. The limitation will never reach 0.0 so we have to supply a positive value as accuracy threshold. Let's assume that b is a default threshold of 0.01 mm. Increasing the threshold by 0.002 (a) will remove 8 iterations from the relaxation. But decreasing the threshold by 0.002 (c) will add 12 iterations to the relaxation.
Global damping factor
A damping factor to be used throughout the relaxation process. A value of 1 will not affect the solution at all, values between zero and one will ease the solution at the expense of iterations. Values higher than one will speed up relaxation but it may turn 'rogue' (getting worse with every iteration).
Initial translation limitation
This is the limitation imposed on mesh nodes during pre-flight. It defaults to 1/20 of the bounding box diagonal. Larger values allow for a faster relaxation at the expense of zen. Smaller values will ease the relaxation at the expense of progress.
limitation decay
A factor which is used to dampen the relaxation process. Smaller values will reduce iterations, but you may risk finishing before the proper shape was reached. Larger values will cause the algorithm to be more careful.
Pre-flight iterations
Surfaces that are close to their relaxed shape do not need many pre-flight iterations. It defaults to 20.
Animation folder
You will be prompted to select a folder to save the relaxation animation. If you do not wish to save the image sequence then press 'Cancel'.
Sequence name
If you picked a folder, you will be asked to name the animation. The frames of the relaxation will be named accordingly. Existing files with identical names will be overwritten so be careful. If you do not specify a name the animation will not be stored.
File format
You'll be prompted to select a file format for the frame images. If you do not select one, the animation will not be stored.
Width and Height
You'll have to specify a width and height for the frames as well. You can enter any positive number you like. It is not limited to your viewport or screen resolution.


If you chose to save an animation sequence, you can create a video file from the image frames by using any 3rd party video editing tool. VirtualDUB is a good choice. It can load image sequences, add sound, add image filters and save to several video formats.












 


For additional information.