Usage


Root  Previous item  Next item

Creating input geometry:
Before you can run this script, you have to create a surface that can be relaxed. This script doesn't create geometry, it just alters it. What you need is one of the following:
·An untrimmed nurbs surface with four naked edges. The surface may be deformed in any way.  
·An untrimmed nurbs surface that is closed in one direction only. Deformation is no problem, but you need 2 naked edges and 2 regular edges.  
·An untrimmed nurbs surface that is periodic in one direction only. Deformation is not an issue. The surface will have 2 naked edges and no regular edges.  
Use the _ShowEdges command to get information about your surface. Weighted control points are allowed, but they will not translate correctly into Relaxation Mesh Geometry causing incorrect solutions.

PatchSurface
ClosedSurface
PeriodicSurface
A very basic example of a rectangular patch NURBS surface. Four naked edges, Four corners.
An example of a surface which is closed in one direction. Surfaces that are closed have two naked edges and a seam edge which can have any continuity (G0 -> GN).
An example of a periodic surface in one direction. Periodic surfaces do not have seams or creases.


Now run the script and select the surface (you can also preselect it and run the script afterwards). Once started, the script will analyze the surface you provided. If there is a problem with the geometry, the commandline will flash red informing you about the problem:

1.The surface you selected has no free edges. Relaxation is not possible.  
2.The surface you selected does not have sufficient grips.  
3.The surface you selected is trimmed. Trims are not supported, what would you like to do?  
4.Only u-periodic surfaces are supported, what would you like to do?  
5.Only u-continues surfaces are supported, what would you like to do?  

In case of 1, nothing can be done to fix the problem and you'll have to quit the script. Fully closed surfaces are not supported.
In case of 2, you'll have to quit the script and add control points to the surface. You can do this with the _Rebuild command or with the _InsertKnot command. The script requires at least 4 control points in both surface directions.
In case of 3, you can either choose to fix the problem (remove the trim data) or simply ignore the problem. In the end the result is the same, but I recommend you Untrim the geometry before you continue. Note that this course of action may remove non-geometric data from the object. If you do not want this, you'll have to cancel the script and _Untrim it manually.
In cases 4 & 5, you can simply swap the directions and the script will work. If you have textures applied to the surface they will be flipped as well.



Adjusting the settings:
If everything goes well, the surface will be deselected again and the isocurves will become invisible. In the command line you now see 4 options:

1.Tension_Factors  
2.Geometry_Links  
3.Relax  
4.Quit  

If the surface you have selected has not been relaxed before, the script will apply default settings. You should be able to pick "Relax" right away and see the result. During the relaxation process the input surface will be hidden and it will be represented by a mesh object. If you choose to cancel a relaxation sequence before it finished, you'll have to delete the mesh manually and retrieve your surface again from the hidden layer. If you allow the routine to finish, the original surface will be deleted, and a new, relaxed surface will take its place. The relaxation settings and other properties (such as name, colour, layer, groups etc.) will be transferred.
If you do not wish to perform a relaxation, the only way out is the Quit option. You can also hit Escape (a couple of times).

If you feel the relaxed surfaces is not up to your expectations, you should alter the object settings. Surfaces have two kinds of settings:

1.Tension settings  
2.Constraints  

The first type controls how strong the surface is in certain directions and on certain locations. Just like a real fabric, surfaces have different settings for warp, weft and edges. An anisotropic material will have identical warp and weft tensions. Weaves however can have different tension factors in both directions:
Default
HiWarp
HiWeft
Fabric with default settings. Warp and Weft have an identical tension of 1% and all edges have a tension of 10%.
Here the warp tension has been increased to 5%. As you can see edges A & C remain nearly unaffected. The average distance between B & D has been decreased.
Here you see the opposite scenario. Warp tension is back to default and Weft has been increased to 5%.


In order to set custom tension factors for Warp or Weft use;
Tension_Factors -> Warp/Weft


Edges can also have unique tension factors:
HiEdge
LowEdge
MixedEdge
The same surface as before, Warp and Weft are default. The edge tensions have all been increased from 10% to 50%. They now completely overpower the fabric Warp and Weft tension.
This time with lower edge tensions (3%). The edges are affected strongly by the fabric fill.
We increased the tension of edge D from 3% to 50%. The higher the tension,the greater the strength, the straighter the direction tends to become.





The second type of settings controls the freedom of geometric sub-objects. With a simple surface like the one above, all four corners are fixed in space and all edges are free to do as they please. (If the corners would be free to move the entire fabric would collapse into a singularity.) We can also fix the edges in space.
Apart from "Fixed" and "Free" there is a third option available in the constraint settings. You can "Link" corners and edges to unrelated geometry in the file. Whenever mesh nodes have a link-constraint they behave as free nodes during a relaxation iteration. Once the iteration completes the nodes are pulled back onto the linked geometry by a Closest Point relation. Here you see some results when using constraints:
FixedEdge
LinkedEdge
LinkedEdges
Edge D has been deformed and fixed in space. In this case the relaxed surface is affected by the wave-pattern only very little. If the Weft tension had been smaller the wave would propagate much further.
Edge D has been linked to the yellow surface. It has an outwards curvature which would be impossible to achieve with tension factors alone.
Here all the edges are linked to the transparent box.


You can apply all sorts of constraints at the same time, but be aware that some constraints do not make sense with some surfaces. If you attempt to set corner constraints for periodic surfaces you will be warned this is not possible.



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, which lasts 20 iterations by default, 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 surface. 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 and replace the FDM mesh surface with a proper NURBS surface. 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. Node counts, link counts, tension factors the whole shebang.
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.