User Guide

From TexGen
Jump to navigationJump to search

Graphical User Interface

The GUI is the easiest way to use TexGen, in previous version a lot of TexGen features were not accessible via the graphical user interface. However considerable effort has been made to improve this, notably version 3.1 includes a modelling interface for interactive manipulation of textile geometry and version 3.2 includes a 3d weave wizard. For those comfortable with doing a bit of programming, the Python interface is recommended.

Layout

Layout.png

At the centre is a window showing a 3d representation of the textile geometry. Initially when TexGen is loaded this window will be empty, this is because no textile models will have been created yet. After creating a textile model it will become visible, if several textile models are created they will each be open in a separate tab allowing you to work with several models at once.

There are several other windows which can be switched on and off via the drop-down menu at the top in the "Window" section. By default the controls and logs windows will be visible.

The controls window is separated into various sections: Textiles, Modeller, Domain, Rendering and Python. Note that most of these controls are also accessible via the drop-down menu at the top. These controls are used to create textile models, manipulate them and control how they are rendered to the screen amongst other things.

The log windows at the bottom contains an interactive Python Console along with Python Output and TexGen Output windows. The interactive console allows the user to type Python commands and see the results in an interactive manner. This can be useful for small operations and learning how to use the python scripting interface. For inputting a large number of Python commands it is more convenient to save it in a Python script and execute it all at once.

The Python Output log window displays all the Python code executed by the GUI. Essentially every button pressed in the user interface will create a Python command. This is done by design, making it possible to record Python scripts while interacting with the GUI. If you know how to do something with the GUI, you then automatically know how to do it with a Python script because the code is displayed.

The TexGen Output log window displays log and error messages from TexGen. These generally include information on what TexGen is doing, if something goes wrong it is useful to read the log to find out what happened. Error messages will be displayed in red so that they can be easily located.

If new messages are posted one of the log windows while it is inactive, the icon above the window will change. In the case of receiving an error message the icon will change to an error icon.

Finally the outliner window which is hidden by default gives tree representation of the textile model. Which each textile is composed of a several yarns each of which is composed of nodes. This will be covered in more detail in the modelling section.

Wizards

Weavewizard.png

The wizards are designed to create textile models with a minimum amount of input. Currently only the weave wizard has been implemented which generates models of 2d and 3d weaves. Plans to include wizards for other fabric types are in progress.

To use the weave wizard either:

  1. Select Controls -> Textiles -> Weave, or
  2. Select Main Menu -> Textiles -> Create Weave...

Create 2D Weave

Fill in the textile data on Weave Wizard as follows. Tool tips for each section can be viewed by holding the mouse over the control for about a second.

  • Warp Yarns, Weft Yarns - select number of yarns required
  • Yarn Spacing - by default this is the same for both warp and weft yarns
  • Yarn Width - by default this is the same for both warp and weft yarns
  • Fabric Thickness - at this point the yarn height will be taken to be half the fabric thickness (this can be altered in the next dialog if necessary
  • Create 3D Weave - leave unchecked for 2D weave
  • Create Default Domain - the default domain is the same as the unit cell
  • Refine model - if selected this will automatically adjust yarn cross-sections and rotations to create a textile without intersections and with a specified gap between yarns
    • Gap Size - Specify the gap between yarns when Refine Model is selected

Select Next to proceed to Weave Pattern dialog:

2DWeavePatternDialog.png

This window allows the weave pattern to be set and yarn spacing, width, and height to be adjusted.

  • Click on yarn cross-over to switch the vertical order of the crossing yarns and thus define the weave pattern.
  • Right click on the top-down view to select a cross-section passing through the selected point. This gives a schematic preview of the cross-section.
  • Set yarn spacing, width and height
    • Click on boxes running along left and top of window to select one yarn
    • Control or Shift and right click to select multiple yarns
      • Boxes representing selected yarns now appear in red
      • Right click to give pop-up menu. Select required option and enter value in subsequent dialog box
      • Changes to width and height will be applied to all selected yarns. Changes to yarn spacing will modifies the spacing between the selected yarn and the yarn after it.

Create 3D Weave

  • Create 3D Weave - check this box
  • Refine Model/Gap size - these options will now be greyed
  • Fill in the rest of the textile data on the Weave Wizard as described for a 2D weave above

Select Next to proceed to Weave Pattern dialog:

Weavepattern.png

This window allows the weave pattern to be set and yarn spacing, width, and height to be adjusted. Layers of warp and weft yarns can also be added and removed.

  • Click on the top-down view to select a cross-section passing through the selected point. This gives a schematic preview of the cross-section.
    • The cross-section view is very important when creating 3d weaves because it is the only way to set the vertical order of the warp and weft yarns. Click and drag a cross-over up or down to move it to the desired location. By doing this for each cross-section one after the other the weave pattern can be completely defined.
  • Add/remove layers
    • Click on boxes running along left and top of window to select one yarn
    • Control or Shift and Click to select multiple yarns
      • Boxes representing selected yarns now appear in red
      • Right click to give pop-up menu.
      • Select Add Layers/Remove Layers to add/remove one yarn to each set of yarns chosen
  • Set yarn spacing, width and height as for 2D Weave described above

Modeller

While the wizards provide an easy way to create textile models, flexibility and control over the geometry is sacrificed. On the other end of the spectrum the modeller allows users total control over textile geometry at the expensive of a slightly steeper learning curve. Note that the modeller can be used to modify models created with the wizards, however if this is done any subsequent changes in the wizard will erase any modifications made.

Create Textile

To invoke the modeller either:

  1. Select Controls -> Textile -> Empty, or
  2. Select Main Menu -> Textiles -> Create Empty...

In both cases a dialog box will be given in order to enter a name for the textile, this can be left blank in which case a default name will automatically be assigned.

Add Yarns

To add a single yarn either:

  1. Select Controls -> Modeller -> Yarn, or
  2. Select Main Menu -> Modeller -> Create Yarn...

In the Create Yarn dialog:

  • Enter start and end coordinates for the yarn
  • Enter number of nodes
    • The yarn will always initially be created as a straight line with equispaced nodes.
    • Once the yarn has been placed it will be visible on screen in wire frame mode.
Edit Yarn/Node Position

Select yarn/node using one of the following methods:

  1. Click on the yarn/node with the left mouse button
  2. Hold Shift while selecting yarn/node to select multiple yarns
  3. Click on the yarn/node in the Outliner tree control
  4. Hold Shift or Ctrl while clicking on yarns/nodes in outliner tree to select multiple yarns

Nodes are displayed as spheres on the centreline of the yarns.

When either yarn or nodes have been selected they will turn white. X, Y and Z axes will be displayed.

To move yarn/node once it has been selected either:

  • Click and drag one of the axes displayed. The yarn/node will be moved in the corresponding direction.
    • Precise positioning can be achieved by enabling snapping using Controls -> Modeller -> Snapping
  • Edit the coordinates in the Controls -> Modeller -> Position boxes.
Add Nodes
  1. Select node
  2. Click Outliner -> Insert Node, or
  3. Press the Insert key

The new node will be inserted in between the selected node and the previous one. Nodes cannot be inserted before the first node in the yarn.

Duplicate Yarns
  1. Select yarn
  2. Click Outliner -> Duplicate Yarn, or
  3. Press the d on the keyboard

The duplicated yarn will be an exact copy of the yarn at the same location. After duplicating the new yarn should be moved so that they no longer overlap.

Delete Yarns/Nodes
  1. Select yarn
  2. Click Outliner -> Delete Selected, or
  3. Press the Delete key


Set Yarn Path Interpolation

This specifies how the yarn path is interpolated between the nodes.

  1. Select yarn
  2. Select Main Menu -> Modeller -> Assign Interpolation... , or
  3. Select Controls -> Modeller -> Interpolation
  4. Select interpolation type from drop-down menu
  5. Periodic - check to give continuity across yarn repeats as follows:
    1. Linear - continuity of cross-section
    2. Bezier - continuity of cross-section and tangent(first order continuity)
    3. Natural Cubic - continuity of cross-section and both first and second order continuity


Set Yarn Cross-Sections

  1. Select yarn
  2. Select Main Menu -> Modeller -> Assign Section... , or
  3. Select Controls -> Modeller -> Section
  4. Select from the drop-down menu how the cross-section will vary along the length of the yarn
    1. Constant
    2. Interpolate Between Nodes - see below
    3. Interpolate Between Sections - see below
  5. Select Edit Section to change section shape


Interpolate Between Nodes
    • Highlight node to be edited
    • Hold Ctrl or Shift key down to select multiple nodes
    • Smooth - check this box to give smooth interpolation between section
    • Polar - check this box to give polar rather than linear interpolation between sections, useful if there are large rotations between sections
    • Select Edit Section to change selected sections
Interpolate Between Sections
    • Sections can be specified at specific positions along the length of the yarn
    • To add a section:
      • Click on Insert Section
      • Highlight the section which appears in the text box
      • Select the position along the yarn by using the slider or typing into the text box at the bottom of the dialog
    • To remove a section:
      • Highlight the section to be removed
      • Click on Remove Section
      • Smooth and Polar - check as required, see Interpolate Between Nodes
      • Highlight node to be edited
      • Hold Ctrl or Shift key down to select multiple nodes
    • Select Edit Section to change selected sections
Specify Cross-sections

After selecting the Edit Section button the Select Cross-section Shape dialog will be displayed.

The shape at the top of the dialog gives a preview of the shape currently specified.


Cross-sections can be assigned to yarns by selecting them and click on Assign section button in the modeller control window. Various options are available such as applying a constant cross section or interpolating between sections defined at different positions along the length of the yarn.